Skip to content

Commit 10fbdee

Browse files
authored
fix
1 parent 90fbaa2 commit 10fbdee

File tree

1 file changed

+53
-51
lines changed

1 file changed

+53
-51
lines changed

PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -42,36 +42,36 @@ using namespace o2::constants::physics;
4242
using LorentzVectorPtEtaPhiMass = ROOT::Math::PtEtaPhiMVector;
4343

4444
enum {
45-
kINEL = 1,
46-
kINEL10,
47-
kINELg0,
48-
kINELg010,
49-
kTrig,
50-
kTrig10,
51-
kTrigINELg0,
52-
kTrigINELg010,
53-
kSel8,
54-
kSel810,
55-
kSel8INELg0,
56-
kSel8INELg010,
57-
kAllCuts,
58-
kAllCuts10,
59-
kAllCutsINELg0,
60-
kAllCutsINELg010,
45+
inel = 1,
46+
inel10,
47+
inelg0,
48+
inelg010,
49+
trig,
50+
trig10,
51+
trigINELg0,
52+
trigINELg010,
53+
sel8,
54+
sel810,
55+
sel8INELg0,
56+
sel8INELg010,
57+
allCuts,
58+
allCuts10,
59+
allCutsINELg0,
60+
allCutsINELg010,
6161
};
6262

6363
enum TrackSelectionType {
64-
kAllTracks = 0,
65-
kGlobalTracks,
66-
kGlobalTracksWoPtEta,
67-
kGlobalTracksWoDCA,
68-
kQualityTracks,
69-
kInAcceptanceTracks,
64+
allTracks = 0,
65+
globalTracks,
66+
globalTracksWoPtEta,
67+
globalTracksWoDCA,
68+
qualityTracks,
69+
inAcceptanceTracks,
7070
};
7171

7272
enum PIDCutType {
73-
kSquareType = 1,
74-
kCircularType,
73+
squareType = 1,
74+
circularType,
7575
};
7676

7777
struct Lambda1520analysisinpp {
@@ -202,12 +202,12 @@ struct Lambda1520analysisinpp {
202202

203203
Filter tofPIDFilter = aod::track::tofExpMom < 0.f || ((aod::track::tofExpMom > 0.f) && (/* (nabs(aod::pidtof::tofNSigmaPi) < configPID.pidnSigmaPreSelectionCut) || */ (nabs(aod::pidtof::tofNSigmaKa) < configPID.pidnSigmaPreSelectionCut) || (nabs(aod::pidtof::tofNSigmaPr) < configPID.pidnSigmaPreSelectionCut))); // TOF
204204
Filter tpcPIDFilter = /* nabs(aod::pidtpc::tpcNSigmaPi) < configPID.pidnSigmaPreSelectionCut || */ nabs(aod::pidtpc::tpcNSigmaKa) < configPID.pidnSigmaPreSelectionCut || nabs(aod::pidtpc::tpcNSigmaPr) < configPID.pidnSigmaPreSelectionCut; // TPC
205-
Filter trackFilter = (configTracks.trackSelection == kAllTracks) ||
206-
((configTracks.trackSelection == kGlobalTracks) && requireGlobalTrackInFilter()) ||
207-
((configTracks.trackSelection == kGlobalTracksWoPtEta) && requireGlobalTrackWoPtEtaInFilter()) ||
208-
((configTracks.trackSelection == kGlobalTracksWoDCA) && requireGlobalTrackWoDCAInFilter()) ||
209-
((configTracks.trackSelection == kQualityTracks) && requireQualityTracksInFilter()) ||
210-
((configTracks.trackSelection == kInAcceptanceTracks) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks));
205+
Filter trackFilter = (configTracks.trackSelection == allTracks) ||
206+
((configTracks.trackSelection == globalTracks) && requireGlobalTrackInFilter()) ||
207+
((configTracks.trackSelection == globalTracksWoPtEta) && requireGlobalTrackWoPtEtaInFilter()) ||
208+
((configTracks.trackSelection == globalTracksWoDCA) && requireGlobalTrackWoDCAInFilter()) ||
209+
((configTracks.trackSelection == qualityTracks) && requireQualityTracksInFilter()) ||
210+
((configTracks.trackSelection == inAcceptanceTracks) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks));
211211

212212
Filter acceptanceFilter = (nabs(aod::track::eta) < configTracks.cfgCutEta && nabs(aod::track::pt) > configTracks.cMinPtcut);
213213
// Filter DCAcutFilter = (nabs(aod::track::dcaXY) < configTracks.cfgCutDCAxy) && (nabs(aod::track::dcaZ) < configTracks.cfgCutDCAz);
@@ -451,6 +451,8 @@ struct Lambda1520analysisinpp {
451451
return returnValue;
452452
}
453453

454+
auto static constexpr tripleCharge = 3.f;
455+
454456
// Check if the collision is INEL>0
455457
template <typename MCColl, typename MCPart>
456458
bool isTrueINEL0(MCColl const& /*mccoll*/, MCPart const& mcparts)
@@ -460,7 +462,7 @@ struct Lambda1520analysisinpp {
460462
continue;
461463
auto p = pdg->GetParticle(mcparticle.pdgCode());
462464
if (p != nullptr) {
463-
if (std::abs(p->Charge() / 3.0) >= 1.0) {
465+
if (std::abs(p->Charge()) >= tripleCharge) { // check if the particle is charged
464466
if (std::abs(mcparticle.eta()) < 1.0)
465467
return true;
466468
}
@@ -552,7 +554,7 @@ struct Lambda1520analysisinpp {
552554

553555
// Case 3: Has TOF → use TPC + TOF (square or circular)
554556
if (candidate.hasTOF()) {
555-
if (configPID.cPIDcutType == kSquareType) {
557+
if (configPID.cPIDcutType == squareType) {
556558
// Rectangular cut
557559
for (size_t i = 0; i < vProtonTOFPIDpTintv.size(); ++i) {
558560
if (pt < vProtonTOFPIDpTintv[i]) {
@@ -561,7 +563,7 @@ struct Lambda1520analysisinpp {
561563
return true;
562564
}
563565
}
564-
} else if (configPID.cPIDcutType == kCircularType) {
566+
} else if (configPID.cPIDcutType == circularType) {
565567
// Circular cut
566568
for (size_t i = 0; i < vProtonTPCTOFCombinedpTintv.size(); ++i) {
567569
if (pt < vProtonTPCTOFCombinedpTintv[i]) {
@@ -623,7 +625,7 @@ struct Lambda1520analysisinpp {
623625

624626
// Case 3: TOF is available → apply TPC+TOF PID logic
625627
if (candidate.hasTOF()) {
626-
if (configPID.cPIDcutType == kSquareType) {
628+
if (configPID.cPIDcutType == squareType) {
627629
// Rectangular cut
628630
for (size_t i = 0; i < vKaonTOFPIDpTintv.size(); ++i) {
629631
if (pt < vKaonTOFPIDpTintv[i]) {
@@ -633,7 +635,7 @@ struct Lambda1520analysisinpp {
633635
}
634636
}
635637
}
636-
} else if (configPID.cPIDcutType == kCircularType) {
638+
} else if (configPID.cPIDcutType == circularType) {
637639
// Circular cut
638640
for (size_t i = 0; i < vKaonTPCTOFCombinedpTintv.size(); ++i) {
639641
if (pt < vKaonTPCTOFCombinedpTintv[i]) {
@@ -1164,43 +1166,43 @@ struct Lambda1520analysisinpp {
11641166
}
11651167

11661168
// QA for Trigger efficiency
1167-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kINEL);
1169+
histos.fill(HIST("Event/hMCEventIndices"), centrality, inel);
11681170
if (inVtx10)
1169-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kINEL10);
1171+
histos.fill(HIST("Event/hMCEventIndices"), centrality, inel10);
11701172
if (isTrueINELgt0)
1171-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kINELg0);
1173+
histos.fill(HIST("Event/hMCEventIndices"), centrality, inelg0);
11721174
if (inVtx10 && isTrueINELgt0)
1173-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kINELg010);
1175+
histos.fill(HIST("Event/hMCEventIndices"), centrality, inelg010);
11741176

11751177
// TVX MB trigger
11761178
if (isTriggerTVX)
1177-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrig);
1179+
histos.fill(HIST("Event/hMCEventIndices"), centrality, trig);
11781180
if (isTriggerTVX && inVtx10)
1179-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrig10);
1181+
histos.fill(HIST("Event/hMCEventIndices"), centrality, trig10);
11801182
if (isTriggerTVX && isTrueINELgt0)
1181-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrigINELg0);
1183+
histos.fill(HIST("Event/hMCEventIndices"), centrality, trigINELg0);
11821184
if (isTriggerTVX && isTrueINELgt0 && inVtx10)
1183-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrigINELg010);
1185+
histos.fill(HIST("Event/hMCEventIndices"), centrality, trigINELg010);
11841186

11851187
// Sel8 event selection
11861188
if (isSel8)
1187-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel8);
1189+
histos.fill(HIST("Event/hMCEventIndices"), centrality, sel8);
11881190
if (isSel8 && inVtx10)
1189-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel810);
1191+
histos.fill(HIST("Event/hMCEventIndices"), centrality, sel810);
11901192
if (isSel8 && isTrueINELgt0)
1191-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel8INELg0);
1193+
histos.fill(HIST("Event/hMCEventIndices"), centrality, sel8INELg0);
11921194
if (isSel8 && isTrueINELgt0 && inVtx10)
1193-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel8INELg010);
1195+
histos.fill(HIST("Event/hMCEventIndices"), centrality, sel8INELg010);
11941196

11951197
// CollisionCuts selection
11961198
if (isInAfterAllCuts)
1197-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCuts);
1199+
histos.fill(HIST("Event/hMCEventIndices"), centrality, allCuts);
11981200
if (isInAfterAllCuts && inVtx10)
1199-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCuts10);
1201+
histos.fill(HIST("Event/hMCEventIndices"), centrality, allCuts10);
12001202
if (isInAfterAllCuts && isTrueINELgt0)
1201-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCutsINELg0);
1203+
histos.fill(HIST("Event/hMCEventIndices"), centrality, allCutsINELg0);
12021204
if (isInAfterAllCuts && isTrueINELgt0 && inVtx10)
1203-
histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCutsINELg010);
1205+
histos.fill(HIST("Event/hMCEventIndices"), centrality, allCutsINELg010);
12041206
}
12051207
PROCESS_SWITCH(Lambda1520analysisinpp, processMCTrue, "Process Event for MC only", false);
12061208

0 commit comments

Comments
 (0)