Skip to content

Commit 4c71a65

Browse files
author
Sawan Sawan
committed
Helicity angle in MC
1 parent 0882ed5 commit 4c71a65

File tree

1 file changed

+33
-25
lines changed

1 file changed

+33
-25
lines changed

PWGLF/Tasks/Resonances/higherMassResonances.cxx

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -310,20 +310,22 @@ struct HigherMassResonances {
310310
if (config.isMC) {
311311
hMChists.add("events_check", "No. of events in the generated MC", kTH1I, {{20, 0, 20}});
312312
hMChists.add("events_checkrec", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}});
313-
hMChists.add("Genf1710", "Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL});
313+
hMChists.add("Genf1710", "Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL});
314314
hMChists.add("Recf1710_pt1", "Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL});
315315
hMChists.add("Recf1710_pt2", "Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL});
316316
// hMChists.add("Recf1710_p", "Rec f_{0}(1710) p", kTH1F, {ptAxis});
317317
hMChists.add("h1Recsplit", "Rec p_{T}2", kTH1F, {ptAxis});
318318
// hMChists.add("Recf1710_mass", "Rec f_{0}(1710) mass", kTH1F, {glueballMassAxis});
319-
// hMChists.add("Genf1710_mass", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis});
319+
hMChists.add("Genf1710_mass", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis});
320+
hMChists.add("Genf1710_mass2", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis});
321+
hMChists.add("Genf1710_pt2", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis});
320322
hMChists.add("GenEta", "Gen Eta", kTHnSparseF, {ptAxis, {100, -1.0f, 1.0f}});
321323
hMChists.add("GenPhi", "Gen Phi", kTH1F, {{70, -3.5f, 3.5f}});
322324
hMChists.add("GenRapidity", "Gen Rapidity", kTHnSparseF, {ptAxis, {100, -1.0f, 1.0f}});
323325
hMChists.add("RecEta", "Rec Eta", kTH1F, {{100, -1.0f, 1.0f}});
324326
hMChists.add("RecPhi", "Rec Phi", kTH1F, {{70, 0.0f, 7.0f}});
325327
hMChists.add("RecRapidity", "Rec Rapidity", kTH1F, {{100, -1.0f, 1.0f}});
326-
hMChists.add("MC_mult", "Multiplicity in MC", kTH1F, {multiplicityAxis});
328+
hMChists.add("Rec_Multiplicity", "Multiplicity in MC", kTH1F, {multiplicityAxis});
327329
hMChists.add("MC_mult_after_event_sel", "Multiplicity in MC", kTH1F, {multiplicityAxis});
328330
// hMChists.add("GenPx", "Gen Px", kTH1F, {{100, -10.0f, 10.0f}});
329331
// hMChists.add("GenPy", "Gen Py", kTH1F, {{100, -10.0f, 10.0f}});
@@ -982,12 +984,14 @@ struct HigherMassResonances {
982984

983985
int counter = 0;
984986
float multiplicityGen = 0.0;
987+
std::vector<bool> passKs;
988+
ROOT::Math::PxPyPzMVector lResonance_gen, lResonance_gen2;
989+
985990
void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& collisions)
986991
{
987992
if (config.isMC == false) {
988993
return;
989994
}
990-
ROOT::Math::PxPyPzMVector lResonance_gen;
991995
hMChists.fill(HIST("events_check"), 0.5);
992996
if (std::abs(mcCollision.posZ()) < config.cutzvertex) {
993997
hMChists.fill(HIST("events_check"), 1.5);
@@ -1039,6 +1043,11 @@ struct HigherMassResonances {
10391043
}
10401044
hMChists.fill(HIST("events_check"), 5.5);
10411045

1046+
if (config.apply_rapidityMC && std::abs(mcParticle.y()) >= 0.5) {
1047+
continue;
1048+
}
1049+
hMChists.fill(HIST("events_check"), 6.5);
1050+
10421051
// if (counter < 1e3)
10431052
// std::cout << "px " << mcParticle.px() << " py " << mcParticle.py() << " pz " << mcParticle.pz() << " y " << mcParticle.y() << std::endl;
10441053
// counter++;
@@ -1050,43 +1059,44 @@ struct HigherMassResonances {
10501059
// hMChists.fill(HIST("GenPy"), mcParticle.py());
10511060
// hMChists.fill(HIST("GenPz"), mcParticle.pz());
10521061

1053-
if (config.apply_rapidityMC && std::abs(mcParticle.y()) >= 0.5) {
1054-
continue;
1055-
}
1056-
hMChists.fill(HIST("events_check"), 6.5);
1057-
10581062
auto kDaughters = mcParticle.daughters_as<aod::McParticles>();
10591063
if (kDaughters.size() != 2) {
10601064
continue;
10611065
}
10621066
hMChists.fill(HIST("events_check"), 7.5);
10631067

1064-
auto passKs = false;
10651068
for (const auto& kCurrentDaughter : kDaughters) {
10661069
// int daupdg = std::abs(kCurrentDaughter.pdgCode());
10671070

10681071
if (!kCurrentDaughter.isPhysicalPrimary()) {
10691072
continue;
10701073
}
10711074
hMChists.fill(HIST("events_check"), 8.5);
1072-
10731075
if (std::abs(kCurrentDaughter.pdgCode()) == 310) {
1074-
passKs = true;
1076+
passKs.push_back(true);
10751077
hMChists.fill(HIST("events_check"), 9.5);
1076-
daughter1 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassK0Short);
1078+
if (passKs.size() == 1) {
1079+
daughter1 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassK0Short);
1080+
} else if (passKs.size() == 2) {
1081+
daughter2 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassK0Short);
1082+
}
10771083
}
10781084
}
1079-
if (passKs) {
1085+
if (passKs.size() == 2) {
10801086
lResonance_gen = ROOT::Math::PxPyPzMVector(mcParticle.pt(), mcParticle.eta(), mcParticle.phi(), mcParticle.e());
1081-
mother = ROOT::Math::PxPyPzMVector(lResonance_gen.Px(), lResonance_gen.Py(), lResonance_gen.Pz(), lResonance_gen.M());
1082-
ROOT::Math::Boost boost{mother.BoostToCM()};
1087+
lResonance_gen2 = daughter1 + daughter2; // invariant mass of Kshort pair
1088+
1089+
ROOT::Math::Boost boost{lResonance_gen.BoostToCM()};
10831090
fourVecDauCM = boost(daughter1); // boost the frame of daughter to the center of mass frame
10841091

1085-
auto helicity_gen = daughter1.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(daughter1.Vect().Mag2()));
1092+
auto helicity_gen = lResonance_gen.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(lResonance_gen.Vect().Mag2()));
10861093

1087-
hMChists.fill(HIST("Genf1710"), multiplicityGen, mcParticle.pt(), lResonance_gen.M(), helicity_gen);
1088-
// hMChists.fill(HIST("Genf1710_mass"), lResonance_gen.M());
1094+
hMChists.fill(HIST("Genf1710"), multiplicityGen, mcParticle.pt(), helicity_gen);
1095+
hMChists.fill(HIST("Genf1710_mass"), lResonance_gen.M());
1096+
hMChists.fill(HIST("Genf1710_mass2"), lResonance_gen2.M());
1097+
hMChists.fill(HIST("Genf1710_pt2"), lResonance_gen2.Pt());
10891098
}
1099+
passKs.clear(); // clear the vector for the next iteration
10901100
}
10911101
}
10921102
PROCESS_SWITCH(HigherMassResonances, processGen, "Process Generated", false);
@@ -1102,7 +1112,7 @@ struct HigherMassResonances {
11021112

11031113
ROOT::Math::PxPyPzMVector lDecayDaughter1, lDecayDaughter2, lResonance;
11041114
auto multiplicity = collision.centFT0C();
1105-
hMChists.fill(HIST("MC_mult"), multiplicity);
1115+
hMChists.fill(HIST("Rec_Multiplicity"), multiplicity);
11061116

11071117
hMChists.fill(HIST("events_checkrec"), 0.5);
11081118
if (!collision.has_mcCollision()) {
@@ -1270,11 +1280,9 @@ struct HigherMassResonances {
12701280
continue;
12711281
}
12721282
// daughter1, mother, fourVecDauCM
1273-
mother = ROOT::Math::PxPyPzMVector(lResonance.Px(), lResonance.Py(), lResonance.Pz(), lResonance.M());
1274-
daughter1 = ROOT::Math::PxPyPzMVector(lDecayDaughter1.Px(), lDecayDaughter1.Py(), lDecayDaughter1.Pz(), o2::constants::physics::MassK0Short);
1275-
ROOT::Math::Boost boost{mother.BoostToCM()};
1276-
fourVecDauCM = boost(daughter1); // boost the frame of daughter to the center of mass frame
1277-
auto helicity_rec = daughter1.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(daughter1.Vect().Mag2()));
1283+
ROOT::Math::Boost boost{lResonance.BoostToCM()};
1284+
fourVecDauCM = boost(lDecayDaughter1); // boost the frame of daughter to the center of mass frame
1285+
auto helicity_rec = lResonance.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(lResonance.Vect().Mag2()));
12781286

12791287
// hMChists.fill(HIST("Recf1710_p"), motherP);
12801288
// hMChists.fill(HIST("Recf1710_mass"), recMass);

0 commit comments

Comments
 (0)