Skip to content

Commit 93aaf9e

Browse files
authored
[PWGHF] Add interaction rate selection to HF PID task (#11474)
1 parent 0b57491 commit 93aaf9e

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

PWGHF/Tasks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ o2physics_add_dpl_workflow(task-multiplicity-estimator-correlation
4646

4747
o2physics_add_dpl_workflow(task-pid-studies
4848
SOURCES taskPidStudies.cxx
49-
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::EventFilteringUtils
49+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::EventFilteringUtils O2Physics::AnalysisCCDB
5050
COMPONENT_NAME Analysis)
5151

5252
# o2physics_add_dpl_workflow(task-sel-optimisation

PWGHF/Tasks/taskPidStudies.cxx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "Framework/runDataProcessing.h"
2828
#include "Framework/HistogramRegistry.h"
2929

30+
#include "Common/CCDB/ctpRateFetcher.h"
3031
#include "Common/DataModel/PIDResponse.h"
3132
#include "Common/DataModel/Centrality.h"
3233
#include "Common/DataModel/Multiplicity.h"
@@ -98,11 +99,12 @@ DECLARE_SOA_COLUMN(NSigmaTpcBachKa, nSigmaTpcBachKa, float); //! nSigmaTPC of ba
9899
DECLARE_SOA_COLUMN(NSigmaTofBachKa, nSigmaTofBachKa, float); //! nSigmaTOF of bachelor with kaon hypothesis
99100

100101
// Common columns
101-
DECLARE_SOA_COLUMN(OccupancyFt0c, occupancyFt0c, float); //! Occupancy from FT0C
102-
DECLARE_SOA_COLUMN(OccupancyIts, occupancyIts, float); //! Occupancy from ITS
103-
DECLARE_SOA_COLUMN(CentralityFT0C, centralityFT0C, float); //! Centrality from FT0C
104-
DECLARE_SOA_COLUMN(CentralityFT0M, centralityFT0M, float); //! Centrality from FT0M
105-
DECLARE_SOA_COLUMN(CandFlag, candFlag, int); //! Flag for MC matching
102+
DECLARE_SOA_COLUMN(OccupancyFt0c, occupancyFt0c, float); //! Occupancy from FT0C
103+
DECLARE_SOA_COLUMN(OccupancyIts, occupancyIts, float); //! Occupancy from ITS
104+
DECLARE_SOA_COLUMN(CentralityFT0C, centralityFT0C, float); //! Centrality from FT0C
105+
DECLARE_SOA_COLUMN(CentralityFT0M, centralityFT0M, float); //! Centrality from FT0M
106+
DECLARE_SOA_COLUMN(InteractionRate, interactionRate, double); //! Centrality from FT0M
107+
DECLARE_SOA_COLUMN(CandFlag, candFlag, int); //! Flag for MC matching
106108
} // namespace pid_studies
107109

108110
DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information
@@ -132,6 +134,7 @@ DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information
132134
pid_studies::OccupancyIts,
133135
pid_studies::CentralityFT0C,
134136
pid_studies::CentralityFT0M,
137+
pid_studies::InteractionRate,
135138
pid_studies::CandFlag);
136139

137140
DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID information
@@ -152,6 +155,7 @@ DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID informat
152155
pid_studies::OccupancyIts,
153156
pid_studies::CentralityFT0C,
154157
pid_studies::CentralityFT0M,
158+
pid_studies::InteractionRate,
155159
pid_studies::CandFlag);
156160
} // namespace o2::aod
157161

@@ -172,6 +176,8 @@ struct HfTaskPidStudies {
172176
Configurable<float> massLambdaMax{"massLambdaMax", 1.3, "Maximum mass for lambda"};
173177
Configurable<float> massOmegaMin{"massOmegaMin", 1.5, "Minimum mass for omega"};
174178
Configurable<float> massOmegaMax{"massOmegaMax", 1.8, "Maximum mass for omega"};
179+
Configurable<float> interactionRateMin{"interactionRateMin", -1, "Minimum interaction rate (kHz)"};
180+
Configurable<float> interactionRateMax{"interactionRateMax", 1.e20, "Maximum interaction rate (kHz)"};
175181
Configurable<float> radiusMax{"radiusMax", 2.3, "Maximum decay radius (cm)"};
176182
Configurable<float> cosPaMin{"cosPaMin", 0.98, "Minimum cosine of pointing angle"};
177183
Configurable<float> dcaV0DaughtersMax{"dcaV0DaughtersMax", 0.2, "Maximum DCA among the V0 daughters (cm)"};
@@ -181,6 +187,7 @@ struct HfTaskPidStudies {
181187
Configurable<float> qtArmenterosMaxForLambda{"qtArmenterosMaxForLambda", 0.12, "Minimum Armenteros' qt for (anti)Lambda"};
182188
Configurable<float> downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to keep"};
183189
Configurable<float> ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"};
190+
Configurable<std::string> ctpFetcherSource{"ctpFetcherSource", "T0VTX", "Source for CTP rate fetching, e.g. T0VTX, T0CE, T0SC, ZNC (hadronic)"};
184191
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
185192

186193
using PidTracks = soa::Join<aod::Tracks, aod::TracksExtra,
@@ -191,8 +198,10 @@ struct HfTaskPidStudies {
191198
using V0sMcRec = soa::Join<aod::V0Datas, aod::V0CoreMCLabels>;
192199
using CascsMcRec = soa::Join<aod::CascDatas, aod::CascCoreMCLabels>;
193200

201+
ctpRateFetcher rateFetcher;
194202
HfEventSelection hfEvSel;
195203
HfEventSelectionMc hfEvSelMc;
204+
double interactionRate{-1.};
196205

197206
o2::framework::Service<o2::ccdb::BasicCCDBManager> ccdb;
198207
HistogramRegistry registry{"registry", {}};
@@ -259,6 +268,7 @@ struct HfTaskPidStudies {
259268
coll.trackOccupancyInTimeRange(),
260269
coll.centFT0C(),
261270
coll.centFT0M(),
271+
interactionRate,
262272
flag);
263273
} else {
264274
const auto& bachTrack = candidate.template bachelor_as<PidTracks>();
@@ -280,6 +290,7 @@ struct HfTaskPidStudies {
280290
coll.trackOccupancyInTimeRange(),
281291
coll.centFT0C(),
282292
coll.centFT0M(),
293+
interactionRate,
283294
flag);
284295
}
285296
}
@@ -328,6 +339,12 @@ struct HfTaskPidStudies {
328339
template <typename Coll>
329340
bool isCollSelected(const Coll& coll)
330341
{
342+
auto bc = coll.template bc_as<aod::BCsWithTimestamps>();
343+
interactionRate = rateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), ctpFetcherSource.value) * 1.e-3; // convert to kHz
344+
if (interactionRate < interactionRateMin || interactionRate > interactionRateMax) {
345+
return false;
346+
}
347+
331348
float cent{-1.f};
332349
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, o2::hf_centrality::CentralityEstimator::None, aod::BCsWithTimestamps>(coll, cent, ccdb, registry);
333350
/// monitor the satisfied event selections

0 commit comments

Comments
 (0)