Skip to content

Commit cf6d657

Browse files
committed
Implement Vit's comments
1 parent 07efd2c commit cf6d657

File tree

8 files changed

+56
-29
lines changed

8 files changed

+56
-29
lines changed

PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ struct HfDataCreatorCharmHadPiReduced {
292292
setLabelHistoCands(hCandidatesDPlus);
293293
setLabelHistoCands(hCandidatesDs);
294294

295-
// init RCT checker
296-
hfEvSel.initRctChecker();
295+
// init HF event selection helper
296+
hfEvSel.init(registry);
297297
}
298298

299299
/// Pion selection (D Pi <-- B0)

PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ struct HfDataCreatorCharmResoReduced {
303303
fitter.setUseAbsDCA(true);
304304
fitter.setWeightedFinalPCA(false);
305305

306-
// init RCT checker
307-
hfEvSel.initRctChecker();
306+
// init HF event selection helper
307+
hfEvSel.init(registry);
308308
}
309309

310310
/// Basic track quality selections for V0 daughters

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ struct HfCandidateCreator2Prong {
147147
registry.add("hDcaZProngs", "DCAz of 2-prong candidate daughters;#it{p}_{T} (GeV/#it{c};#it{d}_{z}) (#mum);entries", {HistType::kTH2F, {{100, 0., 20.}, {200, -500., 500.}}});
148148
registry.add("hVertexerType", "Use KF or DCAFitterN;Vertexer type;entries", {HistType::kTH1D, {{2, -0.5, 1.5}}}); // See o2::aod::hf_cand::VertexerType
149149
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
150-
hfEvSel.addHistograms(registry); // collision monitoring
151-
hfEvSel.initRctChecker();
150+
151+
// init HF event selection helper
152+
hfEvSel.init(registry);
152153

153154
massPi = MassPiPlus;
154155
massK = MassKPlus;
@@ -714,11 +715,11 @@ struct HfCandidateCreator2ProngExpressions {
714715
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
715716
for (const DeviceSpec& device : workflows.devices) {
716717
if (device.name.compare("hf-candidate-creator-2prong") == 0) {
717-
hfEvSelMc.configureFromDevice(device);
718+
// init HF event selection helper
719+
hfEvSelMc.init(device, registry);
718720
break;
719721
}
720722
}
721-
hfEvSelMc.addHistograms(registry); // particles monitoring
722723
}
723724

724725
/// Performs MC matching.

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,9 @@ struct HfCandidateCreator3Prong {
168168
registry.add("hDcaXYProngs", "DCAxy of 3-prong candidate daughters;#it{p}_{T} (GeV/#it{c};#it{d}_{xy}) (#mum);entries", {HistType::kTH2F, {{100, 0., 20.}, {200, -500., 500.}}});
169169
registry.add("hDcaZProngs", "DCAz of 3-prong candidate daughters;#it{p}_{T} (GeV/#it{c};#it{d}_{z}) (#mum);entries", {HistType::kTH2F, {{100, 0., 20.}, {200, -500., 500.}}});
170170
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
171-
hfEvSel.addHistograms(registry); // collision monitoring
172-
hfEvSel.initRctChecker();
171+
172+
// init HF event selection helper
173+
hfEvSel.init(registry);
173174

174175
massP = MassProton;
175176
massPi = MassPiPlus;
@@ -814,12 +815,11 @@ struct HfCandidateCreator3ProngExpressions {
814815
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
815816
for (const DeviceSpec& device : workflows.devices) {
816817
if (device.name.compare("hf-candidate-creator-3prong") == 0) {
817-
hfEvSelMc.configureFromDevice(device);
818+
// init HF event selection helper
819+
hfEvSelMc.init(device, registry);
818820
break;
819821
}
820822
}
821-
822-
hfEvSelMc.addHistograms(registry); // particles monitoring
823823
}
824824

825825
/// Performs MC matching.

PWGHF/TableProducer/candidateCreatorCascade.cxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ struct HfCandidateCreatorCascade {
118118
registry.add("hCovPVXX", "2-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 1.e-4}}});
119119
registry.add("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 0.2}}});
120120
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
121-
hfEvSel.addHistograms(registry); // collision monitoring
122-
hfEvSel.initRctChecker();
121+
122+
// init HF event selection helper
123+
hfEvSel.init(registry);
123124

124125
massP = MassProton;
125126
massK0s = MassK0Short;
@@ -472,11 +473,11 @@ struct HfCandidateCreatorCascadeMc {
472473
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
473474
for (const DeviceSpec& device : workflows.devices) {
474475
if (device.name.compare("hf-candidate-creator-cascade") == 0) {
475-
hfEvSelMc.configureFromDevice(device);
476+
// init HF event selection helper
477+
hfEvSelMc.init(device, registry);
476478
break;
477479
}
478480
}
479-
hfEvSelMc.addHistograms(registry); // particles monitoring
480481
}
481482

482483
template <o2::hf_centrality::CentralityEstimator centEstimator, typename CCs, typename McCollisions>

PWGHF/TableProducer/candidateCreatorDstar.cxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ struct HfCandidateCreatorDstar {
136136
}
137137

138138
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
139-
hfEvSel.addHistograms(registry); // collision monitoring
140-
hfEvSel.initRctChecker();
139+
140+
// init HF event selection helper
141+
hfEvSel.init(registry);
141142

142143
// LOG(info) << "Init Function Invoked";
143144
massPi = MassPiPlus;
@@ -535,11 +536,11 @@ struct HfCandidateCreatorDstarExpressions {
535536
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
536537
for (const DeviceSpec& device : workflows.devices) {
537538
if (device.name.compare("hf-candidate-creator-dstar") == 0) {
538-
hfEvSelMc.configureFromDevice(device);
539+
// init HF event selection helper
540+
hfEvSelMc.init(device, registry);
539541
break;
540542
}
541543
}
542-
hfEvSelMc.addHistograms(registry); // particles monitoring
543544
}
544545

545546
/// Perform MC Matching.

PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,9 @@ struct HfCandidateCreatorXic0Omegac0 {
341341
registry.add("hKFcosPaV0ToCasc", "hKFcosPaV0ToCasc", kTH1D, {{5000, 0.8f, 1.1f}});
342342
registry.add("hKFcosPaCascToOmegac", "hKFcosPaCascToOmegac", kTH1D, {{5000, 0.8f, 1.1f}});
343343
}
344-
hfEvSel.addHistograms(registry); // collision monitoring
345-
hfEvSel.initRctChecker();
344+
345+
// init HF event selection helper
346+
hfEvSel.init(registry);
346347

347348
df.setPropagateToPCA(propagateToPCA);
348349
df.setMaxR(maxR);
@@ -1880,11 +1881,11 @@ struct HfCandidateCreatorXic0Omegac0Mc {
18801881
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
18811882
for (const DeviceSpec& device : workflows.devices) {
18821883
if (device.name.compare("hf-candidate-creator-xic0-omegac0") == 0) {
1883-
hfEvSelMc.configureFromDevice(device);
1884+
// init HF event selection helper
1885+
hfEvSelMc.init(device, registry);
18841886
break;
18851887
}
18861888
}
1887-
hfEvSelMc.addHistograms(registry); // particles monitoring
18881889

18891890
hGenCharmBaryonPtRapidityTightXicToXiPi = registry.add<TH1>("hGenCharmBaryonPtRapidityTightXicToXiPi", "Generated charm baryon #it{p}_{T};#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1D, {{20, 0.0, 20.0}}}); // keep track of generated candidates pt when |y|<0.5
18901891
hGenCharmBaryonPtRapidityLooseXicToXiPi = registry.add<TH1>("hGenCharmBaryonPtRapidityLooseXicToXiPi", "Generated charm baryon #it{p}_{T};#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1D, {{20, 0.0, 20.0}}}); // keep track of generated candidates pt when |y|<0.8

PWGHF/Utils/utilsEvSelHf.h

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,22 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
200200
const o2::framework::AxisSpec th2AxisCent{th2ConfigAxisCent, "Centrality"};
201201
const o2::framework::AxisSpec th2AxisOccupancy{th2ConfigAxisOccupancy, "Occupancy"};
202202
hCollisionsCentOcc = registry.add<TH2>(NameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {th2AxisCent, th2AxisOccupancy}});
203+
}
204+
205+
/// \brief Inits the HF event selection object
206+
/// \param registry reference to the histogram registry
207+
void init(o2::framework::HistogramRegistry& registry)
208+
{
209+
// we initialise the RCT checker
210+
rctChecker.init(rctLabel.value, rctCheckZDC.value, rctTreatLimitedAcceptanceAsBad.value);
203211

204212
// we initialise the summary object
205213
if (softwareTrigger.value != "") {
206214
zorroSummary.setObject(zorro.getZorroSummary());
207215
}
208-
}
209216

210-
void initRctChecker()
211-
{
212-
rctChecker.init(rctLabel.value, rctCheckZDC.value, rctTreatLimitedAcceptanceAsBad.value);
217+
// we initialise histograms
218+
addHistograms(registry);
213219
}
214220

215221
/// \brief Applies event selection.
@@ -390,6 +396,9 @@ struct HfEventSelectionMc {
390396
setEventRejectionLabels(hParticles);
391397
}
392398

399+
/// \brief Configures the object from the reco workflow
400+
/// \param registry reference to the histogram registry
401+
/// \param device device spec to get the configs from the reco workflow
393402
void configureFromDevice(const o2::framework::DeviceSpec& device)
394403
{
395404
for (const auto& option : device.options) {
@@ -419,7 +428,21 @@ struct HfEventSelectionMc {
419428
rctTreatLimitedAcceptanceAsBad = option.defaultValue.get<bool>();
420429
}
421430
}
431+
}
432+
433+
/// \brief Inits the HF event selection object
434+
/// \param device device spec to get the configs from the reco workflow
435+
/// \param registry reference to the histogram registry
436+
void init(const o2::framework::DeviceSpec& device, o2::framework::HistogramRegistry& registry)
437+
{
438+
// we get the configuration from the reco workflow
439+
configureFromDevice(device);
440+
441+
// we initialise the RCT checker
422442
rctChecker.init(rctLabel, rctCheckZDC, rctTreatLimitedAcceptanceAsBad);
443+
444+
// we initialise histograms
445+
addHistograms(registry);
423446
}
424447

425448
/// \brief Function to apply event selections to generated MC collisions

0 commit comments

Comments
 (0)