|
24 | 24 | #include "PWGDQ/DataModel/ReducedInfoTables.h" |
25 | 25 |
|
26 | 26 | #include "Common/CCDB/EventSelectionParams.h" |
| 27 | +#include "Common/CCDB/ctpRateFetcher.h" |
27 | 28 | #include "Common/Core/RecoDecay.h" |
28 | 29 | #include "Common/Core/TableHelper.h" |
29 | 30 |
|
@@ -330,13 +331,16 @@ struct AnalysisEventSelection { |
330 | 331 | Configurable<bool> fConfigRunZorro{"cfgRunZorro", false, "Enable event selection with zorro [WARNING: under debug, do not enable!]"}; |
331 | 332 | Configurable<std::string> fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; |
332 | 333 | 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"}; |
| 334 | + Configurable<bool> fConfigFetchInteractionRate{"cfgFetchInteractionRate", false, "Fetch event-wise interaction rate from the CCDB"}; |
| 335 | + Configurable<std::string> fConfigIRSource{"cfgIRSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; |
333 | 336 |
|
334 | 337 | HistogramManager* fHistMan = nullptr; |
335 | 338 | MixingHandler* fMixHandler = nullptr; |
336 | 339 | AnalysisCompositeCut* fEventCut = nullptr; |
337 | 340 |
|
338 | 341 | Service<o2::ccdb::BasicCCDBManager> fCCDB{}; |
339 | 342 | o2::ccdb::CcdbApi fCCDBApi; |
| 343 | + ctpRateFetcher rateFetcher; |
340 | 344 |
|
341 | 345 | std::map<int64_t, bool> fSelMap; // key: reduced event global index, value: event selection decision |
342 | 346 | std::map<uint64_t, std::vector<int64_t>> fBCCollMap; // key: global BC, value: vector of reduced event global indices |
@@ -442,6 +446,10 @@ struct AnalysisEventSelection { |
442 | 446 | // Reset the fValues array and fill event observables |
443 | 447 | VarManager::ResetValues(0, VarManager::kNEventWiseVariables); |
444 | 448 | VarManager::FillEvent<TEventFillMap>(event); |
| 449 | + // Get the instantaneous IR from the CCDB |
| 450 | + if (fConfigFetchInteractionRate.value) { |
| 451 | + VarManager::fgValues[VarManager::kInteractionRate] = rateFetcher.fetch(fCCDB.service, event.timestamp(), fCurrentRun, fConfigIRSource.value, true) / 1000.; // kHz |
| 452 | + } |
445 | 453 |
|
446 | 454 | bool decision = false; |
447 | 455 | // Fill histograms in the class Event, before cuts |
@@ -3074,8 +3082,11 @@ struct AnalysisAsymmetricPairing { |
3074 | 3082 | Configurable<bool> fConfigUseAbsDCA{"cfgUseAbsDCA", false, "Use absolute DCA minimization instead of chi^2 minimization in secondary vertexing"}; |
3075 | 3083 | Configurable<bool> fConfigPropToPCA{"cfgPropToPCA", false, "Propagate tracks to secondary vertex"}; |
3076 | 3084 | Configurable<std::string> fConfigLutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; |
| 3085 | + Configurable<bool> fConfigFetchInteractionRate{"cfgFetchInteractionRate", false, "Fetch event-wise interaction rate from the CCDB"}; |
| 3086 | + Configurable<std::string> fConfigIRSource{"cfgIRSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; |
3077 | 3087 |
|
3078 | 3088 | Service<o2::ccdb::BasicCCDBManager> fCCDB{}; |
| 3089 | + ctpRateFetcher rateFetcher; |
3079 | 3090 |
|
3080 | 3091 | HistogramManager* fHistMan = nullptr; |
3081 | 3092 |
|
@@ -3415,6 +3426,10 @@ struct AnalysisAsymmetricPairing { |
3415 | 3426 | // Reset the fValues array |
3416 | 3427 | VarManager::ResetValues(0, VarManager::kNVars); |
3417 | 3428 | VarManager::FillEvent<TEventFillMap>(event, dqtablereader_helpers::varValues()); |
| 3429 | + // Get the instantaneous IR from the CCDB |
| 3430 | + if (fConfigFetchInteractionRate.value) { |
| 3431 | + VarManager::fgValues[VarManager::kInteractionRate] = rateFetcher.fetch(fCCDB.service, event.timestamp(), fCurrentRun, fConfigIRSource.value, true) / 1000.; // kHz |
| 3432 | + } |
3418 | 3433 |
|
3419 | 3434 | auto groupedLegAAssocs = legACandidateAssocs.sliceBy(preslice, event.globalIndex()); |
3420 | 3435 | if (groupedLegAAssocs.size() == 0) { |
|
0 commit comments