Skip to content

Commit 243a5ff

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 36e2ca0 + 80095e0 commit 243a5ff

File tree

59 files changed

+4158
-2626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4158
-2626
lines changed

.github/workflows/mega-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
id: ml
3939
# You can override MegaLinter flavor used to have faster performances
4040
# More info at https://megalinter.io/flavors/
41-
uses: oxsecurity/megalinter@v9.0.1
41+
uses: oxsecurity/megalinter@v9.1.0
4242
env:
4343
# All available variables are described in documentation:
4444
# https://megalinter.io/configuration/

Common/Core/TrackSelectorPID.h

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct TrackSelectorPID {
3737
};
3838
};
3939

40-
template <uint64_t pdg = kPiPlus>
40+
template <uint64_t pdg = PDG_t::kPiPlus>
4141
class TrackSelectorPidBase
4242
{
4343
public:
@@ -121,15 +121,15 @@ class TrackSelectorPidBase
121121

122122
// Get nσ for a given particle hypothesis.
123123
double nSigma = 100.;
124-
if constexpr (pdg == kElectron) {
124+
if constexpr (pdg == PDG_t::kElectron) {
125125
nSigma = track.tpcNSigmaEl();
126-
} else if constexpr (pdg == kMuonMinus) {
126+
} else if constexpr (pdg == PDG_t::kMuonMinus) {
127127
nSigma = track.tpcNSigmaMu();
128-
} else if constexpr (pdg == kPiPlus) {
128+
} else if constexpr (pdg == PDG_t::kPiPlus) {
129129
nSigma = track.tpcNSigmaPi();
130-
} else if constexpr (pdg == kKPlus) {
130+
} else if constexpr (pdg == PDG_t::kKPlus) {
131131
nSigma = track.tpcNSigmaKa();
132-
} else if constexpr (pdg == kProton) {
132+
} else if constexpr (pdg == PDG_t::kProton) {
133133
nSigma = track.tpcNSigmaPr();
134134
} else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) {
135135
nSigma = track.tpcNSigmaDe();
@@ -217,15 +217,15 @@ class TrackSelectorPidBase
217217

218218
// Get nσ for a given particle hypothesis.
219219
double nSigma = 100.;
220-
if constexpr (pdg == kElectron) {
220+
if constexpr (pdg == PDG_t::kElectron) {
221221
nSigma = track.tofNSigmaEl();
222-
} else if constexpr (pdg == kMuonMinus) {
222+
} else if constexpr (pdg == PDG_t::kMuonMinus) {
223223
nSigma = track.tofNSigmaMu();
224-
} else if constexpr (pdg == kPiPlus) {
224+
} else if constexpr (pdg == PDG_t::kPiPlus) {
225225
nSigma = track.tofNSigmaPi();
226-
} else if constexpr (pdg == kKPlus) {
226+
} else if constexpr (pdg == PDG_t::kKPlus) {
227227
nSigma = track.tofNSigmaKa();
228-
} else if constexpr (pdg == kProton) {
228+
} else if constexpr (pdg == PDG_t::kProton) {
229229
nSigma = track.tofNSigmaPr();
230230
} else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) {
231231
nSigma = track.tofNSigmaDe();
@@ -315,15 +315,15 @@ class TrackSelectorPidBase
315315

316316
// Get nσ for a given particle hypothesis.
317317
double nSigma = 100.;
318-
if constexpr (pdg == kElectron) {
318+
if constexpr (pdg == PDG_t::kElectron) {
319319
nSigma = track.rich().richNsigmaEl();
320-
} else if constexpr (pdg == kMuonMinus) {
320+
} else if constexpr (pdg == PDG_t::kMuonMinus) {
321321
nSigma = track.rich().richNsigmaMu();
322-
} else if constexpr (pdg == kPiPlus) {
322+
} else if constexpr (pdg == PDG_t::kPiPlus) {
323323
nSigma = track.rich().richNsigmaPi();
324-
} else if constexpr (pdg == kKPlus) {
324+
} else if constexpr (pdg == PDG_t::kKPlus) {
325325
nSigma = track.rich().richNsigmaKa();
326-
} else if constexpr (pdg == kProton) {
326+
} else if constexpr (pdg == PDG_t::kProton) {
327327
nSigma = track.rich().richNsigmaPr();
328328
} else {
329329
errorPdg();
@@ -364,7 +364,7 @@ class TrackSelectorPidBase
364364
template <typename T>
365365
bool isValidForMid(const T& track)
366366
{
367-
if constexpr (pdg == kMuonMinus) {
367+
if constexpr (pdg == PDG_t::kMuonMinus) {
368368
return track.midId() > -1;
369369
} else {
370370
errorPdg();
@@ -378,7 +378,7 @@ class TrackSelectorPidBase
378378
template <typename T>
379379
bool isSelectedByMid(const T& track)
380380
{
381-
if constexpr (pdg == kMuonMinus) {
381+
if constexpr (pdg == PDG_t::kMuonMinus) {
382382
return track.mid().midIsMuon() == 1; // FIXME: change to return track.midIsMuon() once the column is bool.
383383
} else {
384384
errorPdg();
@@ -392,7 +392,7 @@ class TrackSelectorPidBase
392392
template <typename T>
393393
TrackSelectorPID::Status statusMid(const T& track)
394394
{
395-
if constexpr (pdg == kMuonMinus) {
395+
if constexpr (pdg == PDG_t::kMuonMinus) {
396396
if (!isValidForMid(track)) {
397397
return TrackSelectorPID::NotApplicable;
398398
}
@@ -555,15 +555,15 @@ class TrackSelectorPidBase
555555
bool isSelectedByBayes(const T& track)
556556
{
557557
// Get index of the most probable species for a given track.
558-
if constexpr (pdg == kElectron) {
558+
if constexpr (pdg == PDG_t::kElectron) {
559559
return track.bayesID() == o2::track::PID::Electron;
560-
} else if constexpr (pdg == kMuonMinus) {
560+
} else if constexpr (pdg == PDG_t::kMuonMinus) {
561561
return track.bayesID() == o2::track::PID::Muon;
562-
} else if constexpr (pdg == kPiPlus) {
562+
} else if constexpr (pdg == PDG_t::kPiPlus) {
563563
return track.bayesID() == o2::track::PID::Pion;
564-
} else if constexpr (pdg == kKPlus) {
564+
} else if constexpr (pdg == PDG_t::kKPlus) {
565565
return track.bayesID() == o2::track::PID::Kaon;
566-
} else if constexpr (pdg == kProton) {
566+
} else if constexpr (pdg == PDG_t::kProton) {
567567
return track.bayesID() == o2::track::PID::Proton;
568568
} else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) {
569569
return track.bayesID() == o2::track::PID::Deuteron;
@@ -585,15 +585,15 @@ class TrackSelectorPidBase
585585

586586
// Get probability for a given particle hypothesis.
587587
double prob = 0.;
588-
if constexpr (pdg == kElectron) {
588+
if constexpr (pdg == PDG_t::kElectron) {
589589
prob = track.bayesEl();
590-
} else if constexpr (pdg == kMuonMinus) {
590+
} else if constexpr (pdg == PDG_t::kMuonMinus) {
591591
prob = track.bayesMu();
592-
} else if constexpr (pdg == kPiPlus) {
592+
} else if constexpr (pdg == PDG_t::kPiPlus) {
593593
prob = track.bayesPi();
594-
} else if constexpr (pdg == kKPlus) {
594+
} else if constexpr (pdg == PDG_t::kKPlus) {
595595
prob = track.bayesKa();
596-
} else if constexpr (pdg == kProton) {
596+
} else if constexpr (pdg == PDG_t::kProton) {
597597
prob = track.bayesPr();
598598
} else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) {
599599
prob = track.bayesDe();
@@ -674,11 +674,11 @@ class TrackSelectorPidBase
674674
};
675675

676676
// Predefined types
677-
using TrackSelectorEl = TrackSelectorPidBase<kElectron>; // El
678-
using TrackSelectorMu = TrackSelectorPidBase<kMuonMinus>; // Mu
679-
using TrackSelectorPi = TrackSelectorPidBase<kPiPlus>; // Pi
680-
using TrackSelectorKa = TrackSelectorPidBase<kKPlus>; // Ka
681-
using TrackSelectorPr = TrackSelectorPidBase<kProton>; // Pr
677+
using TrackSelectorEl = TrackSelectorPidBase<PDG_t::kElectron>; // El
678+
using TrackSelectorMu = TrackSelectorPidBase<PDG_t::kMuonMinus>; // Mu
679+
using TrackSelectorPi = TrackSelectorPidBase<PDG_t::kPiPlus>; // Pi
680+
using TrackSelectorKa = TrackSelectorPidBase<PDG_t::kKPlus>; // Ka
681+
using TrackSelectorPr = TrackSelectorPidBase<PDG_t::kProton>; // Pr
682682
using TrackSelectorDe = TrackSelectorPidBase<o2::constants::physics::Pdg::kDeuteron>; // De
683683

684684
#endif // COMMON_CORE_TRACKSELECTORPID_H_

Common/Tasks/qVectorsCorrection.cxx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,11 @@ struct qVectorsCorrection {
180180

181181
AxisSpec axisShift = {10, 0, 10, "shift"};
182182
AxisSpec axisBasis = {20, 0, 20, "basis"};
183+
AxisSpec axisVertex = {220, -11, 11, "vertex"};
183184

184-
histosQA.add("histCentFull", "Centrality distribution for valid events",
185-
HistType::kTH1F, {axisCent});
185+
histosQA.add("histCentFull", "Centrality distribution for valid events", HistType::kTH1F, {axisCent});
186+
histosQA.add("histCentSelected", "Centrality distribution for valid events", HistType::kTH1F, {axisCent});
187+
histosQA.add("histVtxSelected", "Centrality distribution for valid events", HistType::kTH1F, {axisVertex});
186188

187189
for (uint i = 0; i < cfgnMods->size(); i++) {
188190
histosQA.add(Form("histQvecUncorV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}});
@@ -268,6 +270,10 @@ struct qVectorsCorrection {
268270
int RefAInd = RefAId * 4 + cfgnTotalSystem * 4 * (nmode - 2) + 3;
269271
int RefBInd = RefBId * 4 + cfgnTotalSystem * 4 * (nmode - 2) + 3;
270272

273+
if (vec.qvecAmp()[DetId] < 1e-8 || vec.qvecAmp()[RefAId] < 1e-8 || vec.qvecAmp()[RefBId] < 1e-8) {
274+
return;
275+
}
276+
271277
if (nmode == 2) {
272278
for (int ishift = 1; ishift <= 10; ishift++) {
273279
histosQA.fill(HIST("histShiftV2"), vec.cent(), 2.0 * DetId + 0.5, ishift - 0.5, TMath::Sin(ishift * static_cast<float>(nmode) * TMath::ATan2(vec.qvecIm()[DetInd], vec.qvecRe()[DetInd]) / static_cast<float>(nmode)));
@@ -311,6 +317,10 @@ struct qVectorsCorrection {
311317
int RefAInd = RefAId + cfgnTotalSystem * (nmode - 2);
312318
int RefBInd = RefBId + cfgnTotalSystem * (nmode - 2);
313319

320+
if (coll.qvecAmp()[DetId] < 1e-8 || coll.qvecAmp()[RefAId] < 1e-8 || coll.qvecAmp()[RefBId] < 1e-8) {
321+
return;
322+
}
323+
314324
for (auto& trk : track) {
315325
if (!SelTrack(trk)) {
316326
continue;
@@ -424,6 +434,11 @@ struct qVectorsCorrection {
424434
int DetInd = DetId + cfgnTotalSystem * (nmode - 2);
425435
int RefAInd = RefAId + cfgnTotalSystem * (nmode - 2);
426436
int RefBInd = RefBId + cfgnTotalSystem * (nmode - 2);
437+
438+
if (vec.qvecAmp()[DetId] < 1e-8 || vec.qvecAmp()[RefAId] < 1e-8 || vec.qvecAmp()[RefBId] < 1e-8) {
439+
return;
440+
}
441+
427442
if (nmode == 2) {
428443
histosQA.fill(HIST("histQvecFinalV2"), vec.qvecShiftedRe()[DetInd], vec.qvecShiftedIm()[DetInd], vec.cent());
429444
histosQA.fill(HIST("histEvtPlFinalV2"), helperEP.GetEventPlane(vec.qvecShiftedRe()[DetInd], vec.qvecShiftedIm()[DetInd], nmode), vec.cent());
@@ -723,6 +738,8 @@ struct qVectorsCorrection {
723738
if (qVec.trackOccupancyInTimeRange() > cfgMaxOccupancy || qVec.trackOccupancyInTimeRange() < cfgMinOccupancy)
724739
return;
725740
}
741+
histosQA.fill(HIST("histCentSelected"), qVec.cent());
742+
histosQA.fill(HIST("histVtxSelected"), qVec.posZ());
726743

727744
if (cfgShiftCorPrep) {
728745
for (uint i = 0; i < cfgnMods->size(); i++) {
@@ -768,6 +785,8 @@ struct qVectorsCorrection {
768785
if (qVec.trackOccupancyInTimeRange() > cfgMaxOccupancy || qVec.trackOccupancyInTimeRange() < cfgMinOccupancy)
769786
return;
770787
}
788+
histosQA.fill(HIST("histCentSelected"), qVec.cent());
789+
histosQA.fill(HIST("histVtxSelected"), qVec.posZ());
771790

772791
for (uint i = 0; i < cfgnMods->size(); i++) {
773792
fillHistosQvecWithSC(qVec, cfgnMods->at(i));

0 commit comments

Comments
 (0)