Skip to content

Commit 9eebc16

Browse files
Cristian-MoscatelliCristian Moscatelli
andauthored
[PWGLF] Add INEL>0 event selection in PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx (#16351)
Co-authored-by: Cristian Moscatelli <cmoscate@gr3srv.ts.infn.it>
1 parent 7dbf61f commit 9eebc16

1 file changed

Lines changed: 26 additions & 8 deletions

File tree

PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
// same as Data and o2-analysis-mccollision-converter
3030

3131
#include "PWGLF/DataModel/LFSlimNucleiTables.h"
32+
#include "PWGLF/Utils/inelGt.h"
3233
//
3334
#include "PWGJE/Core/JetBkgSubUtils.h"
3435
#include "PWGJE/Core/JetUtilities.h"
@@ -57,6 +58,7 @@
5758
#include <Framework/AnalysisDataModel.h>
5859
#include <Framework/AnalysisTask.h>
5960
#include <Framework/HistogramRegistry.h>
61+
#include <Framework/O2DatabasePDGPlugin.h>
6062
#include <Framework/runDataProcessing.h>
6163
#include <MathUtils/BetheBlochAleph.h>
6264
#include <ReconstructionDataFormats/Track.h>
@@ -205,14 +207,15 @@ enum evSel {
205207
kIsGoodZvtxFT0vsPV,
206208
kIsGoodITSLayersAll,
207209
kIsEPtriggered,
210+
kINELgt0,
208211
kIsJetTriggered, // Check: evSel for event with at least one jet over pT-threshold
209212
kNevSels
210213
};
211214

212215
static const std::vector<std::string> eventSelectionTitle{"Event selections"};
213-
static const std::vector<std::string> eventSelectionLabels{"TVX", "TF border", "ITS ROF border", "Z vtx", "No same-bunch pile-up", "kIsGoodZvtxFT0vsPV", "isGoodITSLayersAll", "isEPtriggered", "IsJetTriggered"};
216+
static const std::vector<std::string> eventSelectionLabels{"TVX", "TF border", "ITS ROF border", "Z vtx", "No same-bunch pile-up", "kIsGoodZvtxFT0vsPV", "isGoodITSLayersAll", "isEPtriggered", "IsINELgt0", "IsJetTriggered"};
214217

215-
constexpr int EvSelDefault[9][1]{
218+
constexpr int EvSelDefault[10][1]{
216219
{1},
217220
{1},
218221
{1}, // Default: sel8
@@ -221,11 +224,13 @@ constexpr int EvSelDefault[9][1]{
221224
{0},
222225
{0},
223226
{0},
227+
{0}, // INEL > 0
224228
{1}}; // Triggered on jets
225229

226230
enum evGenSel : uint8_t {
227-
kGenIsJetTriggered = 1 << 0,
228-
kGenHasRecoEv = 1 << 1
231+
kGenIsINELgt0 = 1 << 0,
232+
kGenIsJetTriggered = 1 << 1,
233+
kGenHasRecoEv = 1 << 2
229234
};
230235

231236
enum triggerListName {
@@ -254,7 +259,8 @@ struct DeuteronInTriggeredEvents {
254259
Produces<o2::aod::NucleiTableMCExtension> nucleiTableMCExtension; // For MC analysis
255260
Produces<o2::aod::GenEventMCSel> GenEventMCSel; // For MC reco events
256261
Service<o2::ccdb::BasicCCDBManager> ccdb;
257-
Zorro zorro; // Definition of Zorro: helpful for skimmed data
262+
Service<o2::framework::O2DatabasePDG> pdgDB; // For INELgt0 gen MC selection
263+
Zorro zorro; // Definition of Zorro: helpful for skimmed data
258264
OutputObj<ZorroSummary> zorroSummary{"zorroSummary"};
259265

260266
Configurable<bool> cfgCompensatePIDinTracking{"cfgCompensatePIDinTracking", false, "If true, divide tpcInnerParam by the electric charge"};
@@ -280,7 +286,7 @@ struct DeuteronInTriggeredEvents {
280286
Configurable<float> cfgCutPtMaxTree{"cfgCutPtMaxTree", 15.0f, "Maximum track transverse momentum for tree saving"};
281287

282288
// Event selections
283-
Configurable<LabeledArray<int>> cfgEventSelections{"cfgEventSelections", {nuclei::EvSelDefault[0], 9, 1, nuclei::eventSelectionLabels, nuclei::eventSelectionTitle}, "Event selections"};
289+
Configurable<LabeledArray<int>> cfgEventSelections{"cfgEventSelections", {nuclei::EvSelDefault[0], 10, 1, nuclei::eventSelectionLabels, nuclei::eventSelectionTitle}, "Event selections"};
284290
Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
285291

286292
Configurable<LabeledArray<double>> cfgMomentumScalingBetheBloch{"cfgMomentumScalingBetheBloch", {nuclei::bbMomScalingDefault[0], 5, 2, nuclei::names, nuclei::chargeLabelNames}, "TPC Bethe-Bloch momentum scaling for light nuclei"};
@@ -409,6 +415,11 @@ struct DeuteronInTriggeredEvents {
409415
spectra.fill(HIST("hEventSelections"), nuclei::evSel::kIsEPtriggered + 1);
410416
}
411417

418+
if (cfgEventSelections->get(nuclei::evSel::kINELgt0) && !collision.selection_bit(aod::kINELgtZERO)) {
419+
return false;
420+
}
421+
spectra.fill(HIST("hEventSelections"), nuclei::evSel::kINELgt0 + 1);
422+
412423
auto bc = collision.template bc_as<aod::BCsWithTimestamps>();
413424
initCCDB(bc);
414425

@@ -494,6 +505,7 @@ struct DeuteronInTriggeredEvents {
494505
spectra.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsGoodZvtxFT0vsPV + 2, "isGoodZvtxFT0vsPV");
495506
spectra.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsGoodITSLayersAll + 2, "IsGoodITSLayersAll");
496507
spectra.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsEPtriggered + 2, "IsEPtriggered");
508+
spectra.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kINELgt0 + 2, "IsINELgt0");
497509
spectra.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsJetTriggered + 2, "IsJetTriggered");
498510

499511
// Distribution of z-vertex of selected events
@@ -943,8 +955,11 @@ struct DeuteronInTriggeredEvents {
943955
auto mcParticlesPerColl = particlesMC.sliceBy(perMcCollision, c.globalIndex());
944956
auto& mask = eventMask[c.globalIndex()];
945957

958+
if (o2::pwglf::isINELgt0mc(mcParticlesPerColl, pdgDB))
959+
mask |= nuclei::kGenIsINELgt0;
960+
946961
if (isMCJetTriggered(mcParticlesPerColl, particlesMC, trigger))
947-
mask |= nuclei::kIsJetTriggered;
962+
mask |= nuclei::kGenIsJetTriggered;
948963
}
949964

950965
for (const auto& collision : collisions) {
@@ -971,10 +986,13 @@ struct DeuteronInTriggeredEvents {
971986
auto& mask = eventMask[mcId];
972987
mask |= nuclei::kGenHasRecoEv;
973988

974-
GenEventMCSel(mask);
975989
fillDataInfo(collision, slicedTracks);
976990
}
977991

992+
for (const auto& c : mcCollisions) {
993+
GenEventMCSel(eventMask[c.globalIndex()]);
994+
}
995+
978996
std::vector<bool> isReconstructed(particlesMC.size(), false);
979997
for (auto& c : nuclei::candidates) {
980998
auto label = tracks.iteratorAt(c.globalIndex);

0 commit comments

Comments
 (0)