Skip to content

Commit 465be28

Browse files
authored
[PWGLF] Added histograms for Trigger Efficiency for existing task in pp and a new task for analysis in OO (#12031)
1 parent f418dee commit 465be28

File tree

3 files changed

+1292
-3
lines changed

3 files changed

+1292
-3
lines changed

PWGLF/Tasks/Resonances/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ o2physics_add_dpl_workflow(lambda1520analysis
4949
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
5050
COMPONENT_NAME Analysis)
5151

52-
o2physics_add_dpl_workflow(lstaranalysis
53-
SOURCES lstaranalysis.cxx
52+
o2physics_add_dpl_workflow(lambda1520analysisinpp
53+
SOURCES lambda1520analysisinpp.cxx
54+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
55+
COMPONENT_NAME Analysis)
56+
57+
o2physics_add_dpl_workflow(lambda1520analysisinoo
58+
SOURCES lambda1520analysisinOO.cxx
5459
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
5560
COMPONENT_NAME Analysis)
5661

PWGLF/Tasks/Resonances/lstaranalysis.cxx renamed to PWGLF/Tasks/Resonances/lambda1520analysisinOO.cxx

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,25 @@ using namespace o2::constants::physics;
4747

4848
using LorentzVectorPtEtaPhiMass = ROOT::Math::PtEtaPhiMVector;
4949

50+
enum {
51+
kINEL = 1,
52+
kINEL10,
53+
kINELg0,
54+
kINELg010,
55+
kTrig,
56+
kTrig10,
57+
kTrigINELg0,
58+
kTrigINELg010,
59+
kSel8,
60+
kSel810,
61+
kSel8INELg0,
62+
kSel8INELg010,
63+
kAllCuts,
64+
kAllCuts10,
65+
kAllCutsINELg0,
66+
kAllCutsINELg010,
67+
};
68+
5069
struct Lstaranalysis {
5170
// Define slice per Resocollision
5271
SliceCache cache;
@@ -156,6 +175,7 @@ struct Lstaranalysis {
156175
Configurable<bool> cFilladditionalMEPlots{"cFilladditionalMEPlots", false, "Additional Mixed event plots"};
157176
Configurable<bool> cFilldeltaEtaPhiPlots{"cFilldeltaEtaPhiPlots", false, "Enamble additional cuts on daughters"};
158177
Configurable<bool> cFillinvmass1DPlots{"cFillinvmass1DPlots", false, "Invariant mass 1D"};
178+
Configurable<int> multEstimator{"multEstimator", 0, "Select multiplicity estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C"};
159179

160180
Configurable<int> cfgCentEst{"cfgCentEst", 2, "Centrality estimator, 1: FT0C, 2: FT0M"};
161181

@@ -183,7 +203,7 @@ struct Lstaranalysis {
183203
ConfigurableAxis binsPtQA{"binsPtQA", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0, 10.2, 10.4, 10.6, 10.8, 11, 11.2, 11.4, 11.6, 11.8, 12, 12.2, 12.4, 12.6, 12.8, 13, 13.2, 13.4, 13.6, 13.8, 14, 14.2, 14.4, 14.6, 14.8, 15, 15.2, 15.4, 15.6, 15.8, 16, 16.2, 16.4, 16.6, 16.8, 17, 17.2, 17.4, 17.6, 17.8, 18, 18.2, 18.4, 18.6, 18.8, 19, 19.2, 19.4, 19.6, 19.8, 20}, "Binning of the pT axis"};
184204
ConfigurableAxis binsEta{"binsEta", {150, -1.5, 1.5}, ""};
185205
ConfigurableAxis binsMass{"binsMass", {70, 1.3, 2.0}, "Invariant Mass (GeV/#it{c}^2)"};
186-
ConfigurableAxis binsMult{"binsMult", {110, 0.0, 110.0}, "mult_{FT0M}"};
206+
ConfigurableAxis binsMult{"binsMult", {105, 0.0, 105.0}, "mult_{FT0M}"};
187207
ConfigurableAxis binsDCAz{"binsDCAz", {40, -0.2, 0.2}, ""};
188208
ConfigurableAxis binsDCAxy{"binsDCAxy", {40, -0.2, 0.2}, ""};
189209
ConfigurableAxis binsTPCXrows{"binsTPCXrows", {100, 60, 160}, ""};
@@ -226,6 +246,7 @@ struct Lstaranalysis {
226246
AxisSpec axisPhi{350, 0, 7, "#Phi"};
227247
AxisSpec axisMultMix{cfgMultBins, "Multiplicity"};
228248
AxisSpec axisVtxMix{cfgVtxBins, "Vertex Z (cm)"};
249+
AxisSpec idxMCAxis = {26, -0.5, 25.5, "Index"};
229250

230251
if (cFilladditionalQAeventPlots) {
231252
// event histograms
@@ -350,6 +371,7 @@ struct Lstaranalysis {
350371
}
351372

352373
// MC QA
374+
histos.add("Event/hMCEventIndices", "hMCEventIndices", kTH2D, {axisMult, idxMCAxis});
353375
if (doprocessMCTrue) {
354376
histos.add("QA/MC/h2GenEtaPt_beforeanycut", " #eta-#it{p}_{T} distribution of Generated #Lambda(1520); #eta; #it{p}_{T}; Counts;", HistType::kTHnSparseF, {axisEta, axisPtQA});
355377
histos.add("QA/MC/h2GenPhiRapidity_beforeanycut", " #phi-y distribution of Generated #Lambda(1520); #phi; y; Counts;", HistType::kTHnSparseF, {axisPhi, axisRap});
@@ -400,6 +422,46 @@ struct Lstaranalysis {
400422
}
401423
}
402424

425+
// Centralicity estimator selection
426+
template <typename ResoColl>
427+
float centEst(ResoColl ResoEvents)
428+
{
429+
float returnValue = -999.0;
430+
switch (multEstimator) {
431+
case 0:
432+
returnValue = ResoEvents.centFT0M();
433+
break;
434+
case 1:
435+
returnValue = ResoEvents.centFT0A();
436+
break;
437+
case 2:
438+
returnValue = ResoEvents.centFT0C();
439+
break;
440+
default:
441+
returnValue = ResoEvents.centFT0M();
442+
break;
443+
}
444+
return returnValue;
445+
}
446+
447+
// Check if the collision is INEL>0
448+
template <typename MCColl, typename MCPart>
449+
bool isTrueINEL0(MCColl const& /*mccoll*/, MCPart const& mcparts)
450+
{
451+
for (auto const& mcparticle : mcparts) {
452+
if (!mcparticle.isPhysicalPrimary())
453+
continue;
454+
auto p = pdg->GetParticle(mcparticle.pdgCode());
455+
if (p != nullptr) {
456+
if (std::abs(p->Charge()) >= 3) {
457+
if (std::abs(mcparticle.eta()) < 1)
458+
return true;
459+
}
460+
}
461+
}
462+
return false;
463+
}
464+
403465
template <typename TrackType>
404466
bool trackCut(const TrackType track)
405467
{
@@ -953,6 +1015,8 @@ struct Lstaranalysis {
9531015
bool inVtx10 = (std::abs(collision.mcCollision().posZ()) > 10.) ? false : true;
9541016
bool isTriggerTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX);
9551017
bool isSel8 = collision.sel8();
1018+
bool isTrueINELgt0 = isTrueINEL0(collision, mcParticles);
1019+
centrality = centEst(collision);
9561020

9571021
auto multiplicity = collision.centFT0M();
9581022

@@ -1032,6 +1096,45 @@ struct Lstaranalysis {
10321096
histos.fill(HIST("Result/MC/Genantilambda1520pt"), 4, part.pt(), multiplicity);
10331097
}
10341098
}
1099+
1100+
// QA for Trigger efficiency
1101+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kINEL);
1102+
if (inVtx10)
1103+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kINEL10);
1104+
if (isTrueINELgt0)
1105+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kINELg0);
1106+
if (inVtx10 && isTrueINELgt0)
1107+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kINELg010);
1108+
1109+
// TVX MB trigger
1110+
if (isTriggerTVX)
1111+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrig);
1112+
if (isTriggerTVX && inVtx10)
1113+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrig10);
1114+
if (isTriggerTVX && isTrueINELgt0)
1115+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrigINELg0);
1116+
if (isTriggerTVX && isTrueINELgt0 && inVtx10)
1117+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrigINELg010);
1118+
1119+
// Sel8 event selection
1120+
if (isSel8)
1121+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel8);
1122+
if (isSel8 && inVtx10)
1123+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel810);
1124+
if (isSel8 && isTrueINELgt0)
1125+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel8INELg0);
1126+
if (isSel8 && isTrueINELgt0 && inVtx10)
1127+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel8INELg010);
1128+
1129+
// CollisionCuts selection
1130+
if (isInAfterAllCuts)
1131+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCuts);
1132+
if (isInAfterAllCuts && inVtx10)
1133+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCuts10);
1134+
if (isInAfterAllCuts && isTrueINELgt0)
1135+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCutsINELg0);
1136+
if (isInAfterAllCuts && isTrueINELgt0 && inVtx10)
1137+
histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCutsINELg010);
10351138
}
10361139
PROCESS_SWITCH(Lstaranalysis, processMCTrue, "Process Event for MC only", false);
10371140

0 commit comments

Comments
 (0)