Skip to content

Commit 49289c6

Browse files
lucamicheletti93lucamicheletti
authored andcommitted
[PWGDQ] Fixing minitree filling in dqEfficiencyWithAssoc (#12823)
Co-authored-by: Lucamicheletti93 <luca.mike93@gmail.com>
1 parent cb0be2d commit 49289c6

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,7 @@ struct AnalysisMuonSelection {
768768
Configurable<std::string> fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
769769
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
770770
Configurable<int64_t> fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
771+
Configurable<float> fConfigMagField{"cfgMagField", 5.0f, "Manually set magnetic field"};
771772
Configurable<std::string> fConfigGeoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
772773

773774
Configurable<std::string> fConfigMCSignals{"cfgMuonMCSignals", "", "Comma separated list of MC signals"};
@@ -884,7 +885,9 @@ struct AnalysisMuonSelection {
884885
o2::base::Propagator::initFieldFromGRP(grpmag);
885886
VarManager::SetMagneticField(grpmag->getNominalL3Field());
886887
} else {
887-
LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", events.begin().timestamp());
888+
// LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", events.begin().timestamp());
889+
// If the magnetic field is not found it is configured by had by the user
890+
VarManager::SetMagneticField(fConfigMagField.value);
888891
}
889892
fCurrentRun = events.begin().runNumber();
890893
}
@@ -2173,9 +2176,12 @@ struct AnalysisSameEventPairing {
21732176

21742177
PresliceUnsorted<ReducedMCTracks> perReducedMcGenEvent = aod::reducedtrackMC::reducedMCeventId;
21752178

2176-
void processMCGen(soa::Filtered<MyEventsVtxCovSelected> const& events, ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& mcTracks)
2179+
void processMCGen(soa::Filtered<MyEventsVtxCovSelected> const& events, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks)
21772180
{
21782181
// Fill Generated histograms taking into account all generated tracks
2182+
uint32_t mcDecision = 0;
2183+
int isig = 0;
2184+
21792185
for (auto& mctrack : mcTracks) {
21802186
VarManager::FillTrackMC(mcTracks, mctrack);
21812187
// NOTE: Signals are checked here mostly based on the skimmed MC stack, so depending on the requested signal, the stack could be incomplete.
@@ -2209,9 +2215,15 @@ struct AnalysisSameEventPairing {
22092215
// auto track_raw = groupedMCTracks.rawIteratorAt(track.globalIndex());
22102216
for (auto& sig : fGenMCSignals) {
22112217
if (sig->CheckSignal(true, track_raw)) {
2218+
mcDecision |= (static_cast<uint32_t>(1) << isig);
22122219
fHistMan->FillHistClass(Form("MCTruthGenSel_%s", sig->GetName()), VarManager::fgValues);
2220+
if (useMiniTree.fConfigMiniTree) {
2221+
auto mcEvent = mcEvents.rawIteratorAt(track_raw.reducedMCeventId());
2222+
dileptonMiniTreeGen(mcDecision, mcEvent.impactParameter(), track_raw.pt(), track_raw.eta(), track_raw.phi(), -999, -999, -999);
2223+
}
22132224
}
22142225
}
2226+
isig++;
22152227
}
22162228
} // end loop over reconstructed events
22172229
if (fHasTwoProngGenMCsignals) {
@@ -2224,12 +2236,17 @@ struct AnalysisSameEventPairing {
22242236
continue;
22252237
}
22262238
if (sig->CheckSignal(true, t1_raw, t2_raw)) {
2227-
// mcDecision |= (static_cast<uint32_t>(1) << isig);
2239+
mcDecision |= (static_cast<uint32_t>(1) << isig);
22282240
VarManager::FillPairMC<VarManager::kDecayToMuMu>(t1, t2); // NOTE: This feature will only work for muons
22292241
fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig->GetName()), VarManager::fgValues);
2242+
if (useMiniTree.fConfigMiniTree) {
2243+
// WARNING! To be checked
2244+
dileptonMiniTreeGen(mcDecision, -999, t1.pt(), t1.eta(), t1.phi(), t2.pt(), t2.eta(), t2.phi());
2245+
}
22302246
}
22312247
}
22322248
}
2249+
isig++;
22332250
}
22342251
}
22352252
}

0 commit comments

Comments
 (0)