Skip to content

Commit 0666f25

Browse files
author
Cristian Moscatelli
committed
Add INELgt0 ev-sel
1 parent a976d7f commit 0666f25

1 file changed

Lines changed: 26 additions & 7 deletions

File tree

PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx

Lines changed: 26 additions & 7 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"
@@ -62,6 +63,7 @@
6263
#include <ReconstructionDataFormats/Track.h>
6364

6465
#include <Math/Vector4D.h>
66+
#include <TDatabasePDG.h>
6567
#include <TMCProcess.h>
6668
#include <TPDGCode.h> // for PDG codes
6769
#include <TRandom3.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 {
@@ -280,7 +285,7 @@ struct DeuteronInTriggeredEvents {
280285
Configurable<float> cfgCutPtMaxTree{"cfgCutPtMaxTree", 15.0f, "Maximum track transverse momentum for tree saving"};
281286

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

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

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

@@ -494,6 +504,7 @@ struct DeuteronInTriggeredEvents {
494504
spectra.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsGoodZvtxFT0vsPV + 2, "isGoodZvtxFT0vsPV");
495505
spectra.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsGoodITSLayersAll + 2, "IsGoodITSLayersAll");
496506
spectra.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsEPtriggered + 2, "IsEPtriggered");
507+
spectra.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kINELgt0 + 2, "IsINELgt0");
497508
spectra.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsJetTriggered + 2, "IsJetTriggered");
498509

499510
// Distribution of z-vertex of selected events
@@ -933,6 +944,8 @@ struct DeuteronInTriggeredEvents {
933944
std::vector<bool> goodCollisions(mcCollisions.size(), false);
934945
std::vector<uint8_t> eventMask(mcCollisions.size(), 0);
935946

947+
auto* pdgDB = TDatabasePDG::Instance();
948+
936949
// Jet trigger condition
937950
auto trigger = static_cast<nuclei::triggerListName>(cfgTriggerList.value);
938951

@@ -943,8 +956,11 @@ struct DeuteronInTriggeredEvents {
943956
auto mcParticlesPerColl = particlesMC.sliceBy(perMcCollision, c.globalIndex());
944957
auto& mask = eventMask[c.globalIndex()];
945958

959+
if (o2::pwglf::isINELgt0mc(mcParticlesPerColl, pdgDB))
960+
mask |= nuclei::kGenIsINELgt0;
961+
946962
if (isMCJetTriggered(mcParticlesPerColl, particlesMC, trigger))
947-
mask |= nuclei::kIsJetTriggered;
963+
mask |= nuclei::kGenIsJetTriggered;
948964
}
949965

950966
for (const auto& collision : collisions) {
@@ -971,10 +987,13 @@ struct DeuteronInTriggeredEvents {
971987
auto& mask = eventMask[mcId];
972988
mask |= nuclei::kGenHasRecoEv;
973989

974-
GenEventMCSel(mask);
975990
fillDataInfo(collision, slicedTracks);
976991
}
977992

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

0 commit comments

Comments
 (0)