From 0c09759f4822696b448c5d1e77f92e4de371dfaf Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Thu, 18 Dec 2025 17:12:47 +0900 Subject: [PATCH] PWGEM/Dilepton: update trigger analyses --- PWGEM/Dilepton/Core/Dilepton.h | 83 ++++++++----------- PWGEM/Dilepton/Core/DileptonHadronMPC.h | 63 +++++--------- PWGEM/Dilepton/Core/SingleTrackQC.h | 80 ++++++++---------- .../TableProducer/createEMEventDilepton.cxx | 69 ++------------- PWGEM/Dilepton/TableProducer/skimmerOTS.cxx | 59 +++++++------ PWGEM/Dilepton/Tasks/CMakeLists.txt | 12 +-- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 5 +- .../TableProducer/createEMEventPhoton.cxx | 75 ++++++++--------- 8 files changed, 173 insertions(+), 273 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index bbd0f4b6be3..0d06f99065d 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -31,6 +31,7 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" +#include "Common/Core/Zorro.h" #include "Common/Core/trackUtilities.h" #include "Tools/ML/MlResponse.h" @@ -48,7 +49,6 @@ #include "MathUtils/Utils.h" #include "Math/Vector4D.h" -#include "TH1D.h" #include "TString.h" #include @@ -73,9 +73,6 @@ using namespace o2::aod::pwgem::dilepton::utils::pairutil; using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; -using MyCollisionsWithSWT = soa::Join; -using MyCollisionWithSWT = MyCollisionsWithSWT::iterator; - using MyElectrons = soa::Join; using MyElectron = MyElectrons::iterator; using FilteredMyElectrons = soa::Filtered; @@ -116,7 +113,6 @@ struct Dilepton { ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"}; ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; - Configurable cfg_swt_name{"cfg_swt_name", "fHighTrackMult", "desired software trigger name"}; // 1 trigger name per 1 task. fHighTrackMult, fHighFt0Mult // Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; // Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; @@ -294,9 +290,17 @@ struct Dilepton { Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; } dimuoncuts; + struct : ConfigurableGroup { + std::string prefix = "zorroGroup"; + Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name"}; // 1 trigger per 1 task + o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; + Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + } zorroGroup; + o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; Service ccdb; + Zorro zorro; int mRunNumber; float d_bz; @@ -423,15 +427,6 @@ struct Dilepton { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); fRegistry.add("Event/norm/hZvtx", "hZvtx;Z_{vtx} (cm)", kTH1D, {{100, -50, +50}}, false); } - if (doprocessTriggerAnalysis) { - LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", cfg_swt_name.value.data()); - fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true); - fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true); - fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true); - auto hTriggerCounter = fRegistry.add("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", cfg_swt_name.value.data()), kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false); - hTriggerCounter->GetYaxis()->SetBinLabel(1, "Analyzed Trigger"); - hTriggerCounter->GetYaxis()->SetBinLabel(2, "Analyzed TOI"); - } if (doprocessBC) { auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); @@ -443,7 +438,7 @@ struct Dilepton { } } - template + template void initCCDB(TCollision const& collision) { if (mRunNumber == collision.runNumber()) { @@ -482,6 +477,15 @@ struct Dilepton { d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kG"; } + + // zorro + if constexpr (isTriggerAnalysis) { + zorro.setCCDBpath(zorroGroup.ccdbPathSoftwareTrigger); + zorro.setBCtolerance(zorroGroup.bcMarginForSoftwareTrigger); // this does nothing. + zorro.initCCDB(ccdb.service, collision.runNumber(), collision.timestamp(), zorroGroup.cfg_swt_name.value); + zorro.populateHistRegistry(fRegistry, collision.runNumber()); + } + mRunNumber = collision.runNumber(); fDielectronCut.SetTrackPhiPositionRange(dielectroncuts.cfg_min_phiposition_track, dielectroncuts.cfg_max_phiposition_track, dielectroncuts.cfgRefR, d_bz, dielectroncuts.cfg_mirror_phi_track); @@ -1152,19 +1156,14 @@ struct Dilepton { void runPairing(TCollisions const& collisions, TLeptons const& posTracks, TLeptons const& negTracks, TPresilce const& perCollision, TCut const& cut, TAllTracks const& tracks) { for (const auto& collision : collisions) { - initCCDB(collision); + initCCDB(collision); + const float centralities[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; float centrality = centralities[cfgCentEstimator]; if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) { continue; } - if constexpr (isTriggerAnalysis) { - if (!collision.swtalias_bit(o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value))) { - continue; - } - } - std::array q2ft0m = {collision.q2xft0m(), collision.q2yft0m()}; std::array q2ft0a = {collision.q2xft0a(), collision.q2yft0a()}; std::array q2ft0c = {collision.q2xft0c(), collision.q2yft0c()}; @@ -1210,6 +1209,12 @@ struct Dilepton { continue; } + if constexpr (isTriggerAnalysis) { + if (!zorro.isSelected(collision.globalBC(), zorroGroup.bcMarginForSoftwareTrigger)) { // triggered event + continue; + } + } + if (nmod == 2) { o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<1, 2>(&fRegistry, collision); } else if (nmod == 3) { @@ -1403,17 +1408,17 @@ struct Dilepton { passed_pairIds.reserve(posTracks.size() * negTracks.size()); for (const auto& collision : collisions) { - initCCDB(collision); + initCCDB(collision); const float centralities[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) { continue; } - if constexpr (isTriggerAnalysis) { - if (!collision.swtalias_bit(o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value))) { - continue; - } - } + // if constexpr (isTriggerAnalysis) { // don't call this here. this causes double counting. + // if (!zorro.isSelected(collision.globalBC(), zorroGroup.bcMarginForSoftwareTrigger)) { // triggered event + // continue; + // } + // } std::array q2ft0m = {collision.q2xft0m(), collision.q2yft0m()}; std::array q2ft0a = {collision.q2xft0a(), collision.q2yft0a()}; @@ -1522,8 +1527,7 @@ struct Dilepton { } PROCESS_SWITCH(Dilepton, processAnalysis, "run dilepton analysis", true); - using FilteredMyCollisionsWithSWT = soa::Filtered; - void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerATCounters const& countersAT, aod::EMSWTriggerTOICounters const& countersTOI, Types const&... args) + void processTriggerAnalysis(FilteredMyCollisions const& collisions, Types const&... args) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { auto electrons = std::get<0>(std::tie(args...)); @@ -1540,25 +1544,6 @@ struct Dilepton { } map_weight.clear(); ndf++; - - // for nomalization - int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value); - for (const auto& counter : countersAT) { - if (counter.isAnalyzed_bit(emswtId)) { - fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 0); - } - } - for (const auto& counter : countersTOI) { - if (counter.isAnalyzedToI_bit(emswtId)) { - fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 1); - } - } - - for (const auto& info : cefpinfos) { - fRegistry.fill(HIST("NormTrigger/hInspectedTVX"), info.runNumber(), info.nInspectedTVX()); - fRegistry.fill(HIST("NormTrigger/hScalers"), info.runNumber(), info.nScalers()[emswtId]); - fRegistry.fill(HIST("NormTrigger/hSelections"), info.runNumber(), info.nSelections()[emswtId]); - } } PROCESS_SWITCH(Dilepton, processTriggerAnalysis, "run dilepton analysis on triggered data", false); diff --git a/PWGEM/Dilepton/Core/DileptonHadronMPC.h b/PWGEM/Dilepton/Core/DileptonHadronMPC.h index dec2d9eb9dd..856d5d7f740 100644 --- a/PWGEM/Dilepton/Core/DileptonHadronMPC.h +++ b/PWGEM/Dilepton/Core/DileptonHadronMPC.h @@ -32,6 +32,7 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" +#include "Common/Core/Zorro.h" #include "Common/Core/trackUtilities.h" #include "Tools/ML/MlResponse.h" @@ -49,7 +50,6 @@ #include "MathUtils/Utils.h" #include "Math/Vector4D.h" -#include "TH1D.h" #include "TString.h" #include @@ -74,9 +74,6 @@ using namespace o2::aod::pwgem::dilepton::utils::pairutil; using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; -using MyCollisionsWithSWT = soa::Join; -using MyCollisionWithSWT = MyCollisionsWithSWT::iterator; - using MyElectrons = soa::Join; using MyElectron = MyElectrons::iterator; using FilteredMyElectrons = soa::Filtered; @@ -290,12 +287,20 @@ struct DileptonHadronMPC { Configurable cfg_track_bits{"cfg_track_bits", 5765, "required track bits"}; // default:645, loose:0, tight:778 } trackcuts; + struct : ConfigurableGroup { + std::string prefix = "zorroGroup"; + Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name"}; // 1 trigger per 1 task + o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; + Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + } zorroGroup; + o2::aod::rctsel::RCTFlagsChecker rctChecker; - o2::ccdb::CcdbApi ccdbApi; + // o2::ccdb::CcdbApi ccdbApi; Service ccdb; int mRunNumber; float d_bz; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; + Zorro zorro; HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; @@ -442,10 +447,12 @@ struct DileptonHadronMPC { } mRunNumber = collision.runNumber(); + // zorro if constexpr (isTriggerAnalysis) { - LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", cfg_swt_name.value); - // LOGF(info, "total inspected TVX events = %d in run number %d", collision.nInspectedTVX(), collision.runNumber()); - // fRegistry.fill(HIST("Event/hNInspectedTVX"), collision.runNumber(), collision.nInspectedTVX()); + zorro.setCCDBpath(zorroGroup.ccdbPathSoftwareTrigger); + zorro.setBCtolerance(zorroGroup.bcMarginForSoftwareTrigger); // this does nothing. + zorro.initCCDB(ccdb.service, collision.runNumber(), collision.timestamp(), zorroGroup.cfg_swt_name.value); + zorro.populateHistRegistry(fRegistry, collision.runNumber()); } } @@ -1038,12 +1045,6 @@ struct DileptonHadronMPC { continue; } - if constexpr (isTriggerAnalysis) { - if (!collision.swtalias_bit(o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value))) { - continue; - } - } - o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<0, -1>(&fRegistry, collision); if (!fEMEventCut.IsSelected(collision)) { @@ -1053,6 +1054,12 @@ struct DileptonHadronMPC { continue; } + if constexpr (isTriggerAnalysis) { + if (!zorro.isSelected(collision.globalBC(), zorroGroup.bcMarginForSoftwareTrigger)) { // triggered event + continue; + } + } + o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<1, -1>(&fRegistry, collision); fRegistry.fill(HIST("Event/before/hCollisionCounter"), o2::aod::pwgem::dilepton::utils::eventhistogram::nbin_ev); // accepted fRegistry.fill(HIST("Event/after/hCollisionCounter"), o2::aod::pwgem::dilepton::utils::eventhistogram::nbin_ev); // accepted @@ -1297,12 +1304,6 @@ struct DileptonHadronMPC { continue; } - if constexpr (isTriggerAnalysis) { - if (!collision.swtalias_bit(o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value))) { - continue; - } - } - if (!fEMEventCut.IsSelected(collision)) { continue; } @@ -1385,8 +1386,7 @@ struct DileptonHadronMPC { } PROCESS_SWITCH(DileptonHadronMPC, processAnalysis, "run dilepton analysis", true); - using FilteredMyCollisionsWithSWT = soa::Filtered; - void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, FilteredRefTracks const& refTracks, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerATCounters const& countersAT, aod::EMSWTriggerTOICounters const& countersTOI, Types const&... args) + void processTriggerAnalysis(FilteredMyCollisions const& collisions, FilteredRefTracks const& refTracks, Types const&... args) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { auto electrons = std::get<0>(std::tie(args...)); @@ -1403,25 +1403,6 @@ struct DileptonHadronMPC { } map_weight.clear(); ndf++; - - // for nomalization - int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value); - for (const auto& counter : countersAT) { - if (counter.isAnalyzed_bit(emswtId)) { - fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 0); - } - } - for (const auto& counter : countersTOI) { - if (counter.isAnalyzedToI_bit(emswtId)) { - fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 1); - } - } - - for (const auto& info : cefpinfos) { - fRegistry.fill(HIST("NormTrigger/hInspectedTVX"), info.runNumber(), info.nInspectedTVX()); - fRegistry.fill(HIST("NormTrigger/hScalers"), info.runNumber(), info.nScalers()[emswtId]); - fRegistry.fill(HIST("NormTrigger/hSelections"), info.runNumber(), info.nSelections()[emswtId]); - } } PROCESS_SWITCH(DileptonHadronMPC, processTriggerAnalysis, "run dilepton analysis on triggered data", false); diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index 6efef833fb7..4154d56bc3c 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -27,6 +27,7 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/Core/Zorro.h" #include "Tools/ML/MlResponse.h" #include "CCDB/BasicCCDBManager.h" @@ -56,9 +57,6 @@ using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; -using MyCollisionsWithSWT = soa::Join; -using MyCollisionWithSWT = MyCollisionsWithSWT::iterator; - using MyElectrons = soa::Join; using MyElectron = MyElectrons::iterator; using FilteredMyElectrons = soa::Filtered; @@ -214,9 +212,17 @@ struct SingleTrackQC { Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; } dimuoncuts; + struct : ConfigurableGroup { + std::string prefix = "zorroGroup"; + Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name"}; // 1 trigger per 1 task + o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; + Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + } zorroGroup; + o2::aod::rctsel::RCTFlagsChecker rctChecker; o2::ccdb::CcdbApi ccdbApi; Service ccdb; + Zorro zorro; HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 HistogramRegistry can keep up to 512 histograms static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; @@ -327,15 +333,6 @@ struct SingleTrackQC { if (doprocessNorm) { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); } - if (doprocessQC_TriggeredData) { - LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", cfg_swt_name.value.data()); - fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true); - fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true); - fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true); - auto hTriggerCounter = fRegistry.add("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", cfg_swt_name.value.data()), kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false); - hTriggerCounter->GetYaxis()->SetBinLabel(1, "Analyzed Trigger"); - hTriggerCounter->GetYaxis()->SetBinLabel(2, "Analyzed TOI"); - } if (doprocessBC) { auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); @@ -347,7 +344,7 @@ struct SingleTrackQC { } } - template + template void initCCDB(TCollision const& collision) { if (mRunNumber == collision.runNumber()) { @@ -387,6 +384,14 @@ struct SingleTrackQC { mRunNumber = collision.runNumber(); fDielectronCut.SetTrackPhiPositionRange(dielectroncuts.cfg_min_phiposition_track, dielectroncuts.cfg_max_phiposition_track, dielectroncuts.cfgRefR, d_bz, dielectroncuts.cfg_mirror_phi_track); + + // zorro + if constexpr (isTriggerAnalysis) { + zorro.setCCDBpath(zorroGroup.ccdbPathSoftwareTrigger); + zorro.setBCtolerance(zorroGroup.bcMarginForSoftwareTrigger); // this does nothing. + zorro.initCCDB(ccdb.service, collision.runNumber(), collision.timestamp(), zorroGroup.cfg_swt_name.value); + zorro.populateHistRegistry(fRegistry, collision.runNumber()); + } } void DefineEMEventCut() @@ -662,16 +667,11 @@ struct SingleTrackQC { void runQC(TCollisions const& collisions, TTracks const& tracks, TPreslice const& perCollision, TCut const& cut) { for (const auto& collision : collisions) { - initCCDB(collision); + initCCDB(collision); float centralities[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) { continue; } - if constexpr (isTriggerAnalysis) { - if (!collision.swtalias_bit(o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value))) { - continue; - } - } o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<0, -1>(&fRegistry, collision); if (!fEMEventCut.IsSelected(collision)) { @@ -680,6 +680,13 @@ struct SingleTrackQC { if (eventcuts.cfgRequireGoodRCT && !rctChecker.checkTable(collision)) { continue; } + + if constexpr (isTriggerAnalysis) { + if (!zorro.isSelected(collision.globalBC(), zorroGroup.bcMarginForSoftwareTrigger)) { // triggered event + continue; + } + } + o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<1, -1>(&fRegistry, collision); fRegistry.fill(HIST("Event/before/hCollisionCounter"), o2::aod::pwgem::dilepton::utils::eventhistogram::nbin_ev); // accepted fRegistry.fill(HIST("Event/after/hCollisionCounter"), o2::aod::pwgem::dilepton::utils::eventhistogram::nbin_ev); // accepted @@ -721,16 +728,17 @@ struct SingleTrackQC { std::vector passed_trackIds; passed_trackIds.reserve(tracks.size()); for (const auto& collision : collisions) { - initCCDB(collision); + initCCDB(collision); float centralities[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) { continue; } - if constexpr (isTriggerAnalysis) { - if (!collision.swtalias_bit(o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value))) { - continue; - } - } + + // if constexpr (isTriggerAnalysis) { + // if (!collision.swtalias_bit(o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value))) { + // continue; + // } + // } if (!fEMEventCut.IsSelected(collision)) { continue; @@ -833,8 +841,7 @@ struct SingleTrackQC { } PROCESS_SWITCH(SingleTrackQC, processQC, "run single track QC", true); - using FilteredMyCollisionsWithSWT = soa::Filtered; - void processQC_TriggeredData(FilteredMyCollisionsWithSWT const& collisions, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerATCounters const& countersAT, aod::EMSWTriggerTOICounters const& countersTOI, Types const&... args) + void processQC_TriggeredData(FilteredMyCollisions const& collisions, Types const&... args) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { auto electrons = std::get<0>(std::tie(args...)); @@ -850,25 +857,6 @@ struct SingleTrackQC { runQC(collisions, muons, perCollision_muon, fDimuonCut); } map_weight.clear(); - - // for nomalization - int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value); - for (const auto& counter : countersAT) { - if (counter.isAnalyzed_bit(emswtId)) { - fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 0); - } - } - for (const auto& counter : countersTOI) { - if (counter.isAnalyzedToI_bit(emswtId)) { - fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 1); - } - } - - for (const auto& info : cefpinfos) { - fRegistry.fill(HIST("NormTrigger/hInspectedTVX"), info.runNumber(), info.nInspectedTVX()); - fRegistry.fill(HIST("NormTrigger/hScalers"), info.runNumber(), info.nScalers()[emswtId]); - fRegistry.fill(HIST("NormTrigger/hSelections"), info.runNumber(), info.nSelections()[emswtId]); - } } PROCESS_SWITCH(SingleTrackQC, processQC_TriggeredData, "run single track QC on triggered data", false); diff --git a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx index 299543874d8..608fd8afaf9 100644 --- a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx @@ -68,10 +68,6 @@ struct CreateEMEventDilepton { Produces event_mult; Produces event_cent; Produces event_qvec; - Produces emswtbit; - Produces emswtinfo; - Produces emswtATcounter; - Produces emswtTOIcounter; Produces event_norm_info; enum class EMEventType : int { @@ -118,7 +114,8 @@ struct CreateEMEventDilepton { } registry.fill(HIST("hEventCounter"), 1); - auto bc = collision.template foundBC_as(); + // auto bc = collision.template foundBC_as(); + auto bc = collision.template bc_as(); // use this for Zorro if (collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { int16_t posZint16 = static_cast(collision.posZ() * 100.f); @@ -149,9 +146,10 @@ struct CreateEMEventDilepton { if constexpr (isTriggerAnalysis) { if (collision.swtaliastmp_raw() == 0) { continue; - } else { - emswtbit(collision.swtaliastmp_raw()); } + // else { + // emswtbit(collision.swtaliastmp_raw()); + // } } registry.fill(HIST("hEventCounter"), 2); @@ -224,72 +222,21 @@ struct CreateEMEventDilepton { //---------- for data with swt ---------- - void processEvent_SWT(MyCollisionsWithSWT const& collisions, MyBCs const& bcs, aod::EMSWTriggerInfosTMP const& emswtinfostmp, aod::EMSWTriggerATCountersTMP const& emswtATcounterstmp, aod::EMSWTriggerTOICountersTMP const& emswtTOIcounterstmp) + void processEvent_SWT(MyCollisionsWithSWT const& collisions, MyBCs const& bcs) { skimEvent(collisions, bcs); - - for (const auto& info : emswtinfostmp) { - if (mRunNumber != info.runNumber()) { - std::vector scalers; - std::vector selections; - std::copy(info.nScalers().begin(), info.nScalers().end(), std::back_inserter(scalers)); - std::copy(info.nSelections().begin(), info.nSelections().end(), std::back_inserter(selections)); - emswtinfo(info.runNumber(), info.nInspectedTVX(), scalers, selections); - mRunNumber = info.runNumber(); - } - } - for (const auto& counter : emswtATcounterstmp) { - emswtATcounter(counter.isAnalyzed_raw()); - } - for (const auto& counter : emswtTOIcounterstmp) { - emswtTOIcounter(counter.isAnalyzedToI_raw()); - } } PROCESS_SWITCH(CreateEMEventDilepton, processEvent_SWT, "process event info", false); - void processEvent_SWT_Cent(MyCollisionsWithSWT_Cent const& collisions, MyBCs const& bcs, aod::EMSWTriggerInfosTMP const& emswtinfostmp, aod::EMSWTriggerATCountersTMP const& emswtATcounterstmp, aod::EMSWTriggerTOICountersTMP const& emswtTOIcounterstmp) + void processEvent_SWT_Cent(MyCollisionsWithSWT_Cent const& collisions, MyBCs const& bcs) { skimEvent(collisions, bcs); - - for (const auto& info : emswtinfostmp) { - if (mRunNumber != info.runNumber()) { - std::vector scalers; - std::vector selections; - std::copy(info.nScalers().begin(), info.nScalers().end(), std::back_inserter(scalers)); - std::copy(info.nSelections().begin(), info.nSelections().end(), std::back_inserter(selections)); - emswtinfo(info.runNumber(), info.nInspectedTVX(), scalers, selections); - mRunNumber = info.runNumber(); - } - } - for (const auto& counter : emswtATcounterstmp) { - emswtATcounter(counter.isAnalyzed_raw()); - } - for (const auto& counter : emswtTOIcounterstmp) { - emswtTOIcounter(counter.isAnalyzedToI_raw()); - } } PROCESS_SWITCH(CreateEMEventDilepton, processEvent_SWT_Cent, "process event info", false); - void processEvent_SWT_Cent_Qvec(MyCollisionsWithSWT_Cent_Qvec const& collisions, MyBCs const& bcs, aod::EMSWTriggerInfosTMP const& emswtinfostmp, aod::EMSWTriggerATCountersTMP const& emswtATcounterstmp, aod::EMSWTriggerTOICountersTMP const& emswtTOIcounterstmp) + void processEvent_SWT_Cent_Qvec(MyCollisionsWithSWT_Cent_Qvec const& collisions, MyBCs const& bcs) { skimEvent(collisions, bcs); - - for (const auto& info : emswtinfostmp) { - if (mRunNumber != info.runNumber()) { - std::vector scalers; - std::vector selections; - std::copy(info.nScalers().begin(), info.nScalers().end(), std::back_inserter(scalers)); - std::copy(info.nSelections().begin(), info.nSelections().end(), std::back_inserter(selections)); - emswtinfo(info.runNumber(), info.nInspectedTVX(), scalers, selections); - mRunNumber = info.runNumber(); - } - } - for (const auto& counter : emswtATcounterstmp) { - emswtATcounter(counter.isAnalyzed_raw()); - } - for (const auto& counter : emswtTOIcounterstmp) { - emswtTOIcounter(counter.isAnalyzedToI_raw()); - } } PROCESS_SWITCH(CreateEMEventDilepton, processEvent_SWT_Cent_Qvec, "process event info", false); diff --git a/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx b/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx index 8a1ab8bdf64..d1836d97ad0 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx @@ -36,10 +36,7 @@ using namespace o2::soa; using MyCollisions = soa::Join; struct skimmerOTS { - Produces swtinfo_tmp; // Join aod::Collision later. Produces swtbit_tmp; - Produces swtcounterAT_tmp; - Produces swtcounterTOI_tmp; // CCDB options Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -128,7 +125,6 @@ struct skimmerOTS { mSelections[emswtId] = zorro.getSelections()->GetBinContent(mTOIidx[idx] + 2); LOGF(info, "Trigger of Interest : index = %d in Zorro, %d in EM, scaler = %llu, selection = %llu", mTOIidx[idx], emswtId, mScalers[emswtId], mSelections[emswtId]); } - swtinfo_tmp(bc.runNumber(), mNinspectedTVX, mScalers, mSelections); mRunNumber = bc.runNumber(); } @@ -146,33 +142,34 @@ struct skimmerOTS { if (collision.isSelected()) { if (zorro.isSelected(bc.globalBC(), bcMarginForSoftwareTrigger)) { // triggered event - auto swt_bitset = zorro.getLastResult(); // this has to be called after zorro::isSelected, or simply call zorro.fetch - auto TOIcounters = zorro.getTOIcounters(); // this has to be called after zorro::isSelected, or simply call zorro.fetch - auto ATcounters = zorro.getATcounters(); // this has to be called after zorro::isSelected, or simply call zorro.fetch - - // LOGF(info, "swt_bitset.to_string().c_str() = %s", swt_bitset.to_string().c_str()); - for (size_t idx = 0; idx < mTOIidx.size(); idx++) { - if (swt_bitset.test(mTOIidx[idx])) { - auto swtname = swt_names[idx]; - int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname); - trigger_bitmap |= BIT(emswtId); - // LOGF(info, "swtname = %s is fired. swt index in original swt table = %d, swt index for EM table = %d", swtname.data(), mTOIidx[idx], o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname)); - registry.fill(HIST("hCollisionCounter"), idx + 2); // fired trigger - - // LOGF(info, "ATcounters[mTOIidx[idx]] = %d, TOIcounters[idx] = %d", ATcounters[mTOIidx[idx]], TOIcounters[idx]); - - while (ATcounters[mTOIidx[idx]] > mATCounters[emswtId]) { - mATCounters[emswtId]++; - swtcounterAT_tmp(BIT(emswtId)); - } - - while (TOIcounters[idx] > mTOICounters[emswtId]) { - mTOICounters[emswtId]++; // always incremented by 1 in zorro!! - swtcounterTOI_tmp(BIT(emswtId)); - } - // LOGF(info, "collision.globalIndex() = %d, bc.globalBC() = %llu, mTOICounters[%d] = %d, mATcounters[%d] = %d", collision.globalIndex(), bc.globalBC(), emswtId, mTOICounters[emswtId], emswtId, mATCounters[emswtId]); - } - } // end of TOI loop + // auto swt_bitset = zorro.getLastResult(); // this has to be called after zorro::isSelected, or simply call zorro.fetch + // auto TOIcounters = zorro.getTOIcounters(); // this has to be called after zorro::isSelected, or simply call zorro.fetch + // auto ATcounters = zorro.getATcounters(); // this has to be called after zorro::isSelected, or simply call zorro.fetch + trigger_bitmap = 1; + + // // LOGF(info, "swt_bitset.to_string().c_str() = %s", swt_bitset.to_string().c_str()); + // for (size_t idx = 0; idx < mTOIidx.size(); idx++) { + // if (swt_bitset.test(mTOIidx[idx])) { + // auto swtname = swt_names[idx]; + // int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname); + // trigger_bitmap |= BIT(emswtId); + // // LOGF(info, "swtname = %s is fired. swt index in original swt table = %d, swt index for EM table = %d", swtname.data(), mTOIidx[idx], o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname)); + // registry.fill(HIST("hCollisionCounter"), idx + 2); // fired trigger + + // // LOGF(info, "ATcounters[mTOIidx[idx]] = %d, TOIcounters[idx] = %d", ATcounters[mTOIidx[idx]], TOIcounters[idx]); + + // while (ATcounters[mTOIidx[idx]] > mATCounters[emswtId]) { + // mATCounters[emswtId]++; + // swtcounterAT_tmp(BIT(emswtId)); + // } + + // while (TOIcounters[idx] > mTOICounters[emswtId]) { + // mTOICounters[emswtId]++; // always incremented by 1 in zorro!! + // swtcounterTOI_tmp(BIT(emswtId)); + // } + // // LOGF(info, "collision.globalIndex() = %d, bc.globalBC() = %llu, mTOICounters[%d] = %d, mATcounters[%d] = %d", collision.globalIndex(), bc.globalBC(), emswtId, mTOICounters[emswtId], emswtId, mATCounters[emswtId]); + // } + // } // end of TOI loop } } swtbit_tmp(trigger_bitmap); diff --git a/PWGEM/Dilepton/Tasks/CMakeLists.txt b/PWGEM/Dilepton/Tasks/CMakeLists.txt index 3c27a9a6797..6ed13cb96b9 100644 --- a/PWGEM/Dilepton/Tasks/CMakeLists.txt +++ b/PWGEM/Dilepton/Tasks/CMakeLists.txt @@ -52,7 +52,7 @@ o2physics_add_dpl_workflow(event-qc o2physics_add_dpl_workflow(single-electron-qc SOURCES singleElectronQC.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(single-electron-qc-mc @@ -62,7 +62,7 @@ o2physics_add_dpl_workflow(single-electron-qc-mc o2physics_add_dpl_workflow(single-muon-qc SOURCES singleMuonQC.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMDileptonCore + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMDileptonCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(single-muon-qc-mc @@ -72,7 +72,7 @@ o2physics_add_dpl_workflow(single-muon-qc-mc o2physics_add_dpl_workflow(dielectron SOURCES dielectron.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(dielectron-mc @@ -82,7 +82,7 @@ o2physics_add_dpl_workflow(dielectron-mc o2physics_add_dpl_workflow(dimuon SOURCES dimuon.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMDileptonCore + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::PWGEMDileptonCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(dimuon-mc @@ -117,12 +117,12 @@ o2physics_add_dpl_workflow(tagging-hfe o2physics_add_dpl_workflow(dielectron-hadron-mpc SOURCES dielectronHadronMPC.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(dimuon-hadron-mpc SOURCES dimuonHadronMPC.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(mc-particle-predictions-otf diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index 28051e2df08..2b8d6a12321 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -73,7 +73,8 @@ struct prefilterDielectron { EMEventCut fEMEventCut; struct : ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; + Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; @@ -248,7 +249,7 @@ struct prefilterDielectron { fEMEventCut = EMEventCut("fEMEventCut", "fEMEventCut"); fEMEventCut.SetRequireSel8(eventcuts.cfgRequireSel8); fEMEventCut.SetRequireFT0AND(eventcuts.cfgRequireFT0AND); - fEMEventCut.SetZvtxRange(-eventcuts.cfgZvtxMax, +eventcuts.cfgZvtxMax); + fEMEventCut.SetZvtxRange(eventcuts.cfgZvtxMin, +eventcuts.cfgZvtxMax); fEMEventCut.SetRequireNoTFB(eventcuts.cfgRequireNoTFB); fEMEventCut.SetRequireNoITSROFB(eventcuts.cfgRequireNoITSROFB); fEMEventCut.SetRequireNoSameBunchPileup(eventcuts.cfgRequireNoSameBunchPileup); diff --git a/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx b/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx index 5fbd30a30e2..fe6726d4d98 100644 --- a/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx +++ b/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx @@ -84,11 +84,11 @@ struct CreateEMEventPhoton { }; // CCDB options - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable dBzInput{"d_bz", -999, "bz field, -999 is automatic"}; + // Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + // Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + // Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + // Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + // Configurable dBzInput{"d_bz", -999, "bz field, -999 is automatic"}; Configurable needEMCTrigger{"needEMCTrigger", false, "flag to only save events which have kTVXinEMC trigger bit. To reduce PbPb derived data size"}; Configurable needPHSTrigger{"needPHSTrigger", false, "flag to only save events which have kTVXinPHOS trigger bit. To reduce PbPb derived data size"}; Configurable enableJJHistograms{"enableJJHistograms", false, "flag to fill JJ QA histograms for outlier rejection"}; @@ -107,8 +107,8 @@ struct CreateEMEventPhoton { } int mRunNumber; - float dBz; - Service ccdb; + // float dBz; + // Service ccdb; template void initCCDB(TBC const& bc) @@ -117,35 +117,35 @@ struct CreateEMEventPhoton { return; } - // In case override, don't proceed, please - no CCDB access required - if (dBzInput > -990) { - dBz = dBzInput; - o2::parameters::GRPMagField grpmag; - if (std::fabs(dBz) > 1e-5) { - grpmag.setL3Current(30000.f / (dBz / 5.0f)); - } - mRunNumber = bc.runNumber(); - return; - } - - auto run3GRPTimestamp = bc.timestamp(); - o2::parameters::GRPObject* grpo = 0x0; - o2::parameters::GRPMagField* grpmag = 0x0; - if (!skipGRPOquery) - grpo = ccdb->getForTimeStamp(grpPath, run3GRPTimestamp); - if (grpo) { - // Fetch magnetic field from ccdb for current collision - dBz = grpo->getNominalL3Field(); - LOG(info) << "Retrieved GRP for timestamp " << run3GRPTimestamp << " with magnetic field of " << dBz << " kZG"; - } else { - grpmag = ccdb->getForTimeStamp(grpmagPath, run3GRPTimestamp); - if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3GRPTimestamp; - } - // Fetch magnetic field from ccdb for current collision - dBz = std::lround(5.f * grpmag->getL3Current() / 30000.f); - LOG(info) << "Retrieved GRP for timestamp " << run3GRPTimestamp << " with magnetic field of " << dBz << " kZG"; - } + // // In case override, don't proceed, please - no CCDB access required + // if (dBzInput > -990) { + // dBz = dBzInput; + // o2::parameters::GRPMagField grpmag; + // if (std::fabs(dBz) > 1e-5) { + // grpmag.setL3Current(30000.f / (dBz / 5.0f)); + // } + // mRunNumber = bc.runNumber(); + // return; + // } + + // auto run3GRPTimestamp = bc.timestamp(); + // o2::parameters::GRPObject* grpo = 0x0; + // o2::parameters::GRPMagField* grpmag = 0x0; + // if (!skipGRPOquery) + // grpo = ccdb->getForTimeStamp(grpPath, run3GRPTimestamp); + // if (grpo) { + // // Fetch magnetic field from ccdb for current collision + // dBz = grpo->getNominalL3Field(); + // LOG(info) << "Retrieved GRP for timestamp " << run3GRPTimestamp << " with magnetic field of " << dBz << " kZG"; + // } else { + // grpmag = ccdb->getForTimeStamp(grpmagPath, run3GRPTimestamp); + // if (!grpmag) { + // LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3GRPTimestamp; + // } + // // Fetch magnetic field from ccdb for current collision + // dBz = std::lround(5.f * grpmag->getL3Current() / 30000.f); + // LOG(info) << "Retrieved GRP for timestamp " << run3GRPTimestamp << " with magnetic field of " << dBz << " kZG"; + // } mRunNumber = bc.runNumber(); } @@ -165,7 +165,8 @@ struct CreateEMEventPhoton { } } - auto bc = collision.template foundBC_as(); + // auto bc = collision.template foundBC_as(); + auto bc = collision.template bc_as(); // use this for Zorro initCCDB(bc); if (needEMCTrigger && !collision.alias_bit(kTVXinEMC)) {