Skip to content

Commit 173b3e8

Browse files
author
jimun_lee
committed
[PWGLF] Added also the option of cfgJetMaxEta
1 parent 3ffdc5b commit 173b3e8

1 file changed

Lines changed: 46 additions & 57 deletions

File tree

PWGLF/Tasks/Resonances/kstarInOO.cxx

Lines changed: 46 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ struct kstarInOO {
151151
Configurable<float> cfgJetpT{"cfgJetpT", 8.0, "Set Jet pT minimum"};
152152
Configurable<float> cfgJetR{"cfgJetR", 0.4, "Anti-kT Radius"};
153153
Configurable<float> cfgJetdR{"cfgJetdR", 0.4, "Set Jet radius parameter"};
154+
Configurable<float> cfgJetMaxEta{"cfgJetMaxEta", 0.9, "Set Jet Max Eta"};
155+
154156
Configurable<bool> cfgSingleJet{"cfgSingleJet", false, "Enforces strict phi-jet correspondance"};
155157
Configurable<bool> cfgReqJets{"cfgReqJets", false, "False: MB, True: Inside Jets"};
156158
Configurable<std::string> cfgRealTriggerMasks{"cfgRealTriggerMasks", "", "possible JE Trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt,fJetD0ChLowPt,fJetD0ChHighPt,fJetLcChLowPt,fJetLcChHighPt,fEMCALReadout,fJetFullHighPt,fJetFullLowPt,fJetNeutralHighPt,fJetNeutralLowPt,fGammaVeryHighPtEMCAL,fGammaVeryHighPtDCAL,fGammaHighPtEMCAL,fGammaHighPtDCAL,fGammaLowPtEMCAL,fGammaLowPtDCAL,fGammaVeryLowPtEMCAL,fGammaVeryLowPtDCAL"};
@@ -376,6 +378,10 @@ struct kstarInOO {
376378
double massKa = o2::constants::physics::MassKPlus;
377379
double massPi = o2::constants::physics::MassPiMinus;
378380

381+
static constexpr int KaonPDG = 321;
382+
static constexpr int PionPDG = 211;
383+
static constexpr int Kstar0PDG = 313;
384+
379385
//==================================
380386
//||
381387
//|| Helper Templates
@@ -395,19 +401,8 @@ struct kstarInOO {
395401
}
396402
}
397403
} // eventSelection histogram
398-
if (objecttype == 2) {
399-
if constexpr (requires { obj.posZ(); }) {
400-
if (!pass) {
401-
histos.fill(HIST("hPosZ_BC"), obj.posZ());
402-
histos.fill(HIST("hcentFT0C_BC"), obj.centFT0C());
403-
} else {
404-
histos.fill(HIST("hPosZ_AC"), obj.posZ());
405-
histos.fill(HIST("hcentFT0C_AC"), obj.centFT0C());
406-
}
407-
}
408-
} // Jet eventSelection histogram
409404
if constexpr (requires { obj.tpcCrossedRowsOverFindableCls(); }) {
410-
if (objecttype == 3) {
405+
if (objecttype == 2) {
411406
if (!pass) {
412407
histos.fill(HIST("hDCArToPv_BC"), obj.dcaXY());
413408
histos.fill(HIST("hDCAzToPv_BC"), obj.dcaZ());
@@ -435,7 +430,7 @@ struct kstarInOO {
435430
}
436431
}
437432
} // trackSelection
438-
if (objecttype == 4) {
433+
if (objecttype == 3) {
439434
if constexpr (requires { obj.pt(); }) {
440435
if (!pass) {
441436
histos.fill(HIST("QA_nSigma_kaon_TPC_BC"), obj.pt(), obj.tpcNSigmaKa());
@@ -448,7 +443,7 @@ struct kstarInOO {
448443
}
449444
}
450445
} // kaon pid Selection
451-
if (objecttype == 5) {
446+
if (objecttype == 4) {
452447
if constexpr (requires { obj.pt(); }) {
453448
if (!pass) {
454449
histos.fill(HIST("QA_nSigma_pion_TPC_BC"), obj.pt(), obj.tpcNSigmaPi());
@@ -594,10 +589,10 @@ struct kstarInOO {
594589
};
595590

596591
template <typename EventType>
597-
std::pair<bool, int> JeteventSelection(const EventType event, const bool QA)
592+
std::pair<bool, int> JetEventSelection(const EventType event, const bool QA)
598593
{
599594
if (cfgEventCutQA && QA) {
600-
fillQA(false, event, 2);
595+
fillQA(false, event, 1);
601596
}
602597

603598
if (!jetderiveddatautilities::selectCollision(event, eventSelectionBits)) { // sel8
@@ -607,7 +602,7 @@ struct kstarInOO {
607602
return {false, 2};
608603

609604
if (cfgEventCutQA && QA) {
610-
fillQA(true, event, 2);
605+
fillQA(true, event, 1);
611606
}
612607
return {true, 8};
613608
};
@@ -616,7 +611,7 @@ struct kstarInOO {
616611
bool trackSelection(const TracksType track, const bool QA)
617612
{
618613
if (cfgTrackCutQA && QA) {
619-
fillQA(false, track, 3);
614+
fillQA(false, track, 2);
620615
}
621616

622617
if (cfgTrackGlobalSel && !track.isGlobalTrack())
@@ -647,7 +642,7 @@ struct kstarInOO {
647642
return false;
648643

649644
if (cfgTrackCutQA && QA) {
650-
fillQA(true, track, 3);
645+
fillQA(true, track, 2);
651646
}
652647
return true;
653648
};
@@ -660,7 +655,7 @@ struct kstarInOO {
660655
bool tpcPIDPassed{false}, tofPIDPassed{false};
661656

662657
if (cfgTrackCutQA && QA) {
663-
fillQA(false, candidate, 4);
658+
fillQA(false, candidate, 3);
664659
}
665660

666661
// TPC
@@ -700,7 +695,7 @@ struct kstarInOO {
700695
// TPC & TOF
701696
if (tpcPIDPassed && tofPIDPassed) {
702697
if (cfgTrackCutQA && QA) {
703-
fillQA(true, candidate, 4);
698+
fillQA(true, candidate, 3);
704699
}
705700
return true;
706701
}
@@ -715,7 +710,7 @@ struct kstarInOO {
715710
bool tpcPIDPassed{false}, tofPIDPassed{false};
716711

717712
if (cfgTrackCutQA && QA) {
718-
fillQA(false, candidate, 5);
713+
fillQA(false, candidate, 4);
719714
}
720715

721716
// TPC
@@ -755,7 +750,7 @@ struct kstarInOO {
755750
// TPC & TOF
756751
if (tpcPIDPassed && tofPIDPassed) {
757752
if (cfgTrackCutQA && QA) {
758-
fillQA(true, candidate, 5);
753+
fillQA(true, candidate, 4);
759754
}
760755
return true;
761756
}
@@ -791,9 +786,6 @@ struct kstarInOO {
791786
template <typename TracksType>
792787
ROOT::Math::PxPyPzMVector TrueReconstruction(const TracksType& trk1, const TracksType& trk2)
793788
{
794-
constexpr int kaonPdg = 321;
795-
constexpr int pionPdg = 211;
796-
constexpr int kstar0Pdg = 313;
797789
double conjugate = trk1.sign() * trk2.sign();
798790
if (conjugate > 0)
799791
return {};
@@ -822,26 +814,26 @@ struct kstarInOO {
822814
mothers2PDG.push_back(particle2_mom.pdgCode());
823815
}
824816

825-
if (mothers1PDG[0] != kstar0Pdg)
817+
if (mothers1PDG[0] != Kstar0PDG)
826818
return {}; // mother not K*0
827-
if (mothers2PDG[0] != kstar0Pdg)
819+
if (mothers2PDG[0] != Kstar0PDG)
828820
return {}; // mothers not K*0
829821
if (mothers1[0] != mothers2[0])
830822
return {}; // Kaon and pion not from the same K*0
831823

832-
if (std::abs(particle1.pdgCode()) != pionPdg && std::abs(particle1.pdgCode()) != kaonPdg)
824+
if (std::abs(particle1.pdgCode()) != PionPDG && std::abs(particle1.pdgCode()) != KaonPDG)
833825
return {};
834-
if (std::abs(particle2.pdgCode()) != pionPdg && std::abs(particle2.pdgCode()) != kaonPdg)
826+
if (std::abs(particle2.pdgCode()) != PionPDG && std::abs(particle2.pdgCode()) != KaonPDG)
835827
return {};
836828

837829
double track1_mass, track2_mass;
838-
if (std::abs(particle1.pdgCode()) == pionPdg) {
830+
if (std::abs(particle1.pdgCode()) == PionPDG) {
839831
track1_mass = massPi;
840832
} else {
841833
track1_mass = massKa;
842834
}
843835

844-
if (std::abs(particle2.pdgCode()) == pionPdg) {
836+
if (std::abs(particle2.pdgCode()) == PionPDG) {
845837
track2_mass = massPi;
846838
} else {
847839
track2_mass = massKa;
@@ -1067,11 +1059,9 @@ struct kstarInOO {
10671059
return;
10681060
histos.fill(HIST("nEvents"), 1.5); // INEL>0 event
10691061

1070-
if (std::abs(collision.posZ()) > cfgEventVtxCut)
1071-
return;
1072-
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) {
1062+
auto [goodEv, code] = JetEventSelection(collision, true);
1063+
if (!goodEv)
10731064
return;
1074-
}
10751065
histos.fill(HIST("nEvents"), 2.5); // After selection
10761066

10771067
// Trigger before we start jet finding
@@ -1121,6 +1111,9 @@ struct kstarInOO {
11211111
bool HasJets = false;
11221112
int nJets = 0;
11231113
for (auto chargedjet : chargedjets) {
1114+
if (std::abs(chargedjet.eta()) > cfgJetMaxEta - cfgJetdR)
1115+
return;
1116+
11241117
jetpT.push_back(chargedjet.pt());
11251118
jetEta.push_back(chargedjet.eta());
11261119
jetPhi.push_back(chargedjet.phi());
@@ -1170,10 +1163,6 @@ struct kstarInOO {
11701163
int nJetMCEvents = 0;
11711164
void processMCJets(o2::aod::JetCollision const& collision, JetTrackCandidatesMC const& jetTracks, soa::Filtered<aod::ChargedMCDetectorLevelJets> const& mcdjets, TrackCandidatesMC const&, aod::McParticles const&, aod::JetParticles const&)
11721165
{
1173-
constexpr int kaonPdg = 321;
1174-
constexpr int pionPdg = 211;
1175-
constexpr int kstar0Pdg = 313;
1176-
11771166
if (cDebugLevel > 0) {
11781167
nJetMCEvents++;
11791168
if ((nJetMCEvents + 1) % 10000 == 0) {
@@ -1193,9 +1182,8 @@ struct kstarInOO {
11931182
return;
11941183
histos.fill(HIST("nEvents"), 1.5); // INEL>0 event
11951184

1196-
if (std::abs(collision.posZ()) > cfgEventVtxCut)
1197-
return;
1198-
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits))
1185+
auto [goodEv, code] = JetEventSelection(collision, true);
1186+
if (!goodEv)
11991187
return;
12001188
histos.fill(HIST("nEvents"), 2.5); // Inclusive event
12011189

@@ -1211,6 +1199,9 @@ struct kstarInOO {
12111199
bool HasJets = false;
12121200
int nJets = 0;
12131201
for (auto mcdjet : mcdjets) {
1202+
if (std::abs(mcdjet.eta()) > cfgJetMaxEta - cfgJetdR)
1203+
return;
1204+
12141205
mcdjetpT.push_back(mcdjet.pt());
12151206
mcdjetEta.push_back(mcdjet.eta());
12161207
mcdjetPhi.push_back(mcdjet.phi());
@@ -1322,21 +1313,21 @@ struct kstarInOO {
13221313
histos.fill(HIST("hEffRecTest5_pT"), lResonanceTest1.Pt());
13231314
}
13241315

1325-
if (std::abs(particle1.pdgCode()) != kaonPdg) // kaon
1316+
if (std::abs(particle1.pdgCode()) != KaonPDG) // kaon
13261317
continue;
13271318

13281319
if (cfgJetMCHistos) {
13291320
histos.fill(HIST("hEffRecTest6_pT"), lResonanceTest1.Pt());
13301321
}
13311322

1332-
if (std::abs(particle2.pdgCode()) != pionPdg) // pion
1323+
if (std::abs(particle2.pdgCode()) != PionPDG) // pion
13331324
continue;
13341325

13351326
if (cfgJetMCHistos) {
13361327
histos.fill(HIST("hEffRecTest7_pT"), lResonanceTest1.Pt());
13371328
}
13381329

1339-
if (std::abs(mothers1PDG[0]) != kstar0Pdg)
1330+
if (std::abs(mothers1PDG[0]) != Kstar0PDG)
13401331
continue; // mother not K*0
13411332
if (cfgJetMCHistos) {
13421333
histos.fill(HIST("hEffRecTest8_pT"), lResonanceTest1.Pt());
@@ -1346,7 +1337,7 @@ struct kstarInOO {
13461337
}
13471338
}
13481339

1349-
if (std::abs(mothers2PDG[0]) != kstar0Pdg)
1340+
if (std::abs(mothers2PDG[0]) != Kstar0PDG)
13501341
continue; // mothers not K*0
13511342

13521343
if (cfgJetMCHistos) {
@@ -1375,7 +1366,7 @@ struct kstarInOO {
13751366

13761367
bool INELgt0 = false;
13771368
for (const auto& track : tracks) {
1378-
if (std::abs(track.eta()) < cfgEventMaxEta) { // cfgTrackMaxEta --> cfgEventMaxEta
1369+
if (std::abs(track.eta()) < cfgEventMaxEta) {
13791370
INELgt0 = true;
13801371
break;
13811372
}
@@ -1652,7 +1643,7 @@ struct kstarInOO {
16521643
return;
16531644

16541645
for (auto& particle : mcParticles) {
1655-
if (std::abs(particle.pdgCode()) != 313)
1646+
if (std::abs(particle.pdgCode()) != Kstar0PDG)
16561647
continue;
16571648
if (std::abs(particle.eta()) > cfgTrackMaxEta)
16581649
continue;
@@ -1771,19 +1762,17 @@ struct kstarInOO {
17711762
bool skip = false;
17721763
int daughter_kaon = 0;
17731764
int daughter_pion = 0;
1774-
constexpr int kaonPdg = 321;
1775-
constexpr int pionPdg = 211;
17761765

17771766
if (!cfgIsKstar) {
17781767
for (auto& daughter : mcParticle.daughters_as<aod::JetParticles>()) {
1779-
if (std::abs(daughter.pdgCode()) != kaonPdg)
1768+
if (std::abs(daughter.pdgCode()) != KaonPDG)
17801769
skip = true;
17811770
}
17821771
} else {
17831772
for (auto& daughter : mcParticle.daughters_as<aod::JetParticles>()) {
1784-
if (std::abs(daughter.pdgCode()) == kaonPdg)
1773+
if (std::abs(daughter.pdgCode()) == KaonPDG)
17851774
++daughter_kaon;
1786-
else if (std::abs(daughter.pdgCode()) == pionPdg)
1775+
else if (std::abs(daughter.pdgCode()) == PionPDG)
17871776
++daughter_pion;
17881777
}
17891778
if (daughter_kaon != 1 || daughter_pion != 1)
@@ -1835,7 +1824,7 @@ struct kstarInOO {
18351824
bool pion_out = false;
18361825
for (auto& daughter : mcParticle.daughters_as<aod::JetParticles>()) {
18371826
if (cfgIsKstar) {
1838-
if (std::abs(daughter.pdgCode()) == kaonPdg) {
1827+
if (std::abs(daughter.pdgCode()) == KaonPDG) {
18391828

18401829
double dphi_kaon = TVector2::Phi_mpi_pi(bestJetPhi - daughter.phi());
18411830
double deta_kaon = bestJetEta - daughter.eta();
@@ -1852,7 +1841,7 @@ struct kstarInOO {
18521841
}
18531842
} // INSIDE Jets
18541843
} // kaon daughter
1855-
if (std::abs(daughter.pdgCode()) == pionPdg) {
1844+
if (std::abs(daughter.pdgCode()) == PionPDG) {
18561845

18571846
double dphi_pion = TVector2::Phi_mpi_pi(bestJetPhi - daughter.phi());
18581847
double deta_pion = bestJetEta - daughter.eta();
@@ -1873,7 +1862,7 @@ struct kstarInOO {
18731862
} // INSIDE Jets
18741863
} // pion daughter
18751864
} else {
1876-
if (std::abs(daughter.pdgCode()) == kaonPdg) {
1865+
if (std::abs(daughter.pdgCode()) == KaonPDG) {
18771866
double dphi_kaon = TVector2::Phi_mpi_pi(bestJetPhi - daughter.phi());
18781867
double deta_kaon = bestJetEta - daughter.eta();
18791868
dR_kaon = TMath::Sqrt((dphi_kaon * dphi_kaon) + (deta_kaon * deta_kaon));

0 commit comments

Comments
 (0)