Skip to content

Commit c96beee

Browse files
author
Lucia Anna Tarasovicova
committed
fix the O2 linter
1 parent 06a3ab9 commit c96beee

1 file changed

Lines changed: 38 additions & 32 deletions

File tree

PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
#include <vector>
5252

5353
// constants
54-
const float ctauxiPDG = 4.91; // from PDG
55-
const float ctauomegaPDG = 2.461; // from PDG
54+
const float ctauxi = 4.91; // from PDG
55+
const float ctauomega = 2.461; // from PDG
5656

5757
using namespace o2;
5858
using namespace o2::framework;
@@ -185,7 +185,8 @@ struct Derivedcascadeanalysis {
185185
Configurable<bool> doNTOFSigmaProtonCut{"doNTOFSigmaProtonCut", true, "Enable n sigma TOF PID cut for proton from V0"};
186186
Configurable<bool> doNTOFSigmaV0PionCut{"doNTOFSigmaV0PionCut", false, "Enable n sigma TOF PID cut for pion from V0"};
187187
Configurable<bool> doNTOFSigmaBachelorCut{"doNTOFSigmaBachelorCut", false, "Enable n sigma TOF PID cut for bachelor track"};
188-
Configurable<int> dooobrej{"dooobrej", 0, "OOB rejection: 0 no selection, 1 = ITS||TOF, 2 = TOF only for pT > ptthrtof"};
188+
Configurable<bool> dooobrej{"dooobrej", false, "OOB rejection: if true ITS||TOF is required, 2 = TOF only for pT > ptthrtof"};
189+
Configurable<bool> dooobrejPtThrTOF{"dooobrejPtThrTOF", false, "OOB rejection: if true TOF is required only for pT > ptthrtof"};
189190
Configurable<bool> doAtLeastOneTrackAB{"doAtLeastOneTrackAB", false, "require that at least one of the daughter tracks is from Afterburner"};
190191
Configurable<bool> doBachelorITSTracking{"doBachelorITSTracking", false, "require that the bachelor track is from the ITS tracking"};
191192
Configurable<bool> doAllTracksMinITSClusters{"doAllTracksMinITSClusters", false, "require that all daughter tracks have minimal ITS hits"};
@@ -229,13 +230,19 @@ struct Derivedcascadeanalysis {
229230
Configurable<float> lambdaMassWin{"lambdaMassWin", 0.005, "V0 Mass window limit"};
230231
Configurable<float> proplifetime{"proplifetime", 3, "ctau/<ctau>"};
231232
Configurable<float> ptthrtof{"ptthrtof", 2, "Pt threshold for applying only tof oob rejection"};
233+
Configurable<float> ptthrnSigmaTof{"ptthrnSigmaTof", 0.6, "Pt threshold for applying n sigma TOF for proton PID"};
232234
Configurable<float> rejcomp{"rejcomp", 0.008, "Competing Cascade rejection"};
233235
Configurable<float> masswin{"masswin", 0.05, "Mass window limit"};
234236
Configurable<float> rapCut{"rapCut", 0.5, "Rapidity acceptance"};
235237
Configurable<float> minRapCut{"minRapCut", -0.845, "minimal rapidity acceptance in case of p--o"};
236238
Configurable<float> maxRapCut{"maxRapCut", 0.155, "maximal rapidity acceptance in case of p--o"};
237239
Configurable<float> etaDauCut{"etaDauCut", 0.8, "Pseudorapidity acceptance of the cascade daughters"};
238240
Configurable<int> minITSclusters{"minITSclusters", 3, "minimal number of ITS hits for the daughter tracks"};
241+
Configurable<float> ptdepCosPACutMaxValue{"ptdepCosPACutMaxValue", 0.3, "maximal PA value for the pt dependent cut, if the cut is above this value, it will be set to this value"};
242+
Configurable<float> ptdepCosPACutMinValue{"ptdepCosPACutMinValue", 0.012, "minimal PA value for the pt dependent cut, if the cut is below this value, it will be set to this value"};
243+
Configurable<float> minPtForCosPAcut{"minPtForCosPAcut", 0.5, "minimal pT for the pt dependent cut cosPA cut, the pt is lower, the PA is set tom its maximum value ptdepCosPACutMaxValue"};
244+
Configurable<float> dcaCacsDauPtSelectionLow{"dcaCacsDauPtSelectionLow", 1.0, "low pt selection for range where DCA selection changes to Par1"};
245+
Configurable<float> dcaCacsDauPtSelectionHigh{"dcaCacsDauPtSelectionHigh", 4.0, "high pt selection for range where DCA selection changes to Par2"};
239246
} candidateSelectionValues;
240247

241248
o2::ccdb::CcdbApi ccdbApi;
@@ -247,10 +254,9 @@ struct Derivedcascadeanalysis {
247254
uint16_t selectionCheckMask;
248255
double selectionCheck;
249256

250-
static constexpr std::array<std::string_view, 10> kCentIndex = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"};
251-
static constexpr std::array<float, 11> kCentralityIntervals = {0., 5., 10., 20., 30., 40., 50., 60., 70., 80., 90.};
252-
static constexpr std::array<std::string_view, 2> kCharge = {"Positive", "Negative"};
253-
static constexpr std::array<std::string_view, 12> kSelectionNames = {"BachelorBaryonDCA", "DCAV0ToPV", "V0Radius", "CascadeRadius", "DCAV0Daughters", "DCACascDaughters", "V0pa", "CascPA", "DCABachelorToPV", "DCAMesonToPV", "DCABaryonToPV", "CascadeProperLifeTime"};
257+
static constexpr std::array<std::string_view, 10> CentIndex = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"};
258+
static constexpr std::array<float, 11> CentralityIntervals = {0., 5., 10., 20., 30., 40., 50., 60., 70., 80., 90.};
259+
static constexpr std::array<std::string_view, 12> SelectionNames = {"BachelorBaryonDCA", "DCAV0ToPV", "V0Radius", "CascadeRadius", "DCAV0Daughters", "DCACascDaughters", "V0pa", "CascPA", "DCABachelorToPV", "DCAMesonToPV", "DCABaryonToPV", "CascadeProperLifeTime"};
254260

255261
// For manual sliceBy
256262
// Preslice<soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraCollLabels>> perMcCollision = aod::v0data::straMCCollisionId;
@@ -578,11 +584,11 @@ struct Derivedcascadeanalysis {
578584
} else {
579585
ptdepCut = candidateSelectionValues.v0cosPApar0 + candidateSelectionValues.v0cosPApar1 * casc.pt();
580586
}
581-
if (ptdepCut > 0.3 && casc.pt() < 0.5) {
582-
ptdepCut = 0.3;
587+
if (ptdepCut > candidateSelectionValues.ptdepCosPACutMaxValue && casc.pt() < candidateSelectionValues.minPtForCosPAcut) {
588+
ptdepCut = candidateSelectionValues.ptdepCosPACutMaxValue;
583589
}
584-
if (ptdepCut < 0.012) {
585-
ptdepCut = 0.012;
590+
if (ptdepCut < candidateSelectionValues.ptdepCosPACutMinValue) {
591+
ptdepCut = candidateSelectionValues.ptdepCosPACutMinValue;
586592
}
587593
if (isCascPa) {
588594
histos.fill(HIST("hCutValue"), 15, std::cos(ptdepCut));
@@ -946,9 +952,9 @@ struct Derivedcascadeanalysis {
946952
if (candidateSelectionFlags.doDCACascadeDauCut) {
947953
if (candidateSelectionFlags.doPtDepDCAcascDauCut) {
948954
float ptDepCut = candidateSelectionValues.dcaCacsDauPar0;
949-
if (casc.pt() > 1 && casc.pt() < 4) {
955+
if (casc.pt() > candidateSelectionValues.dcaCacsDauPtSelectionLow && casc.pt() < candidateSelectionValues.dcaCacsDauPtSelectionHigh) {
950956
ptDepCut = candidateSelectionValues.dcaCacsDauPar1;
951-
} else if (casc.pt() > 4) {
957+
} else if (casc.pt() > candidateSelectionValues.dcaCacsDauPtSelectionHigh) {
952958
ptDepCut = candidateSelectionValues.dcaCacsDauPar2;
953959
}
954960
histos.fill(HIST("hCutValue"), 3, ptDepCut);
@@ -1116,11 +1122,11 @@ struct Derivedcascadeanalysis {
11161122
{
11171123
static_for<0, 9>([&](auto i) {
11181124
constexpr int In = i.value;
1119-
if (centrality < kCentralityIntervals[In + 1] && centrality > kCentralityIntervals[In]) {
1125+
if (centrality < CentralityIntervals[In + 1] && centrality > CentralityIntervals[In]) {
11201126
if (isPos) {
1121-
histos.fill(HIST("InvMassAfterSelCent") + HIST(kCentIndex[In]) + HIST("/hPositiveCascade"), pt, mass, occup);
1127+
histos.fill(HIST("InvMassAfterSelCent") + HIST(CentIndex[In]) + HIST("/hPositiveCascade"), pt, mass, occup);
11221128
} else {
1123-
histos.fill(HIST("InvMassAfterSelCent") + HIST(kCentIndex[In]) + HIST("/hNegativeCascade"), pt, mass, occup);
1129+
histos.fill(HIST("InvMassAfterSelCent") + HIST(CentIndex[In]) + HIST("/hNegativeCascade"), pt, mass, occup);
11241130
}
11251131
}
11261132
});
@@ -1129,11 +1135,11 @@ struct Derivedcascadeanalysis {
11291135
{
11301136
static_for<0, 9>([&](auto i) {
11311137
constexpr int In = i.value;
1132-
if (centrality < kCentralityIntervals[In + 1] && centrality > kCentralityIntervals[In]) {
1138+
if (centrality < CentralityIntervals[In + 1] && centrality > CentralityIntervals[In]) {
11331139
if (isPos) {
1134-
histos.fill(HIST("InvMassAfterSelCent") + HIST(kCentIndex[In]) + HIST("/hPositiveCascadeIR"), pt, mass, ir);
1140+
histos.fill(HIST("InvMassAfterSelCent") + HIST(CentIndex[In]) + HIST("/hPositiveCascadeIR"), pt, mass, ir);
11351141
} else {
1136-
histos.fill(HIST("InvMassAfterSelCent") + HIST(kCentIndex[In]) + HIST("/hNegativeCascadeIR"), pt, mass, ir);
1142+
histos.fill(HIST("InvMassAfterSelCent") + HIST(CentIndex[In]) + HIST("/hNegativeCascadeIR"), pt, mass, ir);
11371143
}
11381144
}
11391145
});
@@ -1142,11 +1148,11 @@ struct Derivedcascadeanalysis {
11421148
{
11431149
static_for<0, 9>([&](auto i) {
11441150
constexpr int In = i.value;
1145-
if (centrality < kCentralityIntervals[In + 1] && centrality > kCentralityIntervals[In]) {
1151+
if (centrality < CentralityIntervals[In + 1] && centrality > CentralityIntervals[In]) {
11461152
if (isPos) {
1147-
histos.fill(HIST("InvMassAfterSelCent") + HIST(kCentIndex[In]) + HIST("/hPositiveCascadeMCTruthIR"), pt, mass, ir);
1153+
histos.fill(HIST("InvMassAfterSelCent") + HIST(CentIndex[In]) + HIST("/hPositiveCascadeMCTruthIR"), pt, mass, ir);
11481154
} else {
1149-
histos.fill(HIST("InvMassAfterSelCent") + HIST(kCentIndex[In]) + HIST("/hNegativeCascadeMCTruthIR"), pt, mass, ir);
1155+
histos.fill(HIST("InvMassAfterSelCent") + HIST(CentIndex[In]) + HIST("/hNegativeCascadeMCTruthIR"), pt, mass, ir);
11501156
}
11511157
}
11521158
});
@@ -1157,9 +1163,9 @@ struct Derivedcascadeanalysis {
11571163
constexpr int In = i.value;
11581164
if (TESTBIT(selectionCheckMask, In)) {
11591165
if (isPos) {
1160-
histos.fill(HIST("PtDepCutStudy/hPositive") + HIST(kSelectionNames[In]), pt, mass, sel);
1166+
histos.fill(HIST("PtDepCutStudy/hPositive") + HIST(SelectionNames[In]), pt, mass, sel);
11611167
} else {
1162-
histos.fill(HIST("PtDepCutStudy/hNegative") + HIST(kSelectionNames[In]), pt, mass, sel);
1168+
histos.fill(HIST("PtDepCutStudy/hNegative") + HIST(SelectionNames[In]), pt, mass, sel);
11631169
}
11641170
}
11651171
});
@@ -1170,9 +1176,9 @@ struct Derivedcascadeanalysis {
11701176
constexpr int In = i.value;
11711177
if (TESTBIT(selectionCheckMask, In)) {
11721178
if (isPos) {
1173-
histos.fill(HIST("PtDepCutStudyMCTruth/hPositive") + HIST(kSelectionNames[In]), pt, mass, sel);
1179+
histos.fill(HIST("PtDepCutStudyMCTruth/hPositive") + HIST(SelectionNames[In]), pt, mass, sel);
11741180
} else {
1175-
histos.fill(HIST("PtDepCutStudyMCTruth/hNegative") + HIST(kSelectionNames[In]), pt, mass, sel);
1181+
histos.fill(HIST("PtDepCutStudyMCTruth/hNegative") + HIST(SelectionNames[In]), pt, mass, sel);
11761182
}
11771183
}
11781184
});
@@ -1437,12 +1443,12 @@ struct Derivedcascadeanalysis {
14371443

14381444
bool kHasTOF = (posExtra.hasTOF() || negExtra.hasTOF() || bachExtra.hasTOF());
14391445
bool kHasITS = (posExtra.hasITS() || negExtra.hasITS() || bachExtra.hasITS());
1440-
if (candidateSelectionFlags.dooobrej == 1) {
1446+
if (candidateSelectionFlags.dooobrej && !candidateSelectionFlags.dooobrejPtThrTOF) {
14411447
if (!kHasTOF && !kHasITS) {
14421448
continue;
14431449
}
14441450
histos.fill(HIST("hCandidate"), ++counter);
1445-
} else if (candidateSelectionFlags.dooobrej == 2) {
1451+
} else if (!candidateSelectionFlags.dooobrej && candidateSelectionFlags.dooobrejPtThrTOF) {
14461452
if (!kHasTOF && (casc.pt() > candidateSelectionValues.ptthrtof)) {
14471453
continue;
14481454
}
@@ -1462,7 +1468,7 @@ struct Derivedcascadeanalysis {
14621468

14631469
if (candidateSelectionFlags.doNTOFSigmaProtonCut && casc.sign() < 0) {
14641470
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullMomentumPosDaugh, centrality);
1465-
if (std::abs(casc.tofNSigmaXiLaPr()) > candidateSelectionValues.nsigmatofPr && fullMomentumPosDaugh > 0.6) {
1471+
if (std::abs(casc.tofNSigmaXiLaPr()) > candidateSelectionValues.nsigmatofPr && fullMomentumPosDaugh > candidateSelectionValues.ptthrnSigmaTof) {
14661472
continue;
14671473
}
14681474
}
@@ -1478,7 +1484,7 @@ struct Derivedcascadeanalysis {
14781484

14791485
if (candidateSelectionFlags.doNTOFSigmaProtonCut && casc.sign() > 0) {
14801486
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullmomentumNegDaugh, centrality);
1481-
if (std::abs(casc.tofNSigmaXiLaPr()) > candidateSelectionValues.nsigmatofPr && fullmomentumNegDaugh > 0.6) {
1487+
if (std::abs(casc.tofNSigmaXiLaPr()) > candidateSelectionValues.nsigmatofPr && fullmomentumNegDaugh > candidateSelectionValues.ptthrnSigmaTof) {
14821488
continue;
14831489
}
14841490
}
@@ -1518,7 +1524,7 @@ struct Derivedcascadeanalysis {
15181524
}
15191525
}
15201526

1521-
ctau = o2::constants::physics::MassXiMinus * cascpos / ((cascptotmom + 1e-13) * ctauxiPDG);
1527+
ctau = o2::constants::physics::MassXiMinus * cascpos / ((cascptotmom + 1e-13) * ctauxi);
15221528
if (candidateSelectionFlags.doProperLifeTimeCut) {
15231529
if (ctau > candidateSelectionValues.proplifetime) {
15241530
continue;
@@ -1547,7 +1553,7 @@ struct Derivedcascadeanalysis {
15471553
}
15481554
}
15491555

1550-
ctau = o2::constants::physics::MassOmegaMinus * cascpos / ((cascptotmom + 1e-13) * ctauomegaPDG);
1556+
ctau = o2::constants::physics::MassOmegaMinus * cascpos / ((cascptotmom + 1e-13) * ctauomega);
15511557
if (candidateSelectionFlags.doProperLifeTimeCut) {
15521558
if (ctau > candidateSelectionValues.proplifetime) {
15531559
continue;

0 commit comments

Comments
 (0)