Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please consider the following formatting changes to #7475 #38

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 4 additions & 0 deletions PWGDQ/Core/CutsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3202,6 +3202,10 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName)
std::string nameStr = cutName;
// ---------------------------------------------------------------
// Event cuts
if (!nameStr.compare("noEventCut")) {
return cut;
}

if (!nameStr.compare("eventNoTFBorder")) {
cut->AddCut(VarManager::kIsNoTFBorder, 0.5, 1.5);
return cut;
Expand Down
3 changes: 3 additions & 0 deletions PWGDQ/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h
hm->AddHistogram(histClass, "MCVtxX_VtxY", "Vtx X vs Vtx Y", false, 200, 15.0, 15.0, VarManager::kMCVtxZ, 200, -0.2, 0.2, VarManager::kMCVtxY);
hm->AddHistogram(histClass, "MCImpPar", "MC impact param", false, 20, 0.0, 20.0, VarManager::kMCEventImpParam);
}
if (subGroupStr.Contains("subgen")) {
hm->AddHistogram(histClass, "SubGenID", "SubGenerator ID", false, 11, -0.5, 10.5, VarManager::kMCEventSubGeneratorId);
}
if (subGroupStr.Contains("qvector")) {
int varZNA[3] = {VarManager::kQ1ZNAX, VarManager::kQ1ZNAY, VarManager::kCentFT0C};
int varZNC[3] = {VarManager::kQ1ZNCX, VarManager::kQ1ZNCY, VarManager::kCentFT0C};
Expand Down
2 changes: 2 additions & 0 deletions PWGDQ/Core/VarManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,15 @@ void VarManager::SetDefaultVarNames()
fgVariableNames[kCentFT0C] = "Centrality FT0C";
fgVariableUnits[kCentFT0C] = "%";
fgVariableNames[kMCEventGeneratorId] = "MC Generator ID";
fgVariableNames[kMCEventSubGeneratorId] = "MC SubGenerator ID";
fgVariableNames[kMCVtxX] = "MC Vtx X";
fgVariableNames[kMCVtxY] = "MC Vtx Y";
fgVariableNames[kMCVtxZ] = "MC Vtx Z";
fgVariableNames[kMCEventTime] = "MC event time";
fgVariableNames[kMCEventWeight] = "MC event weight";
fgVariableNames[kMCEventImpParam] = "MC impact parameter";
fgVariableUnits[kMCEventGeneratorId] = "";
fgVariableUnits[kMCEventSubGeneratorId] = "";
fgVariableUnits[kMCVtxX] = "cm";
fgVariableUnits[kMCVtxY] = "cm";
fgVariableUnits[kMCVtxZ] = "cm";
Expand Down
3 changes: 3 additions & 0 deletions PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ class VarManager : public TObject
kNTPCtracksInPast,
kNTPCtracksInFuture,
kMCEventGeneratorId,
kMCEventSubGeneratorId,
kMCVtxX,
kMCVtxY,
kMCVtxZ,
Expand Down Expand Up @@ -1626,6 +1627,7 @@ void VarManager::FillEvent(T const& event, float* values)

if constexpr ((fillMap & CollisionMC) > 0) {
values[kMCEventGeneratorId] = event.generatorsID();
values[kMCEventSubGeneratorId] = event.getSubGeneratorId();
values[kMCVtxX] = event.posX();
values[kMCVtxY] = event.posY();
values[kMCVtxZ] = event.posZ();
Expand All @@ -1636,6 +1638,7 @@ void VarManager::FillEvent(T const& event, float* values)

if constexpr ((fillMap & ReducedEventMC) > 0) {
values[kMCEventGeneratorId] = event.generatorsID();
values[kMCEventGeneratorId] = -999; // to be added in reduced events
values[kMCVtxX] = event.mcPosX();
values[kMCVtxY] = event.mcPosY();
values[kMCVtxZ] = event.mcPosZ();
Expand Down
149 changes: 75 additions & 74 deletions PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ struct AnalysisEventSelection {
subGeneratorID = event.mcCollision().getSubGeneratorId();
}
}

registry.fill(HIST("Generator/SubGenerator_BeforeCuts"), subGeneratorID);

// check if SubGeneratorID is part of list:
Expand Down Expand Up @@ -827,7 +827,7 @@ struct AnalysisTrackSelection {
if constexpr (smeared)
fHistGenSmearedPosPart[isig]->Fill(mctrack.ptSmeared(), mctrack.etaSmeared(), mctrack.phiSmeared());
}
if (fConfigQA){
if (fConfigQA) {
fHistManQA->FillHistClass(fHistNamesMCQA[isig].Data(), VarManager::fgValues);
}
}
Expand Down Expand Up @@ -1094,7 +1094,8 @@ struct AnalysisTrackSelection {
}
}
}
if (!pass) continue; // rec collision of track is not selected by isSelected
if (!pass)
continue; // rec collision of track is not selected by isSelected
// else rec collision of track is selected by isSelected
} else {
// printf("Not attached to a reconstructed collision\n");
Expand Down Expand Up @@ -1169,10 +1170,10 @@ struct AnalysisTrackSelection {
// continue;
// }

// no track cuts
if (!(fRecTrackLabels[fTrackCuts.size()].find(mctrackindex) != fRecTrackLabels[fTrackCuts.size()].end())) {
fRecTrackLabels[fTrackCuts.size()][mctrackindex] = fRecCounters[fTrackCuts.size()];
fRecCounters[fTrackCuts.size()]++;
// no track cuts
if (!(fRecTrackLabels[fTrackCuts.size()].find(mctrackindex) != fRecTrackLabels[fTrackCuts.size()].end())) {
fRecTrackLabels[fTrackCuts.size()][mctrackindex] = fRecCounters[fTrackCuts.size()];
fRecCounters[fTrackCuts.size()]++;
} else {
// printf("For cut %d, found a mc collision track already reconstructed %d for selected collision with the same mc collision %d\n",j,mctrackindex,mcCollisionId);
doublereconstructedtrack[fTrackCuts.size()] = 1;
Expand All @@ -1192,88 +1193,88 @@ struct AnalysisTrackSelection {
}
}
}
// }
// }

// fill histograms
for (unsigned int i = 0; i < fMCSignals.size(); i++) {
if (!(mcDecision & (uint32_t(1) << i))) {
continue;
}
Double_t mmcpt = -10000.;
Double_t mmceta = -10000.;
Double_t mmcphi = -1000.;
// No track cut
if (fConfigRecWithMC) {
if constexpr ((TTrackFillMap & VarManager::ObjTypes::ReducedTrack) > 0) {
auto mctrack = track.reducedMCTrack();
mmcpt = mctrack.pt();
mmceta = mctrack.eta();
mmcphi = mctrack.phi();
// fill histograms
for (unsigned int i = 0; i < fMCSignals.size(); i++) {
if (!(mcDecision & (uint32_t(1) << i))) {
continue;
}
if constexpr ((TTrackFillMap & VarManager::ObjTypes::Track) > 0) {
if (track.has_mcParticle()) {
auto mctrack = track.template mcParticle_as<aod::McParticles>();
Double_t mmcpt = -10000.;
Double_t mmceta = -10000.;
Double_t mmcphi = -1000.;
// No track cut
if (fConfigRecWithMC) {
if constexpr ((TTrackFillMap & VarManager::ObjTypes::ReducedTrack) > 0) {
auto mctrack = track.reducedMCTrack();
mmcpt = mctrack.pt();
mmceta = mctrack.eta();
mmcphi = mctrack.phi();
}
}

if ((mccollisionwithin10 && fConfigMCCollz) || (!fConfigMCCollz)) {
if (track.sign() < 0) {
fHistRecNegPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (doublereconstructedtrack[fTrackCuts.size()] == 0)
fHistRecNegSingleRecPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (TMath::Abs(mmceta) < 0.8) {
fHistRecNegClassCollDoubleCountPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
fHistRecNegClassAmbigCollDoubleCountPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(ambiguousinfo, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
if constexpr ((TTrackFillMap & VarManager::ObjTypes::Track) > 0) {
if (track.has_mcParticle()) {
auto mctrack = track.template mcParticle_as<aod::McParticles>();
mmcpt = mctrack.pt();
mmceta = mctrack.eta();
mmcphi = mctrack.phi();
}
} else {
fHistRecPosPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (doublereconstructedtrack[fTrackCuts.size()] == 0)
fHistRecPosSingleRecPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (TMath::Abs(mmceta) < 0.8) {
fHistRecPosClassCollDoubleCountPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
fHistRecPosClassAmbigCollDoubleCountPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(ambiguousinfo, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
}

if ((mccollisionwithin10 && fConfigMCCollz) || (!fConfigMCCollz)) {
if (track.sign() < 0) {
fHistRecNegPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (doublereconstructedtrack[fTrackCuts.size()] == 0)
fHistRecNegSingleRecPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (TMath::Abs(mmceta) < 0.8) {
fHistRecNegClassCollDoubleCountPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
fHistRecNegClassAmbigCollDoubleCountPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(ambiguousinfo, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
}
} else {
fHistRecPosPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (doublereconstructedtrack[fTrackCuts.size()] == 0)
fHistRecPosSingleRecPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (TMath::Abs(mmceta) < 0.8) {
fHistRecPosClassCollDoubleCountPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(mmcpt, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
fHistRecPosClassAmbigCollDoubleCountPartMC[fTrackCuts.size() * fMCSignals.size() + i]->Fill(ambiguousinfo, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
}
}
}
}
}
// track cuts
for (unsigned int j = 0; j < fTrackCuts.size(); j++) {
if (filterMap & (uint8_t(1) << j)) {
if (track.sign() < 0) {
fHistRecNegPart[j * fMCSignals.size() + i]->Fill(track.pt(), track.eta(), track.phi());
} else {
fHistRecPosPart[j * fMCSignals.size() + i]->Fill(track.pt(), track.eta(), track.phi());
}
// track cuts
for (unsigned int j = 0; j < fTrackCuts.size(); j++) {
if (filterMap & (uint8_t(1) << j)) {
if (track.sign() < 0) {
fHistRecNegPart[j * fMCSignals.size() + i]->Fill(track.pt(), track.eta(), track.phi());
} else {
fHistRecPosPart[j * fMCSignals.size() + i]->Fill(track.pt(), track.eta(), track.phi());
}

if (fConfigRecWithMC) {
if ((mccollisionwithin10 && fConfigMCCollz) || (!fConfigMCCollz)) {
if (track.sign() < 0) {
fHistRecNegPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (doublereconstructedtrack[j] == 0)
fHistRecNegSingleRecPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (TMath::Abs(mmceta) < 0.8) {
fHistRecNegClassCollDoubleCountPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, collisioninfo, doublereconstructedtrack[j]);
fHistRecNegClassAmbigCollDoubleCountPartMC[j * fMCSignals.size() + i]->Fill(ambiguousinfo, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
}
} else {
fHistRecPosPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (doublereconstructedtrack[j] == 0)
fHistRecPosSingleRecPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (TMath::Abs(mmceta) < 0.8) {
fHistRecPosClassCollDoubleCountPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, collisioninfo, doublereconstructedtrack[j]);
fHistRecPosClassAmbigCollDoubleCountPartMC[j * fMCSignals.size() + i]->Fill(ambiguousinfo, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
if (fConfigRecWithMC) {
if ((mccollisionwithin10 && fConfigMCCollz) || (!fConfigMCCollz)) {
if (track.sign() < 0) {
fHistRecNegPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (doublereconstructedtrack[j] == 0)
fHistRecNegSingleRecPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (TMath::Abs(mmceta) < 0.8) {
fHistRecNegClassCollDoubleCountPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, collisioninfo, doublereconstructedtrack[j]);
fHistRecNegClassAmbigCollDoubleCountPartMC[j * fMCSignals.size() + i]->Fill(ambiguousinfo, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
}
} else {
fHistRecPosPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (doublereconstructedtrack[j] == 0)
fHistRecPosSingleRecPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, mmceta, mmcphi);
if (TMath::Abs(mmceta) < 0.8) {
fHistRecPosClassCollDoubleCountPartMC[j * fMCSignals.size() + i]->Fill(mmcpt, collisioninfo, doublereconstructedtrack[j]);
fHistRecPosClassAmbigCollDoubleCountPartMC[j * fMCSignals.size() + i]->Fill(ambiguousinfo, collisioninfo, doublereconstructedtrack[fTrackCuts.size()]);
}
}
}
}
}

if (fConfigQA)
fHistManQA->FillHistClass(fHistNamesMCMatchedQA[j][i].Data(), VarManager::fgValues);
}
} // end loop over cuts
if (fConfigQA)
fHistManQA->FillHistClass(fHistNamesMCMatchedQA[j][i].Data(), VarManager::fgValues);
}
} // end loop over cuts
} // end loop over MC signals
} // end loop over reconstructed track belonging to the events
}
Expand Down
Loading