Skip to content

Commit 32c7b74

Browse files
Fix O2Linter errors
1 parent 160dd31 commit 32c7b74

1 file changed

Lines changed: 22 additions & 14 deletions

File tree

DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11+
//
12+
/// \file perfK0sResolution.cxx
13+
/// \brief V0s (K0s, Lambda and antiLambda) analysis task
14+
///
15+
/// \author Nicolò Jacazio <nicolo.jacazio@cern.ch>, Universita del Piemonte Orientale
16+
/// \author Roman Nepeivoda <roman.nepeivoda@cern.ch>, Lund University
17+
/// \author Romain Schotter <romain.schotter@cern.ch>, Austrian Academy of Sciences & MBI
18+
//
1119

1220
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
1321
#include "PWGLF/DataModel/LFStrangenessTables.h"
@@ -145,12 +153,12 @@ struct perfK0sResolution {
145153
Configurable<int> requireNegITSib{"requireNegITSib", 0, "require ITS IB selection on negative daughters? -1: no ITS IB, 0: no selection, 1: ITS IB"};
146154
Configurable<int> requirePosITSafterburner{"requirePosITSafterburner", 0, "require positive track formed out of afterburner ITS tracks? -1: no AB, 0: no selection, 1: AB"};
147155
Configurable<int> requireNegITSafterburner{"requireNegITSafterburner", 0, "require negative track formed out of afterburner ITS tracks? -1: no AB, 0: no selection, 1: AB"};
148-
Configurable<int> requirePosTRD{"trdSelectionPos", 0, "require TRD selection on positive daughters? -1: no TRD, 0: no selection, 1: TRD"};
149-
Configurable<int> requireNegTRD{"trdSelectionNeg", 0, "require TRD selection on negative daughters? -1: no TRD, 0: no selection, 1: TRD"};
150-
Configurable<int> requirePosTOF{"tofSelectionPos", 0, "require TOF selection on positive daughters? -1: no TOF, 0: no selection, 1: TOF"};
151-
Configurable<int> requireNegTOF{"tofSelectionNeg", 0, "require TOF selection on negative daughters? -1: no TOF, 0: no selection, 1: TOF"};
152-
Configurable<int> requirePosPIDforTracking{"pidHypoPos", -1, "require specific PID hypothesis used in tracking for the positive daughters? -1: no selection, 0: Electron, 1: Muon, 2: Pion, 3: Kaon, 4: Proton"};
153-
Configurable<int> requireNegPIDforTracking{"pidHypoNeg", -1, "require specific PID hypothesis used in tracking for the negative daughters? -1: no selection, 0: Electron, 1: Muon, 2: Pion, 3: Kaon, 4: Proton"};
156+
Configurable<int> requirePosTRD{"requirePosTRD", 0, "require TRD selection on positive daughters? -1: no TRD, 0: no selection, 1: TRD"};
157+
Configurable<int> requireNegTRD{"requireNegTRD", 0, "require TRD selection on negative daughters? -1: no TRD, 0: no selection, 1: TRD"};
158+
Configurable<int> requirePosTOF{"requirePosTOF", 0, "require TOF selection on positive daughters? -1: no TOF, 0: no selection, 1: TOF"};
159+
Configurable<int> requireNegTOF{"requireNegTOF", 0, "require TOF selection on negative daughters? -1: no TOF, 0: no selection, 1: TOF"};
160+
Configurable<int> requirePosPIDforTracking{"requirePosPIDforTracking", -1, "require specific PID hypothesis used in tracking for the positive daughters? -1: no selection, 0: Electron, 1: Muon, 2: Pion, 3: Kaon, 4: Proton"};
161+
Configurable<int> requireNegPIDforTracking{"requireNegPIDforTracking", -1, "require specific PID hypothesis used in tracking for the negative daughters? -1: no selection, 0: Electron, 1: Muon, 2: Pion, 3: Kaon, 4: Proton"};
154162

155163
// PID (TPC/TOF)
156164
Configurable<float> tpcPidNsigmaCut{"tpcPidNsigmaCut", 10., "tpcPidNsigmaCut"};
@@ -178,7 +186,7 @@ struct perfK0sResolution {
178186
Configurable<std::string> trackTunerParams{"trackTunerParams", "debugInfo=0|updateTrackCovMat=0|updateCurvature=1|updatePulls=0|isInputFileFromCCDB=1|pathInputFile=Users/m/mfaggin/test/inputsTrackTuner/PbPb2022|nameInputFile=trackTuner_DataLHC22sPass5_McLHC22l1b2_run529397.root|usePvRefitCorrections=0|oneOverPtCurrent=1|oneOverPtUpgr=1.2", "TrackTuner parameter initialization (format: <name>=<value>|<name>=<value>)"};
179187
OutputObj<TH1D> trackTunedTracks{TH1D("trackTunedTracks", "", 4, 0.5, 4.5), OutputObjHandlingPolicy::AnalysisObject};
180188
Configurable<std::string> lutPath{"lutPath", "GLO/Param/MatLUTInner", "Path of the Lut parametrization"};
181-
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
189+
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
182190
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
183191

184192
int runNumber = -1;
@@ -228,7 +236,7 @@ struct perfK0sResolution {
228236

229237
rK0sResolution.add("h1_stats", "h1_stats", {HistType::kTH1D, {statAxis}});
230238
TString hStatsLabels[5] = {"Selected Events", "All V0s", "Selected V0s", "Daughters have MC particles", "Daughters corr. rec."};
231-
for (Int_t n = 1; n <= rK0sResolution.get<TH1>(HIST("h1_stats"))->GetNbinsX(); n++) {
239+
for (int n = 1; n <= rK0sResolution.get<TH1>(HIST("h1_stats"))->GetNbinsX(); n++) {
232240
rK0sResolution.get<TH1>(HIST("h1_stats"))->GetXaxis()->SetBinLabel(n, hStatsLabels[n - 1]);
233241
}
234242

@@ -281,7 +289,7 @@ struct perfK0sResolution {
281289

282290
/// TrackTuner initialization
283291
if (useTrackTuner) {
284-
ccdb->setURL(ccdburl);
292+
ccdb->setURL(ccdbUrl);
285293
ccdb->setCaching(true);
286294
ccdb->setLocalObjectValidityChecking();
287295
ccdb->setFatalWhenNull(false);
@@ -633,7 +641,7 @@ struct perfK0sResolution {
633641
rK0sResolution.fill(HIST("hEventOccupancy"), occupancy);
634642

635643
rK0sResolution.fill(HIST("h1_stats"), 0.5);
636-
for (auto& v0 : fullV0s) {
644+
for (const auto& v0 : fullV0s) {
637645
rK0sResolution.fill(HIST("h1_stats"), 1.5);
638646
const auto& posTrack = v0.posTrack_as<PIDTracksIU>();
639647
const auto& negTrack = v0.negTrack_as<PIDTracksIU>();
@@ -710,7 +718,7 @@ struct perfK0sResolution {
710718
rK0sResolution.fill(HIST("hEventOccupancy"), occupancy);
711719

712720
rK0sResolution.fill(HIST("h1_stats"), 0.5);
713-
for (auto& v0 : fullV0s) {
721+
for (const auto& v0 : fullV0s) {
714722
bool daughtersHaveMCParticles = false;
715723
bool daughtersCorrRec = false;
716724
rK0sResolution.fill(HIST("h1_stats"), 1.5);
@@ -723,8 +731,8 @@ struct perfK0sResolution {
723731
if (posTrack.has_mcParticle() && negTrack.has_mcParticle()) {
724732
daughtersHaveMCParticles = true;
725733
rK0sResolution.fill(HIST("h1_stats"), 3.5);
726-
bool isPositivePion = posTrack.mcParticle().pdgCode() == 211 || (doTreatPiToMuon && posTrack.mcParticle().pdgCode() == -13);
727-
bool isNegativePion = negTrack.mcParticle().pdgCode() == -211 || (doTreatPiToMuon && negTrack.mcParticle().pdgCode() == 13);
734+
bool isPositivePion = posTrack.mcParticle().pdgCode() == PDG_t::kPiPlus || (doTreatPiToMuon && posTrack.mcParticle().pdgCode() == PDG_t::kMuonPlus);
735+
bool isNegativePion = negTrack.mcParticle().pdgCode() == PDG_t::kPiMinus || (doTreatPiToMuon && negTrack.mcParticle().pdgCode() == PDG_t::kMuonMinus);
728736
if (isPositivePion && isNegativePion) {
729737
daughtersCorrRec = true;
730738
rK0sResolution.fill(HIST("h1_stats"), 4.5);
@@ -747,7 +755,7 @@ struct perfK0sResolution {
747755
std::array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassPionCharged});
748756
}
749757

750-
bool isTrueK0s = (v0.has_mcParticle() && std::abs(v0.mcParticle().pdgCode()) == 310 && v0.mcParticle().isPhysicalPrimary() && daughtersCorrRec);
758+
bool isTrueK0s = (v0.has_mcParticle() && std::abs(v0.mcParticle().pdgCode()) == PDG_t::kK0Short && v0.mcParticle().isPhysicalPrimary() && daughtersCorrRec);
751759
if (requireTrueK0s && !isTrueK0s) {
752760
continue;
753761
}

0 commit comments

Comments
 (0)