Skip to content

Commit f437729

Browse files
authored
PWFCF: pbpb-flow: fill Interaction Rate and set basic cut (#6287)
* fill interaction Rate * clang-format * add IR cut * clang format
1 parent 24bf21e commit f437729

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

PWGCF/Flow/Tasks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ o2physics_add_dpl_workflow(flow-pt-efficiency
1616

1717
o2physics_add_dpl_workflow(flow-pbpb-task
1818
SOURCES FlowPbPbTask.cxx
19-
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore
19+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::GFWCore
2020
COMPONENT_NAME Analysis)
2121

2222
o2physics_add_dpl_workflow(flow-gfw-pbpb

PWGCF/Flow/Tasks/FlowPbPbTask.cxx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "Common/DataModel/TrackSelectionTables.h"
2828
#include "Common/DataModel/Centrality.h"
2929
#include "Common/DataModel/Multiplicity.h"
30+
#include "Common/CCDB/ctpRateFetcher.h"
3031

3132
#include "GFWPowerArray.h"
3233
#include "GFW.h"
@@ -56,6 +57,8 @@ struct FlowPbPbTask {
5657
O2_DEFINE_CONFIGURABLE(cfgCutTPCclu, float, 70.0f, "minimum TPC clusters")
5758
O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations")
5859
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)")
5962
O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Use Nch for flow observables")
6063
O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples")
6164
O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeights, bool, false, "Fill and output NUA weights")
@@ -112,6 +115,12 @@ struct FlowPbPbTask {
112115
// Count the total number of enum
113116
kCount_ExtraProfile
114117
};
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;
115124

116125
using aodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::Mults>>;
117126
using aodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>>;
@@ -517,6 +526,23 @@ struct FlowPbPbTask {
517526
return true;
518527
}
519528

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+
520546
void process(aodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks)
521547
{
522548
registry.fill(HIST("hEventCount"), 0.5);
@@ -545,6 +571,12 @@ struct FlowPbPbTask {
545571
registry.fill(HIST("hCent"), collision.centFT0C());
546572
fGFW->Clear();
547573
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);
548580
loadCorrections(bc.timestamp());
549581
registry.fill(HIST("hEventCount"), 4.5);
550582

0 commit comments

Comments
 (0)