diff --git a/PWGCF/TableProducer/dptDptFilter.cxx b/PWGCF/TableProducer/dptDptFilter.cxx index ee44859500f..2fe925102b8 100644 --- a/PWGCF/TableProducer/dptDptFilter.cxx +++ b/PWGCF/TableProducer/dptDptFilter.cxx @@ -109,9 +109,20 @@ static const std::vector beforeAfterName = {"before", ""}; static const std::vector beforeAfterSufix = {"B", "A"}; /* helpers for the multiplicity axes definition */ -#define DPTDPTCENTRALITYAXIS 105, -0.5f, 104.5f -#define DPTDPTMULTIPLIICTYAXIS 1001, -0.5f, 1000.5f -#define DPTDPTFWMULTIPLICITYAXIS 1000, 0.0f, 100000.0f +static constexpr float MultiplicityUpperLimitBase[11][8] = { + /* T0A, T0C, T0M, V0A, V0C, V0M, tracks, PV contr. tracks */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f}, /* no system */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f}, /* pp Run2 */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f}, /* pPb Run2 */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f}, /* Pbp Run2 */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f}, /* PbPb Run2 */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f}, /* XeXe Run2 */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f}, /* pp Run3 */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f}, /* PbPb Run3 */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f}, /* NeNe Run3 */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f}, /* OO Run3 */ + {30e3f, 10e3f, 40e3f, 50e3f, 70e3f, 100e3f, 10e3f, 400.0f} /* pO Run3 */ +}; //============================================================================================ // The DptDptFilter histogram objects @@ -403,6 +414,7 @@ struct DptDptFilter { Configurable minOrbit{"minOrbit", -1, "Lowest orbit to track"}; Configurable maxOrbit{"maxOrbit", INT64_MAX, "Highest orbit to track"}; Configurable rctSource{"rctSource", "None", "RCT selection source: None,CBT,CBT_hadronPID,CBT_electronPID,CBT_calo,CBT_muon,CBT_muon_glo. Default: None"}; + Configurable> multiplicityUpperLimit{"multiplicityUpperLimit", {&MultiplicityUpperLimitBase[0][0], 11, 8, {systemExternalNamesMap.at(0), systemExternalNamesMap.at(1), systemExternalNamesMap.at(2), systemExternalNamesMap.at(3), systemExternalNamesMap.at(4), systemExternalNamesMap.at(5), systemExternalNamesMap.at(6), systemExternalNamesMap.at(7), systemExternalNamesMap.at(8), systemExternalNamesMap.at(9), systemExternalNamesMap.at(10)}, {multiplicitySourceConfigNamesMap.at(0), multiplicitySourceConfigNamesMap.at(1), multiplicitySourceConfigNamesMap.at(2), multiplicitySourceConfigNamesMap.at(3), multiplicitySourceConfigNamesMap.at(4), multiplicitySourceConfigNamesMap.at(5), multiplicitySourceConfigNamesMap.at(6), multiplicitySourceConfigNamesMap.at(7)}}, "Upper limits for the multiplicity observables"}; struct : ConfigurableGroup { std::string prefix = "cfgEventSelection.occupancySelection"; Configurable occupancyEstimation{"occupancyEstimation", "None", "Occupancy estimation: None, Tracks, FT0C. Default None"}; @@ -410,7 +422,7 @@ struct DptDptFilter { Configurable maxOccupancy{"maxOccupancy", 1e6f, "Maximum allowed occupancy. Depends on the occupancy estimation"}; } occupancySelection; } cfgEventSelection; - Configurable cfgSystem{"cfgSystem", "PbPb", "System: pp, PbPb, Pbp, pPb, XeXe, ppRun3, PbPbRun3. Default PbPb"}; + Configurable cfgSystem{"cfgSystem", "PbPb", "System: Auto, pp, PbPb, Pbp, pPb, XeXe, ppRun3, PbPbRun3. Default PbPb"}; Configurable cfgDataType{"cfgDataType", "data", "Data type: data, datanoevsel, MC, FastMC, OnTheFlyMC. Default data"}; Configurable cfgTriggSel{"cfgTriggSel", "MB", "Trigger selection: MB,VTXTOFMATCHED,VTXTRDMATCHED,VTXTRDTOFMATCHED,None. Default MB"}; Configurable cfgCentSpec{"cfgCentSpec", "00-10,10-20,20-30,30-40,40-50,50-60,60-70,70-80", "Centrality/multiplicity ranges in min-max separated by commas"}; @@ -485,6 +497,7 @@ struct DptDptFilter { /* if the system type is not known at this time, we have to put the initialization somewhere else */ fSystem = getSystemType(cfgSystem); + fLhcRun = multRunForSystemMap.at(fSystem); fDataType = getDataType(cfgDataType); /* create the output list which will own the task histograms */ @@ -509,44 +522,40 @@ struct DptDptFilter { fhTriggerSelectionCorrelations->GetXaxis()->SetBinLabel(ixy + 1, TString::Format("#color[%d]{%s}", triggerSelectionFlags.test(ixy) ? 2 : 1, triggerSelectionExternalNamesMap.at(ixy).c_str()).Data()); fhTriggerSelectionCorrelations->GetYaxis()->SetBinLabel(ixy + 1, TString::Format("#color[%d]{%s}", triggerSelectionFlags.test(ixy) ? 2 : 1, triggerSelectionExternalNamesMap.at(ixy).c_str()).Data()); } - /* TODO: proper axes and axes titles according to the system; still incomplete */ - std::string multestimator = getCentMultEstimatorName(fCentMultEstimator); - if (fSystem > kPbp) { - fhCentMultB = new TH1F("CentralityB", "Centrality before cut; centrality (%)", 100, 0, 100); - fhCentMultA = new TH1F("CentralityA", "Centrality; centrality (%)", 100, 0, 100); - fhMultB = new TH1F("MultB", TString::Format("%s Multiplicity before cut;%s Multiplicity;Collisions", multestimator.c_str(), multestimator.c_str()), 4001, -0.5, 4000.5); - fhMultA = new TH1F("MultA", TString::Format("%s Multiplicity;%s Multiplicity;Collisions", multestimator.c_str(), multestimator.c_str()), 4001, -0.5, 4000.5); - } else { - /* for pp, pPb and Pbp systems use multiplicity instead */ - fhCentMultB = new TH1F("MultiplicityB", "Multiplicity before cut; multiplicity (%)", 100, 0, 100); - fhCentMultA = new TH1F("MultiplicityA", "Multiplicity; multiplicity (%)", 100, 0, 100); - fhMultB = new TH1F("MultB", TString::Format("%s Multiplicity before cut;%s Multiplicity;Collisions", multestimator.c_str(), multestimator.c_str()), 601, -0.5, 600.5); - fhMultA = new TH1F("MultA", TString::Format("%s Multiplicity;%s Multiplicity;Collisions", multestimator.c_str(), multestimator.c_str()), 601, -0.5, 600.5); - } fhVertexZB = new TH1F("VertexZB", "Vertex Z; z_{vtx}", 60, -15, 15); fhVertexZA = new TH1F("VertexZA", "Vertex Z; z_{vtx}", zvtxbins, zvtxlow, zvtxup); +/* helpers for the multiplicity/centrality axes definition */ +#define DPTDPTCENTRALITYAXIS 105, -0.5f, 104.5f +#define DPTDPTMULTIPLICITYAXIS(est) 1001, -0.5f, cfgEventSelection.multiplicityUpperLimit->getData()[fSystem][est] - 0.5f + + std::string multestimator = getCentMultEstimatorName(fCentMultEstimator); + fhCentMultB = new TH1F("CentralityB", "Centrality before cut; centrality (%)", DPTDPTCENTRALITYAXIS); + fhCentMultA = new TH1F("CentralityA", "Centrality; centrality (%)", DPTDPTCENTRALITYAXIS); + fhMultB = new TH1F("MultB", TString::Format("%s Multiplicity before cut;%s Multiplicity;Collisions", multestimator.c_str(), multestimator.c_str()), DPTDPTMULTIPLICITYAXIS(estimatorMultiplicitySourceMap.at(fCentMultEstimator))); + fhMultA = new TH1F("MultA", TString::Format("%s Multiplicity;%s Multiplicity;Collisions", multestimator.c_str(), multestimator.c_str()), DPTDPTMULTIPLICITYAXIS(estimatorMultiplicitySourceMap.at(fCentMultEstimator))); + if (cfgEventSelection.fillQc) { /* the quality control histograms */ for (int i = 0; i < BeforeAfterNOOFTIMES; ++i) { - fhMultiplicityVsCentrality[i] = new TH2F(TString::Format("MultiplicityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;Centrality (%%);Number of tracks", beforeAfterName[i].c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTMULTIPLIICTYAXIS); - fhMultiplicityVsT0cMultiplicity[i] = new TH2F(TString::Format("MultiplicityVsT0cMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0C Multiplicity;Number of tracks", beforeAfterName[i].c_str()).Data(), DPTDPTFWMULTIPLICITYAXIS, DPTDPTMULTIPLIICTYAXIS); - fhMultiplicityVsT0aMultiplicity[i] = new TH2F(TString::Format("MultiplicityVsT0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0A Multiplicity;Number of tracks", beforeAfterName[i].c_str()).Data(), DPTDPTFWMULTIPLICITYAXIS, DPTDPTMULTIPLIICTYAXIS); - fhMultiplicityVsV0aMultiplicity[i] = new TH2F(TString::Format("MultiplicityVsV0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;V0A Multiplicity;Number of tracks", beforeAfterName[i].c_str()).Data(), DPTDPTFWMULTIPLICITYAXIS, DPTDPTMULTIPLIICTYAXIS); - fhMultiplicityVsPvMultiplicity[i] = new TH2F(TString::Format("MultiplicityVsPvMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;PV contributors;Number of tracks", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLIICTYAXIS, DPTDPTMULTIPLIICTYAXIS); - fhPvMultiplicityVsCentrality[i] = new TH2F(TString::Format("PvMultiplicityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;Centrality (%%);PV contributors", beforeAfterName[i].c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTMULTIPLIICTYAXIS); - fhPvMultiplicityVsT0cMultiplicity[i] = new TH2F(TString::Format("PvMultiplicityVsT0cMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0C multiplicity;PV contributors", beforeAfterName[i].c_str()).Data(), DPTDPTFWMULTIPLICITYAXIS, DPTDPTMULTIPLIICTYAXIS); - fhPvMultiplicityVsT0aMultiplicity[i] = new TH2F(TString::Format("PvMultiplicityVsT0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0A multiplicity;PV contributors", beforeAfterName[i].c_str()).Data(), DPTDPTFWMULTIPLICITYAXIS, DPTDPTMULTIPLIICTYAXIS); - fhPvMultiplicityVsV0aMultiplicity[i] = new TH2F(TString::Format("PvMultiplicityVsV0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;V0A multiplicity;PV contributors", beforeAfterName[i].c_str()).Data(), DPTDPTFWMULTIPLICITYAXIS, DPTDPTMULTIPLIICTYAXIS); - fhV0aMultiplicityVsCentrality[i] = new TH2F(TString::Format("V0aMultiplicityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;Centrality (%%);V0A multiplicity", beforeAfterName[i].c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTFWMULTIPLICITYAXIS); - fhV0aMultiplicityVsT0cMultiplicity[i] = new TH2F(TString::Format("V0aMultiplicityVsT0cMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0C multiplicity;V0A multiplicity", beforeAfterName[i].c_str()).Data(), DPTDPTFWMULTIPLICITYAXIS, DPTDPTFWMULTIPLICITYAXIS); - fhV0aMultiplicityVsT0aMultiplicity[i] = new TH2F(TString::Format("V0aMultiplicityVsT0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0A multiplicity;V0A multiplicity", beforeAfterName[i].c_str()).Data(), DPTDPTFWMULTIPLICITYAXIS, DPTDPTFWMULTIPLICITYAXIS); - fhT0cMultiplicityVsCentrality[i] = new TH2F(TString::Format("T0cMultiplicityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;Centrality (%%);T0C multiplicity", beforeAfterName[i].c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTFWMULTIPLICITYAXIS); - fhT0cMultiplicityVsT0aMultiplicity[i] = new TH2F(TString::Format("T0cMultiplicityVsT0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0A multiplicity;T0C multiplicity", beforeAfterName[i].c_str()).Data(), DPTDPTFWMULTIPLICITYAXIS, DPTDPTFWMULTIPLICITYAXIS); - fhT0CentralityVsCentrality[i] = new TH2F(TString::Format("T0CentralityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;Centrality (%%);T0 centrality(%%)", beforeAfterName[i].c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTCENTRALITYAXIS); - fhV0aCentralityVsCentrality[i] = new TH2F(TString::Format("V0aCentralityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;Centrality (%%);V0A centrality (%%)", beforeAfterName[i].c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTCENTRALITYAXIS); - fhNtpvCentralityVsCentrality[i] = new TH2F(TString::Format("NtpvCentralityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;Centrality (%%);NTPV centrality (%%)", beforeAfterName[i].c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTCENTRALITYAXIS); + fhMultiplicityVsCentrality[i] = new TH2F(TString::Format("MultiplicityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;%s centrality (%%);Number of tracks", beforeAfterName[i].c_str(), multestimator.c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTMULTIPLICITYAXIS(MultSourceNtracks)); + fhMultiplicityVsT0cMultiplicity[i] = new TH2F(TString::Format("MultiplicityVsT0cMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0C Multiplicity;Number of tracks", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLICITYAXIS(MultSourceT0C), DPTDPTMULTIPLICITYAXIS(MultSourceNtracks)); + fhMultiplicityVsT0aMultiplicity[i] = new TH2F(TString::Format("MultiplicityVsT0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0A Multiplicity;Number of tracks", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLICITYAXIS(MultSourceT0A), DPTDPTMULTIPLICITYAXIS(MultSourceNtracks)); + fhMultiplicityVsV0aMultiplicity[i] = new TH2F(TString::Format("MultiplicityVsV0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;V0A Multiplicity;Number of tracks", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLICITYAXIS(MultSourceV0A), DPTDPTMULTIPLICITYAXIS(MultSourceNtracks)); + fhMultiplicityVsPvMultiplicity[i] = new TH2F(TString::Format("MultiplicityVsPvMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;PV contributors;Number of tracks", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLICITYAXIS(MultSourcePvContributors), DPTDPTMULTIPLICITYAXIS(MultSourceNtracks)); + fhPvMultiplicityVsCentrality[i] = new TH2F(TString::Format("PvMultiplicityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;%s centrality (%%);PV contributors", beforeAfterName[i].c_str(), multestimator.c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTMULTIPLICITYAXIS(MultSourcePvContributors)); + fhPvMultiplicityVsT0cMultiplicity[i] = new TH2F(TString::Format("PvMultiplicityVsT0cMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0C multiplicity;PV contributors", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLICITYAXIS(MultSourceT0C), DPTDPTMULTIPLICITYAXIS(MultSourcePvContributors)); + fhPvMultiplicityVsT0aMultiplicity[i] = new TH2F(TString::Format("PvMultiplicityVsT0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0A multiplicity;PV contributors", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLICITYAXIS(MultSourceT0A), DPTDPTMULTIPLICITYAXIS(MultSourcePvContributors)); + fhPvMultiplicityVsV0aMultiplicity[i] = new TH2F(TString::Format("PvMultiplicityVsV0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;V0A multiplicity;PV contributors", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLICITYAXIS(MultSourceV0A), DPTDPTMULTIPLICITYAXIS(MultSourcePvContributors)); + fhV0aMultiplicityVsCentrality[i] = new TH2F(TString::Format("V0aMultiplicityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;%s centrality (%%);V0A multiplicity", beforeAfterName[i].c_str(), multestimator.c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTMULTIPLICITYAXIS(MultSourceV0A)); + fhV0aMultiplicityVsT0cMultiplicity[i] = new TH2F(TString::Format("V0aMultiplicityVsT0cMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0C multiplicity;V0A multiplicity", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLICITYAXIS(MultSourceT0C), DPTDPTMULTIPLICITYAXIS(MultSourceV0A)); + fhV0aMultiplicityVsT0aMultiplicity[i] = new TH2F(TString::Format("V0aMultiplicityVsT0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0A multiplicity;V0A multiplicity", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLICITYAXIS(MultSourceT0A), DPTDPTMULTIPLICITYAXIS(MultSourceV0A)); + fhT0cMultiplicityVsCentrality[i] = new TH2F(TString::Format("T0cMultiplicityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;%s centrality (%%);T0C multiplicity", beforeAfterName[i].c_str(), multestimator.c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTMULTIPLICITYAXIS(MultSourceT0C)); + fhT0cMultiplicityVsT0aMultiplicity[i] = new TH2F(TString::Format("T0cMultiplicityVsT0aMultiplicity%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;T0A multiplicity;T0C multiplicity", beforeAfterName[i].c_str()).Data(), DPTDPTMULTIPLICITYAXIS(MultSourceT0A), DPTDPTMULTIPLICITYAXIS(MultSourceT0C)); + fhT0CentralityVsCentrality[i] = new TH2F(TString::Format("T0CentralityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;%s centrality (%%);T0 centrality(%%)", beforeAfterName[i].c_str(), multestimator.c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTCENTRALITYAXIS); + fhV0aCentralityVsCentrality[i] = new TH2F(TString::Format("V0aCentralityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;%s centrality (%%);V0A centrality (%%)", beforeAfterName[i].c_str(), multestimator.c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTCENTRALITYAXIS); + fhNtpvCentralityVsCentrality[i] = new TH2F(TString::Format("NtpvCentralityVsCentrality%s", beforeAfterSufix[i].c_str()).Data(), TString::Format("%s;%s centrality (%%);NTPV centrality (%%)", beforeAfterName[i].c_str(), multestimator.c_str()).Data(), DPTDPTCENTRALITYAXIS, DPTDPTCENTRALITYAXIS); } } @@ -586,16 +595,8 @@ struct DptDptFilter { if ((fDataType != kData) && (fDataType != kDataNoEvtSel)) { /* create the true data histograms */ - /* TODO: proper axes and axes titles according to the system; still incomplete */ - if (fSystem > kPbp) { - fhTrueCentMultB = new TH1F("TrueCentralityB", "Centrality before (truth); centrality (%)", 100, 0, 100); - fhTrueCentMultA = new TH1F("TrueCentralityA", "Centrality (truth); centrality (%)", 100, 0, 100); - } else { - /* for pp, pPb and Pbp systems use multiplicity instead */ - fhTrueCentMultB = new TH1F("TrueMultiplicityB", "Multiplicity before (truth); multiplicity (%)", 100, 0, 100); - fhTrueCentMultA = new TH1F("TrueMultiplicityA", "Multiplicity (truth); multiplicity (%)", 100, 0, 100); - } - + fhTrueCentMultB = new TH1F("TrueCentralityB", "Centrality before (truth); centrality (%)", 100, 0, 100); + fhTrueCentMultA = new TH1F("TrueCentralityA", "Centrality (truth); centrality (%)", 100, 0, 100); fhTrueVertexZB = new TH1F("TrueVertexZB", "Vertex Z before (truth); z_{vtx}", 60, -15, 15); fhTrueVertexZA = new TH1F("TrueVertexZA", "Vertex Z (truth); z_{vtx}", zvtxbins, zvtxlow, zvtxup); if (!doprocessOnTheFlyGeneratorLevel) { diff --git a/PWGCF/TableProducer/dptDptFilter.h b/PWGCF/TableProducer/dptDptFilter.h index 0652e4c2750..d99ae8951d8 100644 --- a/PWGCF/TableProducer/dptDptFilter.h +++ b/PWGCF/TableProducer/dptDptFilter.h @@ -68,20 +68,50 @@ namespace dptdptfilter /// \enum SystemType /// \brief The type of the system under analysis enum SystemType { - kNoSystem = 0, ///< no system defined - kpp, ///< **p-p** system - kpPb, ///< **p-Pb** system - kPbp, ///< **Pb-p** system - kPbPb, ///< **Pb-Pb** system - kXeXe, ///< **Xe-Xe** system - kppRun3, ///< **p-p Run 3** system - kPbPbRun3, ///< **Pb-Pb Run 3** system - kNeNeRun3, ///< **Ne-Ne Run 3** system - kOORun3, ///< **O-O Run 3** system - kpORun3, ///< **p-O Run 3** system - knSystems ///< number of handled systems + SystemNoSystem = 0, ///< no system defined + SystemPp, ///< **p-p** system + SystemPPb, ///< **p-Pb** system + SystemPbp, ///< **Pb-p** system + SystemPbPb, ///< **Pb-Pb** system + SystemXeXe, ///< **Xe-Xe** system + SystemPpRun3, ///< **p-p Run 3** system + SystemPbPbRun3, ///< **Pb-Pb Run 3** system + SystemNeNeRun3, ///< **Ne-Ne Run 3** system + SystemOORun3, ///< **O-O Run 3** system + SystemPORun3, ///< **p-O Run 3** system + SystemNoOfSystems ///< number of handled systems }; +/// \std::map systemInternalCodesMap +/// \brief maps system names to internal system codes +static const std::map systemInternalCodesMap{ + {"", SystemNoSystem}, + {"pp", SystemPp}, + {"pPb", SystemPPb}, + {"Pbp", SystemPbp}, + {"PbPb", SystemPbPb}, + {"XeXe", SystemXeXe}, + {"ppRun3", SystemPpRun3}, + {"PbPbRun3", SystemPbPbRun3}, + {"NeNeRun3", SystemNeNeRun3}, + {"OORun3", SystemOORun3}, + {"pORun3", SystemPORun3}}; + +/// \std::map systemExternalNamesMap +/// \brief maps system internal codes to system external names +static const std::map systemExternalNamesMap{ + {SystemNoSystem, ""}, + {SystemPp, "pp"}, + {SystemPPb, "pPb"}, + {SystemPbp, "Pbp"}, + {SystemPbPb, "PbPb"}, + {SystemXeXe, "XeXe"}, + {SystemPpRun3, "ppRun3"}, + {SystemPbPbRun3, "PbPbRun3"}, + {SystemNeNeRun3, "NeNeRun3"}, + {SystemOORun3, "OORun3"}, + {SystemPORun3, "pORun3"}}; + /// \enum DataType /// \brief Which kind of data is the task addressing enum DataType { @@ -134,6 +164,93 @@ static const std::map estimatorExternalNamesMap{ {CentMultFT0C, "FT0C"}, {CentMultNTPV, "NTPV"}}; +/// \enum MultSourceType +/// \brief The multiplicity source +enum MultSourceType { + MultSourceT0A = 0, ///< T0A multiplicity + MultSourceT0C, ///< T0C multiplicity + MultSourceT0M, ///< T0M multiplicity + MultSourceV0A, ///< V0A multiplicity + MultSourceV0C, ///< V0C multiplicity + MultSourceV0M, ///< V0M multiplicity + MultSourceNtracks, ///< number of tracks multiplicity + MultSourcePvContributors, ///< number of primary vertex contributors + MultSourceNOOFSOURCES ///< number multiplicity sources +}; + +/// \enum MultRunType +/// \brief The multiplicity LHC run +enum MultRunType { + MultRunRUN1RUN2 = 0, ///< LHC Run 1 or Run 2 + MultRunRUN3, ///< LHC Run 3 + MultRunNOOFRUNS ///< number of runs for multiplicity +}; + +/// \std::map multRunForSystemMap +/// \brief maps the system to the lhc Run for multiplicity +static const std::map multRunForSystemMap{ + {SystemNoSystem, MultRunRUN1RUN2}, + {SystemPp, MultRunRUN1RUN2}, + {SystemPPb, MultRunRUN1RUN2}, + {SystemPbp, MultRunRUN1RUN2}, + {SystemPbPb, MultRunRUN1RUN2}, + {SystemXeXe, MultRunRUN1RUN2}, + {SystemPpRun3, MultRunRUN3}, + {SystemPbPbRun3, MultRunRUN3}, + {SystemNeNeRun3, MultRunRUN3}, + {SystemOORun3, MultRunRUN3}, + {SystemPORun3, MultRunRUN3}}; + +/// \std::map estimatorMultiplicitySourceMap +/// \brief maps internal estimator codes internal multiplicity sources +static const std::map estimatorMultiplicitySourceMap{ + {CentMultNOCM, MultSourceT0C}, + {CentMultV0M, MultSourceV0M}, + {CentMultCL0, MultSourceT0C}, /* TODO: for Run1,2 */ + {CentMultCL1, MultSourceT0C}, /* TODO: for Run1,2 */ + {CentMultFV0A, MultSourceV0A}, + {CentMultFT0M, MultSourceT0M}, + {CentMultFT0A, MultSourceT0A}, + {CentMultFT0C, MultSourceT0C}, + {CentMultNTPV, MultSourcePvContributors}}; + +/// \std::vector multiplicitySourceExternalNamesMap +/// \brief maps internal multiplicity source to external names for the LHC runs +static const std::vector> multiplicitySourceExternalNamesMap{ + /* Run 1 and Run 2 */ + { + {MultSourceT0A, "T0A multiplicity"}, + {MultSourceT0C, "T0C multiplicity"}, + {MultSourceT0M, "T0M multiplicity"}, + {MultSourceV0A, "V0A multiplicity"}, + {MultSourceV0C, "V0C multiplicity"}, + {MultSourceV0M, "V0M multiplicity"}, + {MultSourceNtracks, "Number of tracks"}, + {MultSourcePvContributors, "PV contributors"}}, + /* Run 3 */ + { + {MultSourceT0A, "FT0A multiplicity"}, + {MultSourceT0C, "FT0C multiplicity"}, + {MultSourceT0M, "FT0M multiplicity"}, + {MultSourceV0A, "FV0A multiplicity"}, + {MultSourceV0C, "WRONG SOURCE"}, + {MultSourceV0M, "FV0M multiplicity"}, + {MultSourceNtracks, "Number of tracks"}, + {MultSourcePvContributors, "PV contributors"}}}; + +/// \std::map multiplicitySourceConfigNamesMap +/// \brief maps internal multiplicity source to external configuration names +/// At configuration time neither the system nor the lhc run is known +static const std::map multiplicitySourceConfigNamesMap{ + {MultSourceT0A, "FT0A"}, + {MultSourceT0C, "FT0C"}, + {MultSourceT0M, "FT0M"}, + {MultSourceV0A, "FV0A"}, + {MultSourceV0C, "V0C"}, + {MultSourceV0M, "FV0M"}, + {MultSourceNtracks, "Number of tracks"}, + {MultSourcePvContributors, "PV contributors"}}; + /// \enum TriggerSelectionTags /// \brief The potential trigger tags to apply for event selection enum TriggerSelectionTags { @@ -602,7 +719,8 @@ inline TList* getCCDBInput(auto& ccdb, const char* ccdbpath, const char* ccdbdat return lst; } -SystemType fSystem = kNoSystem; +SystemType fSystem = SystemNoSystem; +MultRunType fLhcRun = MultRunRUN1RUN2; DataType fDataType = kData; CentMultEstimatorType fCentMultEstimator = CentMultV0M; OccupancyEstimationType fOccupancyEstimation = OccupancyNOOCC; /* the occupancy estimator to use */ @@ -655,42 +773,34 @@ inline SystemType getSytemTypeFromMetaData() if (period == "LHC25ad" || period == "LHC25g5") { LOGF(info, "Configuring for p-O LHC25ad period"); - return kpORun3; + return SystemPORun3; } else if (period == "LHC25ae" || period == "LHC25g6") { LOGF(info, "Configuring for O-O LHC25ae period"); - return kOORun3; + return SystemOORun3; } else if (period == "LHC25af" || period == "LHC25g7") { LOGF(info, "Configuring for Ne-Ne LHC25af period"); - return kNeNeRun3; + return SystemNeNeRun3; } else { LOGF(fatal, "DptDptCorrelations::getSystemTypeFromMetadata(). No automatic system type configuration for %s period", period.c_str()); } - return kPbp; + return SystemPbPb; } inline SystemType getSystemType(std::string const& sysstr) { /* we have to figure out how extract the system type */ - if (sysstr.empty() || (sysstr == "PbPb")) { - return kPbPb; - } else if (sysstr == "pp") { - return kpp; - } else if (sysstr == "pPb") { - return kpPb; - } else if (sysstr == "Pbp") { - return kPbp; - } else if (sysstr == "XeXe") { - return kXeXe; - } else if (sysstr == "ppRun3") { - return kppRun3; - } else if (sysstr == "PbPbRun3") { - return kPbPbRun3; - } else if (sysstr == "Auto") { + if (sysstr == "Auto") { + /* special treatment for self configuration */ + /* TODO: expand it to all systems */ return getSytemTypeFromMetaData(); } else { - LOGF(fatal, "DptDptCorrelations::getSystemType(). Wrong system type: %s", sysstr.c_str()); + if (systemInternalCodesMap.contains(sysstr)) { + return static_cast(systemInternalCodesMap.at(sysstr)); + } else { + LOGF(fatal, "DptDptCorrelations::getSystemType(). Wrong system type: %s", sysstr.c_str()); + } } - return kPbPb; + return SystemPbPb; } /// \brief Type of data according to the configuration string @@ -759,11 +869,11 @@ inline bool triggerSelectionReco(CollisionObject const& collision) { bool trigsel = false; switch (fSystem) { - case kpp: - case kpPb: - case kPbp: - case kPbPb: - case kXeXe: + case SystemPp: + case SystemPPb: + case SystemPbp: + case SystemPbPb: + case SystemXeXe: if (triggerSelectionFlags.test(TriggSelMB)) { switch (fDataType) { case kData: @@ -790,11 +900,11 @@ inline bool triggerSelectionReco(CollisionObject const& collision) trigsel = true; } break; - case kppRun3: - case kPbPbRun3: - case kNeNeRun3: - case kpORun3: - case kOORun3: { + case SystemPpRun3: + case SystemPbPbRun3: + case SystemNeNeRun3: + case SystemPORun3: + case SystemOORun3: { auto setTriggerFlags = [](auto& flags, auto const& coll) { flags.set(TriggSelMB, coll.sel8() != 0); flags.set(TriggSelNOSAMEBUNCHPUP, coll.selection_bit(aod::evsel::kNoSameBunchPileup));