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
6 changes: 6 additions & 0 deletions DPG/Tasks/AOTTrack/qaEfficiency.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@
std::array<std::shared_ptr<TH1>, nParticles> hPtItsPrm;
std::array<std::shared_ptr<TH1>, nParticles> hPtItsTpcPrm;
std::array<std::shared_ptr<TH1>, nParticles> hPtTrkItsTpcPrm;
std::array<std::shared_ptr<TH2>, nParticles> hDeltaPtVsPtTrkItsTpcPrm;
std::array<std::shared_ptr<TH2>, nParticles> hPtGenVsPtTrkItsTpcPrm;
std::array<std::shared_ptr<TH1>, nParticles> hPtItsTpcTofPrm;
std::array<std::shared_ptr<TH1>, nParticles> hPtTrkItsTpcTofPrm;
std::array<std::shared_ptr<TH1>, nParticles> hPtGeneratedPrm;
Expand Down Expand Up @@ -376,6 +378,8 @@
hPtItsPrm[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/prm/its", PDGs[histogramIndex]), "ITS tracks (primaries) " + tagPt, kTH1D, {axisPt});
hPtItsTpcPrm[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/prm/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks (primaries) " + tagPt, kTH1D, {axisPt});
hPtTrkItsTpcPrm[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/prm/trk/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks (reco primaries) " + tagPt, kTH1D, {axisPt});
hDeltaPtVsPtTrkItsTpcPrm[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/prm/generated_vs_reco_delta", PDGs[histogramIndex]), "Abs(Gen - Reco) pT vs Gen pT (primaries) " + tagPt, kTH2D, {axisPt, axisPt});
hPtGenVsPtTrkItsTpcPrm[histogramIndex] = histos.add<TH2>(Form("MC/pdg%i/pt/prm/generated_vs_reco", PDGs[histogramIndex]), "Reco pT vs Gen pT (primaries) " + tagPt, kTH2D, {axisPt, axisPt});
hPtItsTpcTofPrm[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/prm/its_tpc_tof", PDGs[histogramIndex]), "ITS-TPC-TOF tracks (primaries) " + tagPt, kTH1D, {axisPt});
hPtTrkItsTpcTofPrm[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/prm/trk/its_tpc_tof", PDGs[histogramIndex]), "ITS-TPC-TOF tracks (reco primaries) " + tagPt, kTH1D, {axisPt});
hPtGeneratedPrm[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/prm/generated", PDGs[histogramIndex]), "Generated (primaries) " + tagPt, kTH1D, {axisPt});
Expand Down Expand Up @@ -985,7 +989,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 992 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 @@ -1009,7 +1013,7 @@
initMC(axisSel);

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

Check failure on line 1016 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 @@ -1041,7 +1045,7 @@

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

Check failure on line 1048 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 @@ -1050,10 +1054,10 @@
}
bool isFinal(const o2::aod::McParticles::iterator& mcParticle)
{
if (!mcParticle.has_daughters() && !mcParticle.isPhysicalPrimary() && mcParticle.getProcess() == 4) {

Check failure on line 1057 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 1060 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 Down Expand Up @@ -1156,6 +1160,8 @@
if (passedITS && passedTPC) {
hPtItsTpcPrm[histogramIndex]->Fill(mcParticle.pt());
hPtTrkItsTpcPrm[histogramIndex]->Fill(track.pt());
hDeltaPtVsPtTrkItsTpcPrm[histogramIndex]->Fill(mcParticle.pt(), abs(track.pt() - mcParticle.pt()));

Check failure on line 1163 in DPG/Tasks/AOTTrack/qaEfficiency.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
hPtGenVsPtTrkItsTpcPrm[histogramIndex]->Fill(mcParticle.pt(), track.pt());
hEtaItsTpcPrm[histogramIndex]->Fill(mcParticle.eta());
hEtaTrkItsTpcPrm[histogramIndex]->Fill(track.eta());
hPhiItsTpcPrm[histogramIndex]->Fill(mcParticle.phi());
Expand All @@ -1173,7 +1179,7 @@
}
}
}
} else if (mcParticle.getProcess() == 4) { // Particle decay

Check failure on line 1182 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 @@ -1277,7 +1283,7 @@
hPtRadiusGeneratedPrm[histogramIndex]->Fill(mcParticle.pt(), radius);
}
} else {
if (mcParticle.getProcess() == 4) { // Particle decay

Check failure on line 1286 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 @@ -1458,7 +1464,7 @@
}
if (applyEvSel == 1 && !collision.sel7()) {
return false;
} else if (applyEvSel == 2 && !collision.sel8()) {

Check failure on line 1467 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 @@ -1559,7 +1565,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 1568 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
Loading