Skip to content

Commit bc1d916

Browse files
author
jimun_lee
committed
[PWGLF] Added the option of cfgJetdR
1 parent 1034dba commit bc1d916

1 file changed

Lines changed: 29 additions & 16 deletions

File tree

PWGLF/Tasks/Resonances/kstarInOO.cxx

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,9 @@ struct kstarInOO {
791791
template <typename TracksType>
792792
ROOT::Math::PxPyPzMVector TrueReconstruction(const TracksType& trk1, const TracksType& trk2)
793793
{
794+
constexpr int kaonPdg = 321;
795+
constexpr int pionPdg = 211;
796+
constexpr int kstar0Pdg = 313;
794797
double conjugate = trk1.sign() * trk2.sign();
795798
if (conjugate > 0)
796799
return {};
@@ -819,26 +822,26 @@ struct kstarInOO {
819822
mothers2PDG.push_back(particle2_mom.pdgCode());
820823
}
821824

822-
if (mothers1PDG[0] != 313)
825+
if (mothers1PDG[0] != kstar0Pdg)
823826
return {}; // mother not K*0
824-
if (mothers2PDG[0] != 313)
827+
if (mothers2PDG[0] != kstar0Pdg)
825828
return {}; // mothers not K*0
826829
if (mothers1[0] != mothers2[0])
827830
return {}; // Kaon and pion not from the same K*0
828831

829-
if (std::abs(particle1.pdgCode()) != 211 && std::abs(particle1.pdgCode()) != 321)
832+
if (std::abs(particle1.pdgCode()) != pionPdg && std::abs(particle1.pdgCode()) != kaonPdg)
830833
return {};
831-
if (std::abs(particle2.pdgCode()) != 211 && std::abs(particle2.pdgCode()) != 321)
834+
if (std::abs(particle2.pdgCode()) != pionPdg && std::abs(particle2.pdgCode()) != kaonPdg)
832835
return {};
833836

834837
double track1_mass, track2_mass;
835-
if (std::abs(particle1.pdgCode()) == 211) {
838+
if (std::abs(particle1.pdgCode()) == pionPdg) {
836839
track1_mass = massPi;
837840
} else {
838841
track1_mass = massKa;
839842
}
840843

841-
if (std::abs(particle2.pdgCode()) == 211) {
844+
if (std::abs(particle2.pdgCode()) == pionPdg) {
842845
track2_mass = massPi;
843846
} else {
844847
track2_mass = massKa;
@@ -1118,6 +1121,9 @@ struct kstarInOO {
11181121
bool HasJets = false;
11191122
int nJets = 0;
11201123
for (auto chargedjet : chargedjets) {
1124+
// if(std::abs(chargedjet.eta()) > cfgJetEta)
1125+
// return;
1126+
11211127
jetpT.push_back(chargedjet.pt());
11221128
jetEta.push_back(chargedjet.eta());
11231129
jetPhi.push_back(chargedjet.phi());
@@ -1167,6 +1173,10 @@ struct kstarInOO {
11671173
int nJetMCEvents = 0;
11681174
void processMCJets(o2::aod::JetCollision const& collision, JetTrackCandidatesMC const& jetTracks, soa::Filtered<aod::ChargedMCDetectorLevelJets> const& mcdjets, TrackCandidatesMC const&, aod::McParticles const&, aod::JetParticles const&)
11691175
{
1176+
constexpr int kaonPdg = 321;
1177+
constexpr int pionPdg = 211;
1178+
constexpr int kstar0Pdg = 313;
1179+
11701180
if (cDebugLevel > 0) {
11711181
nJetMCEvents++;
11721182
if ((nJetMCEvents + 1) % 10000 == 0) {
@@ -1315,21 +1325,21 @@ struct kstarInOO {
13151325
histos.fill(HIST("hEffRecTest5_pT"), lResonanceTest1.Pt());
13161326
}
13171327

1318-
if (std::abs(particle1.pdgCode()) != 321) // kaon
1328+
if (std::abs(particle1.pdgCode()) != kaonPdg) // kaon
13191329
continue;
13201330

13211331
if (cfgJetMCHistos) {
13221332
histos.fill(HIST("hEffRecTest6_pT"), lResonanceTest1.Pt());
13231333
}
13241334

1325-
if (std::abs(particle2.pdgCode()) != 211) // pion
1335+
if (std::abs(particle2.pdgCode()) != pionPdg) // pion
13261336
continue;
13271337

13281338
if (cfgJetMCHistos) {
13291339
histos.fill(HIST("hEffRecTest7_pT"), lResonanceTest1.Pt());
13301340
}
13311341

1332-
if (std::abs(mothers1PDG[0]) != 313)
1342+
if (std::abs(mothers1PDG[0]) != kstar0Pdg)
13331343
continue; // mother not K*0
13341344
if (cfgJetMCHistos) {
13351345
histos.fill(HIST("hEffRecTest8_pT"), lResonanceTest1.Pt());
@@ -1339,7 +1349,7 @@ struct kstarInOO {
13391349
}
13401350
}
13411351

1342-
if (std::abs(mothers2PDG[0]) != 313)
1352+
if (std::abs(mothers2PDG[0]) != kstar0Pdg)
13431353
continue; // mothers not K*0
13441354

13451355
if (cfgJetMCHistos) {
@@ -1764,16 +1774,19 @@ struct kstarInOO {
17641774
bool skip = false;
17651775
int daughter_kaon = 0;
17661776
int daughter_pion = 0;
1777+
constexpr int kaonPdg = 321;
1778+
constexpr int pionPdg = 211;
1779+
17671780
if (!cfgIsKstar) {
17681781
for (auto& daughter : mcParticle.daughters_as<aod::JetParticles>()) {
1769-
if (std::abs(daughter.pdgCode()) != 321)
1782+
if (std::abs(daughter.pdgCode()) != kaonPdg)
17701783
skip = true;
17711784
}
17721785
} else {
17731786
for (auto& daughter : mcParticle.daughters_as<aod::JetParticles>()) {
1774-
if (std::abs(daughter.pdgCode()) == 321)
1787+
if (std::abs(daughter.pdgCode()) == kaonPdg)
17751788
++daughter_kaon;
1776-
else if (std::abs(daughter.pdgCode()) == 211)
1789+
else if (std::abs(daughter.pdgCode()) == pionPdg)
17771790
++daughter_pion;
17781791
}
17791792
if (daughter_kaon != 1 || daughter_pion != 1)
@@ -1825,7 +1838,7 @@ struct kstarInOO {
18251838
bool pion_out = false;
18261839
for (auto& daughter : mcParticle.daughters_as<aod::JetParticles>()) {
18271840
if (cfgIsKstar) {
1828-
if (std::abs(daughter.pdgCode()) == 321) {
1841+
if (std::abs(daughter.pdgCode()) == kaonPdg) {
18291842

18301843
double dphi_kaon = TVector2::Phi_mpi_pi(bestJetPhi - daughter.phi());
18311844
double deta_kaon = bestJetEta - daughter.eta();
@@ -1842,7 +1855,7 @@ struct kstarInOO {
18421855
}
18431856
} // INSIDE Jets
18441857
} // kaon daughter
1845-
if (std::abs(daughter.pdgCode()) == 211) {
1858+
if (std::abs(daughter.pdgCode()) == pionPdg) {
18461859

18471860
double dphi_pion = TVector2::Phi_mpi_pi(bestJetPhi - daughter.phi());
18481861
double deta_pion = bestJetEta - daughter.eta();
@@ -1863,7 +1876,7 @@ struct kstarInOO {
18631876
} // INSIDE Jets
18641877
} // pion daughter
18651878
} else {
1866-
if (std::abs(daughter.pdgCode()) == 321) {
1879+
if (std::abs(daughter.pdgCode()) == kaonPdg) {
18671880
double dphi_kaon = TVector2::Phi_mpi_pi(bestJetPhi - daughter.phi());
18681881
double deta_kaon = bestJetEta - daughter.eta();
18691882
dR_kaon = TMath::Sqrt((dphi_kaon * dphi_kaon) + (deta_kaon * deta_kaon));

0 commit comments

Comments
 (0)