|
27 | 27 | #include "Common/DataModel/TrackSelectionTables.h" |
28 | 28 | #include "Common/DataModel/Centrality.h" |
29 | 29 | #include "Common/DataModel/Multiplicity.h" |
| 30 | +#include "Common/CCDB/ctpRateFetcher.h" |
30 | 31 |
|
31 | 32 | #include "GFWPowerArray.h" |
32 | 33 | #include "GFW.h" |
@@ -56,6 +57,8 @@ struct FlowPbPbTask { |
56 | 57 | O2_DEFINE_CONFIGURABLE(cfgCutTPCclu, float, 70.0f, "minimum TPC clusters") |
57 | 58 | O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations") |
58 | 59 | O2_DEFINE_CONFIGURABLE(cfgUseAdditionalTrackCut, bool, false, "Use additional track cut on phi") |
| 60 | + O2_DEFINE_CONFIGURABLE(cfgUseInteractionRateCut, bool, false, "Use events with low interaction rate") |
| 61 | + O2_DEFINE_CONFIGURABLE(cfgCutIR, float, 50.0, "maximum interaction rate (kHz)") |
59 | 62 | O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Use Nch for flow observables") |
60 | 63 | O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") |
61 | 64 | O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeights, bool, false, "Fill and output NUA weights") |
@@ -112,6 +115,12 @@ struct FlowPbPbTask { |
112 | 115 | // Count the total number of enum |
113 | 116 | kCount_ExtraProfile |
114 | 117 | }; |
| 118 | + int mRunNumber{-1}; |
| 119 | + uint64_t mSOR{0}; |
| 120 | + double mMinSeconds{-1.}; |
| 121 | + std::unordered_map<int, TH2*> gHadronicRate; |
| 122 | + ctpRateFetcher mRateFetcher; |
| 123 | + TH2* gCurrentHadronicRate; |
115 | 124 |
|
116 | 125 | using aodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::Mults>>; |
117 | 126 | using aodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>>; |
@@ -517,6 +526,23 @@ struct FlowPbPbTask { |
517 | 526 | return true; |
518 | 527 | } |
519 | 528 |
|
| 529 | + void initHadronicRate(aod::BCsWithTimestamps::iterator const& bc) |
| 530 | + { |
| 531 | + if (mRunNumber == bc.runNumber()) { |
| 532 | + return; |
| 533 | + } |
| 534 | + mRunNumber = bc.runNumber(); |
| 535 | + if (gHadronicRate.find(mRunNumber) == gHadronicRate.end()) { |
| 536 | + auto runDuration = ccdb->getRunDuration(mRunNumber); |
| 537 | + mSOR = runDuration.first; |
| 538 | + mMinSeconds = std::floor(mSOR * 1.e-3); /// round tsSOR to the highest integer lower than tsSOR |
| 539 | + double maxSec = std::ceil(runDuration.second * 1.e-3); /// round tsEOR to the lowest integer higher than tsEOR |
| 540 | + const AxisSpec axisSeconds{static_cast<int>((maxSec - mMinSeconds) / 20.f), 0, maxSec - mMinSeconds, "Seconds since SOR"}; |
| 541 | + gHadronicRate[mRunNumber] = registry.add<TH2>(Form("HadronicRate/%i", mRunNumber), ";Time since SOR (s);Hadronic rate (kHz)", kTH2D, {axisSeconds, {510, 0., 51.}}).get(); |
| 542 | + } |
| 543 | + gCurrentHadronicRate = gHadronicRate[mRunNumber]; |
| 544 | + } |
| 545 | + |
520 | 546 | void process(aodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks) |
521 | 547 | { |
522 | 548 | registry.fill(HIST("hEventCount"), 0.5); |
@@ -545,6 +571,12 @@ struct FlowPbPbTask { |
545 | 571 | registry.fill(HIST("hCent"), collision.centFT0C()); |
546 | 572 | fGFW->Clear(); |
547 | 573 | auto bc = collision.bc_as<aod::BCsWithTimestamps>(); |
| 574 | + initHadronicRate(bc); |
| 575 | + double hadronicRate = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // |
| 576 | + double seconds = bc.timestamp() * 1.e-3 - mMinSeconds; |
| 577 | + if (cfgUseInteractionRateCut && hadronicRate > cfgCutIR) // cut on hadronic rate |
| 578 | + return; |
| 579 | + gCurrentHadronicRate->Fill(seconds, hadronicRate); |
548 | 580 | loadCorrections(bc.timestamp()); |
549 | 581 | registry.fill(HIST("hEventCount"), 4.5); |
550 | 582 |
|
|
0 commit comments