Skip to content
Merged
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
8 changes: 6 additions & 2 deletions DPG/Tasks/AOTTrack/qaEfficiency.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,10 @@
LOG(fatal) << "Both processMC and processMCWithoutCollisions are set to true. Please set only one of them to true.";
}

if (numSameCollision && doprocessMCWithoutCollisions) {
LOG(fatal) << "Inconsistent configuration for process without MC collisions, but numSameCollision set to true. Please fix your configuration.";
}

auto h = histos.add<TH1>("MC/trackSelection", "Track Selection", kTH1D, {axisSel});
h->GetXaxis()->SetBinLabel(trkCutIdxTrkRead, "Tracks read");
h->GetXaxis()->SetBinLabel(trkCutIdxHasMcPart, "Passed has MC part.");
Expand Down Expand Up @@ -980,7 +984,7 @@
histos.get<TH1>(HIST("eventSelection"))->GetXaxis()->SetBinLabel(2, "Passed Ev. Sel. (no ev. sel)");
} else if (applyEvSel == 1) {
histos.get<TH1>(HIST("eventSelection"))->GetXaxis()->SetBinLabel(2, "Passed Ev. Sel. (sel7)");
} else if (applyEvSel == 2) {

Check failure on line 987 in DPG/Tasks/AOTTrack/qaEfficiency.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.
histos.get<TH1>(HIST("eventSelection"))->GetXaxis()->SetBinLabel(2, "Passed Ev. Sel. (sel8)");
} else {
LOG(fatal) << "Can't interpret event selection asked " << applyEvSel << " (0: no event selection, 1: sel7, 2: sel8)";
Expand All @@ -1004,7 +1008,7 @@
initMC(axisSel);

// Custom track cuts
if (globalTrackSelection.value == 6) {

Check failure on line 1011 in DPG/Tasks/AOTTrack/qaEfficiency.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.
customTrackCuts = getGlobalTrackSelectionRun3ITSMatch(cfgCustomTrackCuts.itsPattern);
LOG(info) << "Customizing track cuts:";
if (cfgCustomTrackCuts.tracksIU.value) {
Expand Down Expand Up @@ -1036,7 +1040,7 @@

bool isPhysicalPrimary(const o2::aod::McParticles::iterator& mcParticle)
{
if (maxProdRadius < 999.f) {

Check failure on line 1043 in DPG/Tasks/AOTTrack/qaEfficiency.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 ((mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy()) > maxProdRadius * maxProdRadius) {
return false;
}
Expand All @@ -1045,10 +1049,10 @@
}
bool isFinal(const o2::aod::McParticles::iterator& mcParticle)
{
if (!mcParticle.has_daughters() && !mcParticle.isPhysicalPrimary() && mcParticle.getProcess() == 4) {

Check failure on line 1052 in DPG/Tasks/AOTTrack/qaEfficiency.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.
auto mothers = mcParticle.mothers_as<o2::aod::McParticles>();
for (const auto& mother : mothers) {
if (!mother.isPhysicalPrimary() && mother.getProcess() == 4) {

Check failure on line 1055 in DPG/Tasks/AOTTrack/qaEfficiency.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 true;
}
}
Expand All @@ -1075,9 +1079,9 @@
constexpr int histogramIndex = id + pdgSign * nSpecies;
LOG(debug) << "fillMCTrackHistograms for pdgSign '" << pdgSign << "' and id '" << static_cast<int>(id) << "' " << particleName(pdgSign, id) << " with index " << histogramIndex;
auto const& mcParticle = track.mcParticle();
auto const& collision = track.collision_as<Colls>();
float radius = std::sqrt(mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy());
if (numSameCollision) {
auto const& collision = track.collision_as<Colls>();
if (!collision.has_mcCollision()) {
return;
}
Expand Down Expand Up @@ -1168,7 +1172,7 @@
}
}
}
} else if (mcParticle.getProcess() == 4) { // Particle decay

Check failure on line 1175 in DPG/Tasks/AOTTrack/qaEfficiency.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.
// Checking mothers
bool motherIsAccepted = true;
if (checkForMothers.value && mothersPDGs.value.size() > 0 && mcParticle.has_mothers()) {
Expand Down Expand Up @@ -1272,7 +1276,7 @@
hPtRadiusGeneratedPrm[histogramIndex]->Fill(mcParticle.pt(), radius);
}
} else {
if (mcParticle.getProcess() == 4) { // Particle decay

Check failure on line 1279 in DPG/Tasks/AOTTrack/qaEfficiency.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.
bool motherIsAccepted = true;
// Check for mothers if needed
if (checkForMothers.value && mothersPDGs.value.size() > 0 && mcParticle.has_mothers()) {
Expand Down Expand Up @@ -1453,7 +1457,7 @@
}
if (applyEvSel == 1 && !collision.sel7()) {
return false;
} else if (applyEvSel == 2 && !collision.sel8()) {

Check failure on line 1460 in DPG/Tasks/AOTTrack/qaEfficiency.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;
}
if constexpr (doFillHistograms) {
Expand Down Expand Up @@ -1551,7 +1555,7 @@

if (noFakesHits) { // Selecting tracks with no fake hits
bool hasFakeHit = false;
for (int i = 0; i < 10; i++) { // From ITS to TPC

Check failure on line 1558 in DPG/Tasks/AOTTrack/qaEfficiency.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 (track.mcMask() & 1 << i) {
hasFakeHit = true;
break;
Expand Down Expand Up @@ -1964,7 +1968,7 @@
// Loop on particles to fill the denominator
float dNdEta = 0; // Multiplicity
for (const auto& mcParticle : groupedMcParticles) {
if (TMath::Abs(mcParticle.eta()) <= 2.f && !mcParticle.has_daughters()) {

Check failure on line 1971 in DPG/Tasks/AOTTrack/qaEfficiency.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.
dNdEta += 1.f;
}
if (!isInAcceptance(mcParticle, HIST("MC/particleSelection"))) {
Expand Down Expand Up @@ -2025,7 +2029,7 @@

/// checking the PV z coordinate, if the track has been assigned to any collision
if (applyPvZCutInProcessMcWoColl && track.has_collision()) {
const auto collision = track.collision();
const auto collision = track.collision_as<CollisionsWithMcLabels>();
const float posZ = collision.posZ();
if (posZ < vertexZMin || posZ > vertexZMax) {
continue;
Expand Down
Loading