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
2 changes: 1 addition & 1 deletion PWGUD/TableProducer/tauEventTableProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@
{

// FTOA
if ((std::abs(coll.timeFT0A()) > maxFITtime) && coll.timeFT0A() > -998.)

Check failure on line 147 in PWGUD/TableProducer/tauEventTableProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;

// FTOC
if ((std::abs(coll.timeFT0C()) > maxFITtime) && coll.timeFT0C() > -998.)

Check failure on line 151 in PWGUD/TableProducer/tauEventTableProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;

return true;
Expand Down Expand Up @@ -301,7 +301,7 @@
return false; // TPC chi2
if (cutGlobalTrack.cutGoodITSTPCmatching) {
if (track.itsChi2NCl() < 0.)
return false; // TPC chi2
return false; // good ITS-TPC matching means ITS ch2 is not negative
}
// TOF
if (track.hasTOF()) {
Expand Down Expand Up @@ -384,7 +384,7 @@
// Apply weak condition on track PID
int countPVGTel = 0;
int countPVGTmupi = 0;
if (countGoodPVtracks == 2) {

Check failure on line 387 in PWGUD/TableProducer/tauEventTableProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (const auto& vecMember : vecTrkIdx) {
const auto& thisTrk = tracks.iteratorAt(vecMember);
if (isElectronCandidate(thisTrk)) {
Expand All @@ -397,7 +397,7 @@
}
}

if (cutPreselect.preselUseTrackPID ? ((countPVGTel == 2 && countPVGTmupi == 0) || (countPVGTel == 1 && countPVGTmupi == 1)) : countGoodPVtracks == cutPreselect.preselNgoodPVtracs) {

Check failure on line 400 in PWGUD/TableProducer/tauEventTableProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
const auto& trk1 = tracks.iteratorAt(vecTrkIdx[0]);
const auto& trk2 = tracks.iteratorAt(vecTrkIdx[1]);

Expand Down Expand Up @@ -569,7 +569,7 @@
continue;
countMothers++;
// check the generated collision does not have more than 2 tauons
if (countMothers > 2) {

Check failure on line 572 in PWGUD/TableProducer/tauEventTableProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (verboseInfo)
printLargeMessage("Truth collision has more than 2 no mother particles. Breaking the particle loop.");
histos.get<TH1>(HIST("Truth/hTroubles"))->Fill(2);
Expand Down Expand Up @@ -653,7 +653,7 @@
continue;
countMothers++;
// check the generated collision does not have more than 2 tauons
if (countMothers > 2) {

Check failure on line 656 in PWGUD/TableProducer/tauEventTableProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (verboseInfo)
printLargeMessage("Truth collision has more than 2 no mother particles. Breaking the particle loop.");
histos.get<TH1>(HIST("Truth/hTroubles"))->Fill(12);
Expand Down
2 changes: 1 addition & 1 deletion PWGUD/TableProducer/twoTracksEventTableProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@
{

// FTOA
if ((std::abs(coll.timeFT0A()) > maxFITtime) && coll.timeFT0A() > -998.)

Check failure on line 151 in PWGUD/TableProducer/twoTracksEventTableProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
histos.get<TH1>(HIST("Reco/hSelections"))->Fill(nSelection);
nSelection++;

// FTOC
if ((std::abs(coll.timeFT0C()) > maxFITtime) && coll.timeFT0C() > -998.)

Check failure on line 157 in PWGUD/TableProducer/twoTracksEventTableProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
histos.get<TH1>(HIST("Reco/hSelections"))->Fill(nSelection);
nSelection++;
Expand Down Expand Up @@ -327,7 +327,7 @@
return false; // TPC chi2
if (cutGlobalTrack.cutGoodITSTPCmatching) {
if (track.itsChi2NCl() < 0.)
return false; // TPC chi2
return false; // good ITS-TPC matching means ITS ch2 is not negative
}
// TOF
if (track.hasTOF()) {
Expand Down Expand Up @@ -412,7 +412,7 @@
} // Loop over tracks with selections

// Critical selection, without it the rest of the process function will fail
if (countGoodPVtracks != 2)

Check failure on line 415 in PWGUD/TableProducer/twoTracksEventTableProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return;
histos.get<TH1>(HIST("Reco/hSelections"))->Fill(nSelection);
nSelection++;
Expand Down Expand Up @@ -626,7 +626,7 @@
continue;
countMothers++;
// check the generated collision does not have more than 2 mothers
if (countMothers > 2) {

Check failure on line 629 in PWGUD/TableProducer/twoTracksEventTableProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (verboseInfo)
printLargeMessage("Truth collision has more than 2 no mother particles. Breaking the particle loop.");
histos.get<TH1>(HIST("Truth/hTroubles"))->Fill(2);
Expand Down
29 changes: 17 additions & 12 deletions PWGUD/Tasks/testMcStdTabsRl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ struct TestMcStdTabsRl {

HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};

// declare configurables
Configurable<bool> useMcgenidGetGeneratorID{"useMcgenidGetGeneratorID", true, {"Use o2::mcgenid::getGeneratorId instead of o2::mccollision::getGeneratorId; default it true."}};

struct : ConfigurableGroup {
ConfigurableAxis zzAxisNtracks{"zzAxisNtracks", {30, -0.5, 29.5}, "Number of tracks in collision"};
ConfigurableAxis zzAxisNparticles{"zzAxisNparticles", {60, -0.5, 59.5}, "Number of particles in collision"};
ConfigurableAxis zzAxisNprocesses{"zzAxisNprocesses", {50, -0.5, 49.5}, "Number of processes"};
ConfigurableAxis zzAxisNtracks{"zzAxisNtracks", {100, -0.5, 99.5}, "Number of tracks in collision"};
ConfigurableAxis zzAxisNparticles{"zzAxisNparticles", {100, -0.5, 99.5}, "Number of particles in collision"};
ConfigurableAxis zzAxisNprocesses{"zzAxisNprocesses", {1000, -0.5, 999.5}, "Number of processes"};
ConfigurableAxis zzAxisInvMassWide{"zzAxisInvMassWide", {1000, 0., 10.}, "Invariant mass (GeV/c^{2}), wider range"};
ConfigurableAxis zzAxisPt{"zzAxisPt", {400, 0., 2.}, "Transversal momentum (GeV/c)"};
ConfigurableAxis zzAxisRap{"zzAxisRap", {50, -1.2, 1.2}, "Rapidity (a.u.)"};
Expand All @@ -74,24 +77,26 @@ struct TestMcStdTabsRl {
void processMCgen(aod::McCollision const& collision, aod::McParticles const& particles)
{

histos.get<TH2>(HIST("Events/Truth/hGenIDvsCountCollisions"))->Fill(collision.getGeneratorId(), 1);
histos.get<TH2>(HIST("Events/Truth/hGenIDvsNparticles"))->Fill(collision.getGeneratorId(), particles.size());
const auto genID = useMcgenidGetGeneratorID ? o2::mcgenid::getGeneratorId(collision.getGeneratorId()) : collision.getGeneratorId();

histos.get<TH2>(HIST("Events/Truth/hGenIDvsCountCollisions"))->Fill(genID, 1);
histos.get<TH2>(HIST("Events/Truth/hGenIDvsNparticles"))->Fill(genID, particles.size());

ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>> mother;
for (const auto& particle : particles) {
histos.get<TH2>(HIST("Events/Truth/hGenIDvsPDGcodesAll"))->Fill(collision.getGeneratorId(), particle.pdgCode());
histos.get<TH2>(HIST("Events/Truth/hGenIDvsPDGcodesAll"))->Fill(genID, particle.pdgCode());
// if (!particle.isPhysicalPrimary()) continue;
if (particle.has_mothers())
continue;
mother.SetPxPyPzE(particle.px(), particle.py(), particle.pz(), energy(pdg->Mass(particle.pdgCode()), particle.px(), particle.py(), particle.pz()));
histos.get<TH2>(HIST("Events/Truth/hGenIDvsPDGcodesNoMother"))->Fill(collision.getGeneratorId(), particle.pdgCode());
histos.get<TH2>(HIST("Events/Truth/hGenIDvsMotherMass"))->Fill(collision.getGeneratorId(), mother.M());
histos.get<TH2>(HIST("Events/Truth/hGenIDvsMotherPt"))->Fill(collision.getGeneratorId(), particle.pt());
histos.get<TH2>(HIST("Events/Truth/hGenIDvsMotherRap"))->Fill(collision.getGeneratorId(), particle.y());
histos.get<TH2>(HIST("Events/Truth/hGenIDvsPDGcodesNoMother"))->Fill(genID, particle.pdgCode());
histos.get<TH2>(HIST("Events/Truth/hGenIDvsMotherMass"))->Fill(genID, mother.M());
histos.get<TH2>(HIST("Events/Truth/hGenIDvsMotherPt"))->Fill(genID, particle.pt());
histos.get<TH2>(HIST("Events/Truth/hGenIDvsMotherRap"))->Fill(genID, particle.y());
const auto& daughters = particle.daughters_as<aod::McParticles>();
histos.get<TH2>(HIST("Events/Truth/hGenIDvsNdaughters"))->Fill(collision.getGeneratorId(), daughters.size());
histos.get<TH2>(HIST("Events/Truth/hGenIDvsNdaughters"))->Fill(genID, daughters.size());
for (const auto& daughter : daughters) {
histos.get<TH2>(HIST("Events/Truth/hGenIDvsPDGcodesDaughters"))->Fill(collision.getGeneratorId(), daughter.pdgCode());
histos.get<TH2>(HIST("Events/Truth/hGenIDvsPDGcodesDaughters"))->Fill(genID, daughter.pdgCode());
}
}

Expand Down
2 changes: 1 addition & 1 deletion PWGUD/Tasks/upcTauRl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ struct UpcTauRl {
return false; // TPC chi2
if (cutGlobalTrack.cutGoodITSTPCmatching) {
if (track.itsChi2NCl() < 0.)
return false; // TPC chi2
return false; // good ITS-TPC matching means ITS ch2 is not negative
}
// TOF
if (track.hasTOF()) {
Expand Down
Loading