Skip to content

Commit e0a061a

Browse files
committed
Comply with o2linter checks in jetHadronsPid.cxx
1 parent f745cb3 commit e0a061a

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

PWGJE/Tasks/jetHadronsPid.cxx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ struct JetHadronsPid {
115115
Preslice<HadronTracks> tracksPerCollision = aod::track::collisionId;
116116

117117
struct : ConfigurableGroup {
118-
Configurable<int> idMethod{"idMethod", 0, "Variable for choosing pid method"};
118+
Configurable<int> pidMethod{"pidMethod", 0, "Variable for choosing pid method"};
119119
Configurable<float> rejectionSigma{"rejectionSigma", 3.0, "Rejection sigma for tof and tpc pid"};
120120
Configurable<float> ptThreshold{"ptThreshold", 0.8, "Threshold for pt for different pid methods"};
121121
Configurable<float> nSigmaCut{"nSigmaCut", 2.0, "Acceptence cut for pid methods"};
@@ -416,14 +416,18 @@ struct JetHadronsPid {
416416
return TESTBIT(track.itsClusterMap(), layer - 1);
417417
}
418418

419-
struct pidResult {
419+
struct PidResult {
420420
bool isPion, isKaon, isProton;
421421
};
422422

423423
template <typename TrackType>
424-
pidResult getPid(const TrackType& track)
424+
PidResult getPid(const TrackType& track)
425425
{
426426

427+
constexpr int ClosestMatch = 0;
428+
constexpr int ExclusiveMatch = 1;
429+
constexpr int RejectionBased = 2;
430+
427431
double const buffer = 999.0;
428432
double pt = track.pt();
429433

@@ -451,23 +455,23 @@ struct JetHadronsPid {
451455
bool isKaMatch = (dKa <= cfg.nSigmaCut);
452456
bool isPrMatch = (dPr <= cfg.nSigmaCut);
453457

454-
pidResult res{false, false, false};
458+
PidResult res{false, false, false};
455459

456-
if (cfg.idMethod == 0) {
460+
if (cfg.pidMethod == ClosestMatch) {
457461
if (isPiMatch && dPi < dKa && dPi < dPr)
458462
res.isPion = true;
459463
else if (isKaMatch && dKa < dPi && dKa < dPr)
460464
res.isKaon = true;
461465
else if (isPrMatch && dPr < dPi && dPr < dKa)
462466
res.isProton = true;
463-
} else if (cfg.idMethod == 1) {
467+
} else if (cfg.pidMethod == ExclusiveMatch) {
464468
if (isPiMatch && !isKaMatch && !isPrMatch)
465469
res.isPion = true;
466470
else if (isKaMatch && !isPiMatch && !isPrMatch)
467471
res.isKaon = true;
468472
else if (isPrMatch && !isPiMatch && !isKaMatch)
469473
res.isProton = true;
470-
} else if (cfg.idMethod == 2) {
474+
} else if (cfg.pidMethod == RejectionBased) {
471475
if (isPiMatch && dKa > cfg.rejectionSigma && dPr > cfg.rejectionSigma)
472476
res.isPion = true;
473477
else if (isKaMatch && dPi > cfg.rejectionSigma && dPr > cfg.rejectionSigma)
@@ -539,7 +543,7 @@ struct JetHadronsPid {
539543
double dcaz = track.dcaZ();
540544
int charge = track.sign();
541545

542-
pidResult pid = getPid(track);
546+
PidResult pid = getPid(track);
543547

544548
if (pid.isPion) {
545549
registryData.fill(HIST("data/pure/pions/pion_pure_tpc"), pt, track.tpcNSigmaPi());
@@ -704,7 +708,7 @@ struct JetHadronsPid {
704708
double dcaz = track.dcaZ();
705709
int charge = track.sign();
706710

707-
pidResult pid = getPid(track);
711+
PidResult pid = getPid(track);
708712

709713
if (pid.isPion) {
710714
registryData.fill(HIST("data/jets/pions/pion_jet_tpc"), pt, track.tpcNSigmaPi());
@@ -821,7 +825,7 @@ struct JetHadronsPid {
821825
double dcaz = track.dcaZ();
822826
int charge = track.sign();
823827

824-
pidResult pid = getPid(track);
828+
PidResult pid = getPid(track);
825829

826830
if (pid.isPion) {
827831
registryData.fill(HIST("data/ue/pions/pion_ue_tpc"), pt, track.tpcNSigmaPi());
@@ -949,7 +953,7 @@ struct JetHadronsPid {
949953
bool isPrimary = trueParticle.isPhysicalPrimary();
950954
int charge = track.sign();
951955

952-
pidResult pid = getPid(track);
956+
PidResult pid = getPid(track);
953957

954958
if (pid.isPion) {
955959
registryData.fill(HIST("mc/reconstruction/pions/rec_pion_all"), pt);

0 commit comments

Comments
 (0)