Skip to content

Commit 5c1d44a

Browse files
committed
Event filter - formatting
1 parent 2979f70 commit 5c1d44a

File tree

1 file changed

+54
-37
lines changed

1 file changed

+54
-37
lines changed

PWGLF/Tasks/Strangeness/strangecasctrack.cxx

Lines changed: 54 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ struct StrangeCascTrack {
116116
} axesConfig;
117117

118118
// Filters events
119-
// Filter eventFilter = (o2::aod::evsel::sel8 == true);
120-
// Filter posZFilter = (nabs(o2::aod::collision::posZ) < selCuts.cutZVertex);
121-
// Filter posZFilterMC = (nabs(o2::aod::mccollision::posZ) < selCuts.cutZVertex);
119+
// Filter eventFilter = (o2::aod::evsel::sel8 == true);
120+
// Filter posZFilter = (nabs(o2::aod::collision::posZ) < selCuts.cutZVertex);
121+
// Filter posZFilterMC = (nabs(o2::aod::mccollision::posZ) < selCuts.cutZVertex);
122122

123123
// cascade reconstruction types
124124
static constexpr std::string_view kTypeNames[] = {"Standard", "Tracked"};
@@ -156,10 +156,14 @@ struct StrangeCascTrack {
156156
auto timeStamp = timestamp;
157157

158158
std::string efficiencyCCDBPath = [&]() {
159-
if (doProcesspp) return efficiencyCCDBPath_pp;
160-
if (doProcesspO) return efficiencyCCDBPath_pO;
161-
if (doProcessPbPb) return efficiencyCCDBPath_PbPb;
162-
if (doProcessOO) return efficiencyCCDBPath_OO;
159+
if (doProcesspp)
160+
return efficiencyCCDBPath_pp;
161+
if (doProcesspO)
162+
return efficiencyCCDBPath_pO;
163+
if (doProcessPbPb)
164+
return efficiencyCCDBPath_PbPb;
165+
if (doProcessOO)
166+
return efficiencyCCDBPath_OO;
163167
}();
164168

165169
TList* listEfficiencies = ccdb->getForTimeStamp<TList>(efficiencyCCDBPath, timeStamp);
@@ -251,8 +255,10 @@ struct StrangeCascTrack {
251255
template <typename TCascade>
252256
bool passesTOF(TCascade cascade, TString particle)
253257
{
254-
if (particle == "xi") return cascade.tofXiCompatibility(selCuts.nSigmaTOFXi);
255-
if (particle == "omega") return cascade.tofOmegaCompatibility(selCuts.nSigmaTOFOmega);
258+
if (particle == "xi")
259+
return cascade.tofXiCompatibility(selCuts.nSigmaTOFXi);
260+
if (particle == "omega")
261+
return cascade.tofOmegaCompatibility(selCuts.nSigmaTOFOmega);
256262
return true;
257263
}
258264
// checks whether gen cascade corresponds to PDG code
@@ -369,10 +375,9 @@ struct StrangeCascTrack {
369375
efficiencyXi = 1.;
370376
efficiencyXiErr = 0.;
371377
}
372-
373378
}
374379
}
375-
380+
376381
if (doApplyPurity) {
377382
if constexpr (requires { cascade.topologyChi2(); }) {
378383
purityOmega = hPurityOmegaTra->Interpolate(cascade.pt(), mult);
@@ -427,47 +432,55 @@ struct StrangeCascTrack {
427432
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel/MassOmega"), massOmega);
428433

429434
if constexpr (requires { collision.straMCCollisionId(); }) {
430-
if (isMCTruth(stdCasc, "xi") || isMCTruth(stdCasc, "omega")) {
431-
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/DCAxy"), cascade.dcaXYCascToPV());
432-
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/DCAz"), cascade.dcaZCascToPV());
433-
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/DCAzVSpt"), pt, cascade.dcaZCascToPV());
434-
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/Phi"), cascade.phi());
435-
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/Eta"), cascade.eta());
436-
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/EvMult"), mult);
437-
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/BachCosPA"), stdCasc.bachBaryonCosPA());
438-
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/V0CosPA"), v0cosPA);
439-
if (isMCTruth(stdCasc, "xi")) histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/MassXi"), massXi);
440-
if (isMCTruth(stdCasc, "omega")) histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/MassOmega"), massOmega);
441-
}}
435+
if (isMCTruth(stdCasc, "xi") || isMCTruth(stdCasc, "omega")) {
436+
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/DCAxy"), cascade.dcaXYCascToPV());
437+
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/DCAz"), cascade.dcaZCascToPV());
438+
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/DCAzVSpt"), pt, cascade.dcaZCascToPV());
439+
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/Phi"), cascade.phi());
440+
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/Eta"), cascade.eta());
441+
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/EvMult"), mult);
442+
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/BachCosPA"), stdCasc.bachBaryonCosPA());
443+
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/V0CosPA"), v0cosPA);
444+
if (isMCTruth(stdCasc, "xi"))
445+
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/MassXi"), massXi);
446+
if (isMCTruth(stdCasc, "omega"))
447+
histos.fill(HIST(kTypeNames[type]) + HIST("/NoSel-Truth/MassOmega"), massOmega);
448+
}
449+
}
442450

443451
// start checking selections
444452
bool passedAllSels = true;
445453
// apply general selection criteria
446454
if (doApplyCuts) {
447-
if (!isValidCasc(collision, stdCasc)) passedAllSels = false;
455+
if (!isValidCasc(collision, stdCasc))
456+
passedAllSels = false;
448457
}
449458
// apply tpc pid
450459
if (doApplyTPCPID) {
451-
if (!passesTPC(stdCasc)) passedAllSels = false;
460+
if (!passesTPC(stdCasc))
461+
passedAllSels = false;
452462
}
453463
// apply tof pid
454464
bool passedAllSelsXi = passedAllSels;
455465
bool passedAllSelsOmega = passedAllSels;
456466
if (doApplyTOFPID) {
457-
if (!passesTOF(stdCasc, "xi")) passedAllSelsXi = false;
458-
if (!passesTOF(stdCasc, "omega")) passedAllSelsOmega = false;
467+
if (!passesTOF(stdCasc, "xi"))
468+
passedAllSelsXi = false;
469+
if (!passesTOF(stdCasc, "omega"))
470+
passedAllSelsOmega = false;
459471
}
460472
// apply competing mass rej
461473
if (doCompetingMassRej) {
462-
if (!(std::abs(massXi - o2::constants::physics::MassXiMinus) > selCuts.compMassRej)) passedAllSelsOmega = false;
474+
if (!(std::abs(massXi - o2::constants::physics::MassXiMinus) > selCuts.compMassRej))
475+
passedAllSelsOmega = false;
463476
}
464477

465478
// fill truth w/ cascs that passed all applied sels
466479
double binFillXi[3] = {massXi, pt, mult};
467480

468481
if constexpr (requires { collision.straMCCollisionId(); }) {
469482
if (passedAllSels && (passedAllSelsXi || passedAllSelsOmega)) { // fill once for every desired cascade
470-
if (isMCTruth(stdCasc, "xi") || isMCTruth(stdCasc, "omega")) {
483+
if (isMCTruth(stdCasc, "xi") || isMCTruth(stdCasc, "omega")) {
471484
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec-Truth/DCAxy"), cascade.dcaXYCascToPV());
472485
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec-Truth/DCAz"), cascade.dcaZCascToPV());
473486
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec-Truth/DCAzVSpt"), pt, cascade.dcaZCascToPV());
@@ -476,17 +489,20 @@ struct StrangeCascTrack {
476489
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec-Truth/EvMult"), mult);
477490
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec-Truth/BachCosPA"), stdCasc.bachBaryonCosPA());
478491
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec-Truth/V0CosPA"), v0cosPA);
479-
}}}
492+
}
493+
}
494+
}
480495

481496
// fill rec
482497
if (passedAllSelsXi) {
483498
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec/MassXi"), massXi);
484499
fillHist(histos.get<THn>(HIST(kTypeNames[type]) + HIST("/Rec/Xi")), binFillXi, efficiencyXi, efficiencyXiErr, purityXi, purityXiErr);
485500
if constexpr (requires { collision.straMCCollisionId(); }) {
486-
if (isMCTruth(stdCasc, "xi")) {
501+
if (isMCTruth(stdCasc, "xi")) {
487502
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec-Truth/MassXi"), massXi);
488503
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec-Truth/Xi"), massXi, pt, mult);
489-
}}
504+
}
505+
}
490506
}
491507
double binFillOmega[3] = {massOmega, pt, mult};
492508
if (passedAllSelsOmega) {
@@ -496,7 +512,8 @@ struct StrangeCascTrack {
496512
if (isMCTruth(stdCasc, "omega")) {
497513
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec-Truth/MassOmega"), massOmega);
498514
histos.fill(HIST(kTypeNames[type]) + HIST("/Rec-Truth/Omega"), massOmega, pt, mult);
499-
}}
515+
}
516+
}
500517
}
501518
}
502519
}
@@ -554,12 +571,12 @@ struct StrangeCascTrack {
554571
});
555572
// for MC-specific processing
556573
histos.add("MC/Gen/EvCounter", "Event Counter", kTH1F, {{1, 0, 1}});
557-
histos.add("MC/Gen/Xi", "Xi", kTH2F, {axesConfig.axisPt, axesConfig.axisMult}); // generated Xis
558-
histos.add("MC/Gen/Omega", "Omega", kTH2F, {axesConfig.axisPt, axesConfig.axisMult}); // generated Omegas
574+
histos.add("MC/Gen/Xi", "Xi", kTH2F, {axesConfig.axisPt, axesConfig.axisMult}); // generated Xis
575+
histos.add("MC/Gen/Omega", "Omega", kTH2F, {axesConfig.axisPt, axesConfig.axisMult}); // generated Omegas
559576
histos.add("MC/Gen/PrimaryXi", "Xi primaries", kTH2F, {axesConfig.axisPt, axesConfig.axisMult}); // generated primary Xis
560577
histos.add("MC/Gen/PrimaryOmega", "Omega primaries", kTH2F, {axesConfig.axisPt, axesConfig.axisMult}); // generated primary Omegas
561-
histos.add("MC/Rec/EvCounter", "Event Counter", kTH1F, {{1, 0, 1}}); // counter of all recreated events
562-
histos.add("MC/Rec/EvMult", "Multiplicity", kTH1F, {axesConfig.axisMult}); // multiplicity of all recreated events
578+
histos.add("MC/Rec/EvCounter", "Event Counter", kTH1F, {{1, 0, 1}}); // counter of all recreated events
579+
histos.add("MC/Rec/EvMult", "Multiplicity", kTH1F, {axesConfig.axisMult}); // multiplicity of all recreated events
563580
}
564581

565582
void processDerivedData(DerCollisionWMults::iterator const& collision, DerCascDatas const& allCascs, DerTraCascDatas const& traCascs, DauTracks const&)

0 commit comments

Comments
 (0)