Skip to content

Commit ce4dc92

Browse files
committed
Feat: add FLiteColShapes in collisionBuilder
1 parent 0484b3d commit ce4dc92

1 file changed

Lines changed: 26 additions & 12 deletions

File tree

PWGCF/Femto/Core/collisionBuilder.h

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class CollisionSelection : public baseselection::BaseSelection<float, o2::analys
291291
{collisionFilterNames.at(kFilterSphericityMax), mSphericityMax},
292292
{collisionFilterNames.at(kFilterRctFlags), mUseRctFlags ? 1.f : 0.f},
293293
});
294-
};
294+
}
295295

296296
/// \brief Initialize the Zorro trigger machinery for a new run. No-op if no triggers configured.
297297
template <typename T1, typename T2>
@@ -320,7 +320,7 @@ class CollisionSelection : public baseselection::BaseSelection<float, o2::analys
320320
mMagField = MagField;
321321
}
322322

323-
float getMagneticField()
323+
[[nodiscard]] int getMagneticField()
324324
{
325325
return mMagField;
326326
}
@@ -491,14 +491,14 @@ class CollisionSelection : public baseselection::BaseSelection<float, o2::analys
491491
}
492492

493493
this->assembleBitmask<SelectionHistName>();
494-
};
494+
}
495495

496496
protected:
497497
template <typename T>
498498
float computeSphericity(T const& tracks)
499499
{
500-
int minNumberTracks = 2;
501-
double maxSphericity = 2.f;
500+
const int64_t minNumberTracks = 2;
501+
const double maxSphericity = 2.f;
502502
if (tracks.size() <= minNumberTracks) {
503503
return maxSphericity;
504504
}
@@ -529,7 +529,7 @@ class CollisionSelection : public baseselection::BaseSelection<float, o2::analys
529529

530530
// filter cuts
531531
float mVtxZMin = -12.f;
532-
float mVtxZMax = -12.f;
532+
float mVtxZMax = 12.f;
533533
float mSphericityMin = 0.f;
534534
float mSphericityMax = 1.f;
535535
float mMagFieldMin = -5.f;
@@ -539,7 +539,7 @@ class CollisionSelection : public baseselection::BaseSelection<float, o2::analys
539539
float mCentMin = 0.f;
540540
float mCentMax = 100.f;
541541

542-
int mMagField = 0.f;
542+
int mMagField = 0;
543543
float mSphericity = 0.f;
544544
float mCentrality = 0.f;
545545
float mMultiplicity = 0.f;
@@ -568,6 +568,7 @@ struct CollisionBuilderProducts : o2::framework::ProducesGroup {
568568
o2::framework::Produces<o2::aod::FColMults> producedMultiplicityEstimators;
569569
o2::framework::Produces<o2::aod::FColCents> producedCentralityEstimators;
570570
o2::framework::Produces<o2::aod::FColShapes> producedShapes;
571+
o2::framework::Produces<o2::aod::FLiteColShapes> producedLiteShapes;
571572
};
572573

573574
struct ConfCollisionTables : o2::framework::ConfigurableGroup {
@@ -580,6 +581,7 @@ struct ConfCollisionTables : o2::framework::ConfigurableGroup {
580581
o2::framework::Configurable<int> produceMults{"produceMults", -1, "Produce Multiplicities (-1: auto; 0 off; 1 on)"};
581582
o2::framework::Configurable<int> produceCents{"produceCents", -1, "Produce Centralities (-1: auto; 0 off; 1 on)"};
582583
o2::framework::Configurable<int> produceShapes{"produceShapes", -1, "Produce Event shape variables (-1: auto; 0 off; 1 on)"};
584+
o2::framework::Configurable<int> produceLiteShapes{"produceLiteShapes", -1, "Produce Lite Event shape variables (-1: auto; 0 off; 1 on)"};
583585
};
584586

585587
template <auto& SelectionHistName, auto& FilterHistName>
@@ -606,16 +608,22 @@ class CollisionBuilder
606608
mProducedMultiplicities = utils::enableTable("FColMults_001", confTable.produceMults.value, initContext);
607609
mProducedCentralities = utils::enableTable("FColCents_001", confTable.produceCents.value, initContext);
608610
mProducedShapes = utils::enableTable("FColShapes_001", confTable.produceShapes.value, initContext);
611+
mProducedLiteShapes = utils::enableTable("FLiteColShapes_001", confTable.produceLiteShapes.value, initContext);
609612

610613
if (mProducedCollisions && mProducedLiteCollisions) {
611614
LOG(fatal) << "FCols and FLiteCols are mutually exclusive -- enable only one. "
612615
<< "FLiteCols is meant to only replace FCols at the producer stage (for better compression in derived data); "
613616
<< "use the dedicated converter task to reconstruct FCols from FLiteCols downstream.";
614617
}
618+
if (mProducedShapes && mProducedLiteShapes) {
619+
LOG(fatal) << "FColShapes and FLiteColShapes are mutually exclusive -- enable only one. "
620+
<< "FLiteColShapes is meant to only replace FColShapes at the producer stage (for better compression in derived data); "
621+
<< "use the dedicated converter task to reconstruct FColShapes from FLiteColShapes downstream.";
622+
}
615623

616624
if (mProducedCollisions || mProducedLiteCollisions || mProducedCollisionMasks ||
617625
mProducedPositions || mProducedSphericities || mProducedMultiplicities ||
618-
mProducedCentralities) {
626+
mProducedCentralities || mProducedShapes || mProducedLiteShapes) {
619627
mFillAnyTable = true;
620628
} else {
621629
LOG(info) << "No tables configured, Selection object will not be configured...";
@@ -634,15 +642,14 @@ class CollisionBuilder
634642
if (mRunNumber != bc.runNumber()) {
635643
mRunNumber = bc.runNumber();
636644
if (mMagFieldForced == 0) {
637-
static o2::parameters::GRPMagField* grpo = nullptr;
638-
LOG(info) << "Get magentic field with Path: " << mGrpPath << "; Run number: " << mRunNumber;
639-
grpo = ccdb->template getForRun<o2::parameters::GRPMagField>(mGrpPath, mRunNumber);
645+
o2::parameters::GRPMagField* grpo = ccdb->template getForRun<o2::parameters::GRPMagField>(mGrpPath, mRunNumber);
646+
LOG(info) << "Get magnetic field with Path: " << mGrpPath << "; Run number: " << mRunNumber;
640647
if (grpo == nullptr) {
641648
LOG(fatal) << "GRP object not found for Run " << mRunNumber;
642649
}
643650
mMagField = static_cast<int>(grpo->getNominalL3Field()); // get magnetic field in kG
644651
} else {
645-
LOG(info) << "Force magentic field to " << mMagFieldForced << "kG";
652+
LOG(info) << "Force magnetic field to " << mMagFieldForced << "kG";
646653
mMagField = mMagFieldForced;
647654
}
648655

@@ -752,6 +759,12 @@ class CollisionBuilder
752759
mCollisionSelection.getEventPlane());
753760
}
754761

762+
if (mProducedLiteShapes) {
763+
collisionProducts.producedLiteShapes(
764+
o2::aod::femtocollisions::lite::binQvec(mCollisionSelection.getQvector()),
765+
o2::aod::femtocollisions::lite::binEventPlaneAngle(mCollisionSelection.getEventPlane()));
766+
}
767+
755768
mCollisionAlreadyFilled = true;
756769
}
757770

@@ -795,6 +808,7 @@ class CollisionBuilder
795808
bool mProducedMultiplicities = false;
796809
bool mProducedCentralities = false;
797810
bool mProducedShapes = false;
811+
bool mProducedLiteShapes = false;
798812
};
799813

800814
struct CollisionBuilderDerivedToDerivedProducts : o2::framework::ProducesGroup {

0 commit comments

Comments
 (0)