-
Notifications
You must be signed in to change notification settings - Fork 671
[PWGCF] Add CFMultiplicitySet to support multiple auxilary multiplicities/centralities #12425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,13 @@ struct FilterCF { | |
| kPIDProton = BIT(1) | ||
| }; | ||
|
|
||
| enum MultiplicityEstimators : uint8_t { | ||
| kCentFT0C = BIT(0), | ||
| kMultFV0A = BIT(1), | ||
| kMultNTracksPV = BIT(2), | ||
| kMultNTracksGlobal = BIT(3), | ||
| }; | ||
|
|
||
| // Configuration | ||
| O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 7.0f, "Accepted z-vertex range") | ||
| O2_DEFINE_CONFIGURABLE(cfgCutPt, float, 0.5f, "Minimal pT for tracks") | ||
|
|
@@ -90,6 +97,7 @@ struct FilterCF { | |
| O2_DEFINE_CONFIGURABLE(tpcnclusters, int, 50, "minimum number of TPC clusters found") | ||
| O2_DEFINE_CONFIGURABLE(chi2pertpccluster, float, 2.5, "maximum Chi2 / cluster for the TPC track segment") | ||
| O2_DEFINE_CONFIGURABLE(chi2peritscluster, float, 36, "maximum Chi2 / cluster for the ITS track segment") | ||
| O2_DEFINE_CONFIGURABLE(cfgEstimatorBitMask, uint16_t, 0, "BitMask for multiplicity estimators to be included in the CFMultiplicitySet tables."); | ||
|
|
||
| // Filters and input definitions | ||
| Filter collisionZVtxFilter = nabs(aod::collision::posZ) < cfgCutVertex; | ||
|
|
@@ -117,6 +125,9 @@ struct FilterCF { | |
| Produces<aod::CFTrackRefs> outputTrackRefs; | ||
| Produces<aod::CFMcParticleRefs> outputMcParticleRefs; | ||
|
|
||
| Produces<aod::CFMultiplicitySets> outputMultSets; | ||
| std::vector<float> multiplicities{}; | ||
|
|
||
| // persistent caches | ||
| std::vector<bool> mcReconstructedCache; | ||
| std::vector<int> mcParticleLabelsCache; | ||
|
|
@@ -238,6 +249,9 @@ struct FilterCF { | |
| return 0; | ||
| } | ||
|
|
||
| template <class T> | ||
| using HasMultTables = decltype(std::declval<T&>().multNTracksPV()); | ||
|
|
||
| /// \brief Templetized process data for a given collision and its associated tracks | ||
| /// \param collision The collision object containing information about the collision | ||
| /// \param tracks The collection of tracks associated with the collision | ||
|
|
@@ -255,6 +269,19 @@ struct FilterCF { | |
| auto bc = collision.template bc_as<aod::BCsWithTimestamps>(); | ||
| outputCollisions(bc.runNumber(), collision.posZ(), collision.multiplicity(), bc.timestamp()); | ||
|
|
||
| if constexpr (std::experimental::is_detected<HasMultTables, typename T1::iterator>::value) { | ||
| multiplicities.clear(); | ||
| if (cfgEstimatorBitMask & kCentFT0C) | ||
| multiplicities.push_back(collision.centFT0C()); | ||
| if (cfgEstimatorBitMask & kMultFV0A) | ||
| multiplicities.push_back(collision.multFV0A()); | ||
| if (cfgEstimatorBitMask & kMultNTracksPV) | ||
| multiplicities.push_back(collision.multNTracksPV()); | ||
| if (cfgEstimatorBitMask & kMultNTracksGlobal) | ||
| multiplicities.push_back(collision.multNTracksGlobal()); | ||
| outputMultSets(multiplicities); | ||
| } | ||
|
|
||
|
Comment on lines
+272
to
+284
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not matter much but in principle this code could be in
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about the |
||
| if (cfgTransientTables) | ||
| outputCollRefs(collision.globalIndex()); | ||
| for (auto& track : tracks) { | ||
|
|
@@ -283,6 +310,12 @@ struct FilterCF { | |
| } | ||
| PROCESS_SWITCH(FilterCF, processDataPid, "Process data with PID", false); | ||
|
|
||
| void processDataMults(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CFMultiplicities, aod::CentFT0Cs, aod::PVMults, aod::FV0Mults, aod::MultsGlobal>>::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA>> const& tracks) | ||
| { | ||
| processDataT(collision, tracks); | ||
| } | ||
| PROCESS_SWITCH(FilterCF, processDataMults, "Process data with multiplicity sets", false); | ||
|
|
||
| /// \brief Process MC data for a given set of MC collisions and associated particles and tracks | ||
| /// \param mcCollisions The collection of MC collisions | ||
| /// \param allParticles The collection of all MC particles | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember there was a maximal number of characters (14?) for the third argument. Does this work in run time? And does the table in the file has the name o2cfmultiplicitysets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will test this. I'm not able to test locally at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right that the name is clipped to
CFMULTIPLICITYS(oro2cfmultiplicitys). It's not ideal so I'll change it in the next PR while making other fixes too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, otherwise the merging does not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktf @aalkin in the past this (too long string in the third argument) caused a compilation error? Why is this gone?