Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 39 additions & 30 deletions PWGLF/Tasks/Resonances/higherMassResonances.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <TH1F.h>
#include <TH2F.h>
#include <THn.h>
#include <TLorentzVector.h>

Check failure on line 45 in PWGLF/Tasks/Resonances/higherMassResonances.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TMath.h>
#include <TObjArray.h>
#include <TPDGCode.h>
Expand Down Expand Up @@ -178,12 +178,13 @@
// variables declaration
float multiplicity = 0.0f;
float theta2;
ROOT::Math::PxPyPzMVector daughter1, daughter2, daughterRot, daughterRotCM, mother, mother1, motherRot, fourVecDauCM, fourVecDauCM1;
ROOT::Math::PxPyPzMVector daughter1, daughter2, daughterRot, daughterRotCM, mother, motherRot, fourVecDauCM, fourVecDauCM1;
ROOT::Math::PxPyPzEVector mother1;
ROOT::Math::XYZVector randomVec, beamVec, normalVec;
ROOT::Math::XYZVectorF v1_CM, zaxis_HE, yaxis_HE, xaxis_HE;
// ROOT::Math::XYZVector threeVecDauCM, helicityVec, randomVec, beamVec, normalVec;
ROOT::Math::XYZVector zBeam; // ẑ: beam direction in lab frame
double BeamMomentum = TMath::Sqrt(13600 * 13600 / 4 - 0.938 * 0.938); // GeV

Check failure on line 187 in PWGLF/Tasks/Resonances/higherMassResonances.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.

Check failure on line 187 in PWGLF/Tasks/Resonances/higherMassResonances.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
ROOT::Math::PxPyPzEVector Beam1{0., 0., -BeamMomentum, 13600. / 2.};
ROOT::Math::PxPyPzEVector Beam2{0., 0., BeamMomentum, 13600. / 2.};
ROOT::Math::XYZVectorF Beam1_CM, Beam2_CM;
Expand Down Expand Up @@ -313,13 +314,15 @@
hMChists.add("events_check", "No. of events in the generated MC", kTH1I, {{20, 0, 20}});
hMChists.add("events_checkrec", "No. of events in the reconstructed MC", kTH1I, {{25, 0, 25}});
hMChists.add("Genf1710", "Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL});
hMChists.add("Genf17102", "Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL});
hMChists.add("Recf1710_pt1", "Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL});
hMChists.add("Recf1710_pt2", "Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL});
// hMChists.add("Recf1710_p", "Rec f_{0}(1710) p", kTH1F, {ptAxis});
hMChists.add("h1Recsplit", "Rec p_{T}2", kTH1F, {ptAxis});
// hMChists.add("Recf1710_mass", "Rec f_{0}(1710) mass", kTH1F, {glueballMassAxis});
hMChists.add("Genf1710_mass", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis});
hMChists.add("Genf1710_pt2", "Gen f_{0}(1710) p_{T}", kTH1F, {ptAxis});
hMChists.add("Genf1710_mass2", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis});
// hMChists.add("Genf1710_pt2", "Gen f_{0}(1710) p_{T}", kTH1F, {ptAxis});
hMChists.add("GenPhi", "Gen Phi", kTH1F, {{70, 0.0, 7.0f}});
hMChists.add("GenPhi2", "Gen Phi", kTH1F, {{70, 0.0, 7.0f}});
hMChists.add("GenEta", "Gen Eta", kTHnSparseF, {{150, -1.5f, 1.5f}});
Expand Down Expand Up @@ -385,7 +388,7 @@
const float cpav0 = candidate.v0cosPA();

float ctauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short;
float lowmasscutks0 = 0.497 - config.cWidthKs0 * config.cSigmaMassKs0;

Check failure on line 391 in PWGLF/Tasks/Resonances/higherMassResonances.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
float highmasscutks0 = 0.497 + config.cWidthKs0 * config.cSigmaMassKs0;
// float decayLength = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * RecoDecay::sqrtSumOfSquares(candidate.px(), candidate.py(), candidate.pz());

Expand Down Expand Up @@ -643,9 +646,9 @@

// CosThetaHE = zaxis_HE.Dot(v_CM);

auto angle_phi = TMath::ATan2(yaxis_HE.Dot(v1_CM), xaxis_HE.Dot(v1_CM));

Check failure on line 649 in PWGLF/Tasks/Resonances/higherMassResonances.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (angle_phi < 0) {
angle_phi += 2 * TMath::Pi(); // ensure phi is in [0, 2pi]

Check failure on line 651 in PWGLF/Tasks/Resonances/higherMassResonances.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pi-multiple-fraction]

Use multiples/fractions of PI defined in o2::constants::math.

Check failure on line 651 in PWGLF/Tasks/Resonances/higherMassResonances.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.

Check failure on line 651 in PWGLF/Tasks/Resonances/higherMassResonances.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
}

if (std::abs(mother.Rapidity()) < 0.5) {
Expand Down Expand Up @@ -992,7 +995,8 @@
int counter = 0;
float multiplicityGen = 0.0;
std::vector<bool> passKs;
ROOT::Math::PxPyPzMVector lResonance_gen, lResonance_gen2;
ROOT::Math::PxPyPzMVector lResonance_gen1;
ROOT::Math::PxPyPzEVector lResonance_gen;

void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& collisions)
{
Expand Down Expand Up @@ -1072,7 +1076,7 @@
continue;
}
hMChists.fill(HIST("events_check"), 8.5);
if (std::abs(kCurrentDaughter.pdgCode()) == 310) {

Check failure on line 1079 in PWGLF/Tasks/Resonances/higherMassResonances.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
passKs.push_back(true);
hMChists.fill(HIST("events_check"), 9.5);
if (passKs.size() == 1) {
Expand All @@ -1084,26 +1088,32 @@
}
if (passKs.size() == 2) {
lResonance_gen = ROOT::Math::PxPyPzEVector(mcParticle.pt(), mcParticle.eta(), mcParticle.phi(), mcParticle.e());
lResonance_gen2 = daughter1 + daughter2;
lResonance_gen1 = daughter1 + daughter2;

if (config.applyPairRapidityGen && std::abs(lResonance_gen2.Y()) >= 0.5) {
ROOT::Math::Boost boost{lResonance_gen.BoostToCM()};
ROOT::Math::Boost boost1{lResonance_gen1.BoostToCM()};

fourVecDauCM = boost(daughter1);
fourVecDauCM1 = boost1(daughter1);

auto helicity_gen = lResonance_gen.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(lResonance_gen.Vect().Mag2()));
auto helicity_gen1 = lResonance_gen1.Vect().Dot(fourVecDauCM1.Vect()) / (std::sqrt(fourVecDauCM1.Vect().Mag2()) * std::sqrt(lResonance_gen1.Vect().Mag2()));

hMChists.fill(HIST("Genf1710"), multiplicityGen, lResonance_gen.pt(), helicity_gen);
hMChists.fill(HIST("Genf1710_mass"), lResonance_gen.M());
hMChists.fill(HIST("GenRapidity"), mcParticle.y());
hMChists.fill(HIST("GenEta"), mcParticle.eta());
hMChists.fill(HIST("GenPhi"), mcParticle.phi());

if (config.applyPairRapidityGen && std::abs(lResonance_gen1.Y()) >= 0.5) {
continue;
}

ROOT::Math::Boost boost{lResonance_gen.BoostToCM()};
fourVecDauCM = boost(daughter1); // boost the frame of daughter to the center of mass frame

auto helicity_gen = lResonance_gen2.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(lResonance_gen2.Vect().Mag2()));

hMChists.fill(HIST("Genf1710"), multiplicityGen, lResonance_gen2.pt(), helicity_gen);
hMChists.fill(HIST("Genf1710_mass"), lResonance_gen2.M());
hMChists.fill(HIST("Genf1710_pt2"), mcParticle.pt());
hMChists.fill(HIST("GenRapidity"), lResonance_gen2.Y());
hMChists.fill(HIST("GenRapidity2"), mcParticle.y());
hMChists.fill(HIST("GenEta"), lResonance_gen2.Eta());
hMChists.fill(HIST("GenEta2"), mcParticle.eta());
hMChists.fill(HIST("GenPhi"), lResonance_gen2.Phi());
hMChists.fill(HIST("GenPhi2"), mcParticle.phi());
hMChists.fill(HIST("Genf17102"), multiplicityGen, lResonance_gen1.pt(), helicity_gen1);
hMChists.fill(HIST("Genf1710_mass2"), lResonance_gen1.M());
hMChists.fill(HIST("GenRapidity2"), lResonance_gen1.Y());
hMChists.fill(HIST("GenEta2"), lResonance_gen1.Eta());
hMChists.fill(HIST("GenPhi2"), lResonance_gen1.Phi());
}
passKs.clear(); // clear the vector for the next iteration
}
Expand All @@ -1118,7 +1128,7 @@
return;
}

auto multiplicity = collision.centFT0C();
auto multiplicity = collision.centFT0M();
hMChists.fill(HIST("Rec_Multiplicity"), multiplicity);

hMChists.fill(HIST("events_checkrec"), 0.5);
Expand Down Expand Up @@ -1203,7 +1213,7 @@
int trackv0PDG1 = std::abs(mctrackv01.pdgCode());
int trackv0PDG2 = std::abs(mctrackv02.pdgCode());

if (std::abs(trackv0PDG1) != 310 || std::abs(trackv0PDG2) != 310) {

Check failure on line 1216 in PWGLF/Tasks/Resonances/higherMassResonances.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
continue;
}
hMChists.fill(HIST("events_checkrec"), 12.5);
Expand Down Expand Up @@ -1277,20 +1287,19 @@

auto helicity_rec2 = mother1.Vect().Dot(fourVecDauCM1.Vect()) / (std::sqrt(fourVecDauCM1.Vect().Mag2()) * std::sqrt(mother1.Vect().Mag2()));

hMChists.fill(HIST("Recf1710_pt1"), multiplicity, mothertrack1.pt(), mother1.M(), helicity_rec2);
hMChists.fill(HIST("RecRapidity"), mothertrack1.y());
hMChists.fill(HIST("RecPhi"), mothertrack1.phi());
hMChists.fill(HIST("RecEta"), mothertrack1.eta());

if (config.applyPairRapidityRec && std::abs(mother.Y()) >= 0.5) {
continue;
}

// std::cout << "mother pT is " << mother.Pt() << std::endl;

hMChists.fill(HIST("Recf1710_pt1"), multiplicity, mother.Pt(), mother.M(), helicity_rec);
hMChists.fill(HIST("Recf1710_pt2"), multiplicity, mother1.Pt(), mother1.M(), helicity_rec2);
hMChists.fill(HIST("RecRapidity"), mother.Y());
hMChists.fill(HIST("RecRapidity2"), mothertrack1.y());
hMChists.fill(HIST("RecPhi"), mother.Phi());
hMChists.fill(HIST("RecPhi2"), mothertrack1.phi());
hMChists.fill(HIST("RecEta"), mother.Eta());
hMChists.fill(HIST("RecEta2"), mothertrack1.eta());
hMChists.fill(HIST("Recf1710_pt2"), multiplicity, mother.Pt(), mother.M(), helicity_rec);
hMChists.fill(HIST("RecRapidity2"), mother.Y());
hMChists.fill(HIST("RecPhi2"), mother.Phi());
hMChists.fill(HIST("RecEta2"), mother.Eta());
}
gindex2.clear();
}
Expand Down
Loading
Loading