Skip to content

Commit c35f72d

Browse files
Merge branch 'AliceO2Group:master' into master
2 parents a9caa8b + c5b7107 commit c35f72d

398 files changed

Lines changed: 50813 additions & 15499 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ALICE3/Tasks/alice3-cdeuteron.cxx

Lines changed: 84 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,13 @@ struct Alice3CDeuteron {
172172
#undef MakeHistos
173173
}
174174

175-
Preslice<aod::McParticles_000> perMcCollision = aod::mcparticle::mcCollisionId;
175+
Preslice<aod::McParticles> perMcCollision = aod::mcparticle::mcCollisionId;
176176

177-
void process(const soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels>::iterator& coll,
178-
const o2::aod::McCollisions&,
179-
const soa::Join<o2::aod::Tracks, o2::aod::McTrackLabels, o2::aod::TracksExtra, o2::aod::TracksCov,
180-
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullDe>& tracks,
181-
const aod::McParticles_000& mcParticles)
177+
SliceCache cache;
178+
template <bool usePID = true, typename collType, typename trackType, typename partType>
179+
void fillHistograms(const collType& coll, const trackType& tracks, const partType& mcParticles)
182180
{
183-
const auto particlesInCollision = mcParticles.sliceBy(perMcCollision, coll.mcCollision().globalIndex());
181+
const auto& particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, coll.mcCollision().globalIndex(), cache);
184182
for (const auto& i : particlesInCollision) {
185183
histos.get<TH1>(HIST("event/particlespdg"))->Fill(Form("%i", i.pdgCode()), 1);
186184
if (i.pdgCode() != 12345) {
@@ -208,14 +206,21 @@ struct Alice3CDeuteron {
208206
// }
209207
int ntrks = 0;
210208
for (const auto& t : tracks) {
211-
if (t.mcParticle_as<aod::McParticles_000>().pdgCode() == 1000010020) {
212-
histos.fill(HIST("event/trackspdg"), 1);
213-
} else if (t.mcParticle_as<aod::McParticles_000>().pdgCode() == -321) {
214-
histos.fill(HIST("event/trackspdg"), 2);
215-
} else if (t.mcParticle_as<aod::McParticles_000>().pdgCode() == 211) {
216-
histos.fill(HIST("event/trackspdg"), 3);
217-
} else {
218-
histos.fill(HIST("event/trackspdg"), 4);
209+
if (!t.has_mcParticle()) {
210+
continue;
211+
}
212+
switch (t.template mcParticle_as<aod::McParticles>().pdgCode()) {
213+
case 1000010020:
214+
histos.fill(HIST("event/trackspdg"), 1);
215+
break;
216+
case -321:
217+
histos.fill(HIST("event/trackspdg"), 2);
218+
break;
219+
case 211:
220+
histos.fill(HIST("event/trackspdg"), 3);
221+
break;
222+
default:
223+
histos.fill(HIST("event/trackspdg"), 4);
219224
}
220225
ntrks++;
221226
}
@@ -225,17 +230,25 @@ struct Alice3CDeuteron {
225230
std::array<float, 2> dca2{1e10f, 1e10f};
226231
std::array<float, 2> dca3{1e10f, 1e10f};
227232
for (const auto& track1 : tracks) {
233+
if (!track1.has_mcParticle()) {
234+
continue;
235+
}
228236
const auto index1 = track1.globalIndex();
229237
int ncand = 0;
230-
histos.fill(HIST("event/nsigmaDe"), track1.pt(), track1.tofNSigmaDe());
238+
if constexpr (usePID) {
239+
histos.fill(HIST("event/nsigmaDe"), track1.pt(), track1.tofNSigmaDe());
240+
}
231241
if (usePdg) {
232-
if (track1.mcParticle_as<aod::McParticles_000>().pdgCode() != 1000010020) {
242+
if (track1.template mcParticle_as<aod::McParticles>().pdgCode() != 1000010020) {
233243
continue;
234244
}
235-
} else if (abs(track1.tofNSigmaDe()) > maxNsigmaDe || track1.sign() < 0.f) {
236-
continue;
237245
}
238-
histos.fill(HIST("event/nsigmaDecut"), track1.pt(), track1.tofNSigmaDe());
246+
if constexpr (usePID) {
247+
if (abs(track1.tofNSigmaDe()) > maxNsigmaDe || track1.sign() < 0.f) {
248+
continue;
249+
}
250+
histos.fill(HIST("event/nsigmaDecut"), track1.pt(), track1.tofNSigmaDe());
251+
}
239252
if (!getTrackPar(track1).propagateParamToDCA(collPos,
240253
magField * 10.f, &dca1, 100.)) {
241254
continue;
@@ -244,25 +257,37 @@ struct Alice3CDeuteron {
244257
histos.fill(HIST("event/track1dcaz"), dca1[1]);
245258

246259
for (const auto& track2 : tracks) {
260+
if (!track2.has_mcParticle()) {
261+
continue;
262+
}
263+
247264
const auto index2 = track2.globalIndex();
248265
if (index1 == index2) {
249266
continue;
250267
}
251-
histos.fill(HIST("event/nsigmaKa"), track2.pt(), track2.tofNSigmaKa());
268+
if constexpr (usePID) {
269+
histos.fill(HIST("event/nsigmaKa"), track2.pt(), track2.tofNSigmaKa());
270+
}
252271
if (usePdg) {
253-
if (track2.mcParticle_as<aod::McParticles_000>().pdgCode() != -321) {
272+
if (track2.template mcParticle_as<aod::McParticles>().pdgCode() != -321) {
254273
continue;
255274
}
256-
} else if (abs(track2.tofNSigmaKa()) > maxNsigmaKa || track2.sign() > 0.f) {
257-
continue;
258275
}
259-
histos.fill(HIST("event/nsigmaKacut"), track2.pt(), track2.tofNSigmaKa());
276+
if constexpr (usePID) {
277+
if (abs(track2.tofNSigmaKa()) > maxNsigmaKa || track2.sign() > 0.f) {
278+
continue;
279+
}
280+
histos.fill(HIST("event/nsigmaKacut"), track2.pt(), track2.tofNSigmaKa());
281+
}
260282
if (!getTrackPar(track2).propagateParamToDCA(collPos,
261283
magField * 10.f, &dca2, 100.)) {
262284
continue;
263285
}
264286

265287
for (const auto& track3 : tracks) {
288+
if (!track3.has_mcParticle()) {
289+
continue;
290+
}
266291

267292
const auto index3 = track3.globalIndex();
268293
if (index2 == index3) {
@@ -271,15 +296,20 @@ struct Alice3CDeuteron {
271296
if (index1 == index3) {
272297
continue;
273298
}
274-
histos.fill(HIST("event/nsigmaPi"), track3.pt(), track3.tofNSigmaPi());
299+
if constexpr (usePID) {
300+
histos.fill(HIST("event/nsigmaPi"), track3.pt(), track3.tofNSigmaPi());
301+
}
275302
if (usePdg) {
276-
if (track3.mcParticle_as<aod::McParticles_000>().pdgCode() != 211) {
303+
if (track3.template mcParticle_as<aod::McParticles>().pdgCode() != 211) {
277304
continue;
278305
}
279-
} else if (abs(track3.tofNSigmaPi()) > maxNsigmaPi || track3.sign() < 0.f) {
280-
continue;
281306
}
282-
histos.fill(HIST("event/nsigmaPicut"), track3.pt(), track3.tofNSigmaPi());
307+
if constexpr (usePID) {
308+
if (abs(track3.tofNSigmaPi()) > maxNsigmaPi || track3.sign() < 0.f) {
309+
continue;
310+
}
311+
histos.fill(HIST("event/nsigmaPicut"), track3.pt(), track3.tofNSigmaPi());
312+
}
283313
bool iscut = false;
284314
if (abs(dca1[0]) < minDca || abs(dca1[1]) < minDca) {
285315
iscut = true;
@@ -318,9 +348,9 @@ struct Alice3CDeuteron {
318348
iscut = true;
319349
}
320350

321-
const auto mother1 = track1.mcParticle_as<aod::McParticles_000>().mother0_as<aod::McParticles_000>();
322-
const auto mother2 = track2.mcParticle_as<aod::McParticles_000>().mother0_as<aod::McParticles_000>();
323-
const auto mother3 = track3.mcParticle_as<aod::McParticles_000>().mother0_as<aod::McParticles_000>();
351+
const auto mother1 = track1.template mcParticle_as<aod::McParticles>().template mothers_as<aod::McParticles>()[0];
352+
const auto mother2 = track2.template mcParticle_as<aod::McParticles>().template mothers_as<aod::McParticles>()[0];
353+
const auto mother3 = track3.template mcParticle_as<aod::McParticles>().template mothers_as<aod::McParticles>()[0];
324354
bool issig = true;
325355
if (mother1 != mother2) {
326356
issig = false;
@@ -384,8 +414,8 @@ struct Alice3CDeuteron {
384414
const float vz = mother1.vz();
385415
const float rmc = sqrt((secVtx[0] - vx) * (secVtx[0] - vx) + (secVtx[1] - vy) * (secVtx[1] - vy) + (secVtx[2] - vz) * (secVtx[2] - vz));
386416
ncand++;
387-
const float radius3xy = sqrt((track3.mcParticle_as<aod::McParticles_000>().vx() - coll.mcCollision().posX()) * (track3.mcParticle_as<aod::McParticles_000>().vx() - coll.mcCollision().posX()) +
388-
(track3.mcParticle_as<aod::McParticles_000>().vy() - coll.mcCollision().posY()) * (track3.mcParticle_as<aod::McParticles_000>().vy() - coll.mcCollision().posY()));
417+
const float radius3xy = sqrt((track3.template mcParticle_as<aod::McParticles>().vx() - coll.mcCollision().posX()) * (track3.template mcParticle_as<aod::McParticles>().vx() - coll.mcCollision().posX()) +
418+
(track3.template mcParticle_as<aod::McParticles>().vy() - coll.mcCollision().posY()) * (track3.template mcParticle_as<aod::McParticles>().vy() - coll.mcCollision().posY()));
389419

390420
#define FillHistos(tag) \
391421
histos.fill(HIST(tag "/cpa"), CPA); \
@@ -442,6 +472,25 @@ struct Alice3CDeuteron {
442472
histos.fill(HIST("event/candperdeuteron"), ncand);
443473
} // End loop on deuterons
444474
}
475+
476+
void processWithPid(const soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels>::iterator& coll,
477+
const o2::aod::McCollisions&,
478+
const soa::Join<o2::aod::TracksIU, o2::aod::McTrackLabels, o2::aod::TracksExtra, o2::aod::TracksCov,
479+
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullDe>& tracks,
480+
const aod::McParticles& mcParticles)
481+
{
482+
fillHistograms<true>(coll, tracks, mcParticles);
483+
}
484+
PROCESS_SWITCH(Alice3CDeuteron, processWithPid, "With detector PID info", true);
485+
486+
void processNoPid(const soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels>::iterator& coll,
487+
const o2::aod::McCollisions&,
488+
const soa::Join<o2::aod::TracksIU, o2::aod::McTrackLabels, o2::aod::TracksExtra, o2::aod::TracksCovIU>& tracks,
489+
const aod::McParticles& mcParticles)
490+
{
491+
fillHistograms<false>(coll, tracks, mcParticles);
492+
}
493+
PROCESS_SWITCH(Alice3CDeuteron, processNoPid, "With detector PID info", false);
445494
};
446495

447496
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

Common/CCDB/EventSelectionParams.cxx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const char* selectionLabels[kNsel] = {
4444
"kNoV0C012vsTklBG",
4545
"kNoInconsistentVtx",
4646
"kNoPileupInMultBins",
47-
"kNoPilupMV",
47+
"kNoPileupMV",
4848
"kNoPileupTPC",
4949
"kIsTriggerTVX",
5050
"kIsINT1",
@@ -54,7 +54,14 @@ const char* selectionLabels[kNsel] = {
5454
"kIsGoodZvtxFT0vsPV",
5555
"kIsVertexITSTPC",
5656
"kIsVertexTOFmatched",
57-
"kIsVertexTRDmatched"};
57+
"kIsVertexTRDmatched",
58+
"kNoHighOccupancyAgressive",
59+
"kNoHighOccupancyStrict",
60+
"kNoHighOccupancyMedium",
61+
"kNoHighOccupancyRelaxed",
62+
"kNoHighOccupancyGentle",
63+
"kNoCollInTimeRangeStandard",
64+
"kNoCollInTimeRangeNarrow"};
5865
} // namespace o2::aod::evsel
5966

6067
using namespace o2::aod::evsel;

Common/CCDB/EventSelectionParams.h

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -19,48 +19,55 @@ namespace o2::aod::evsel
1919
{
2020
// Event selection criteria
2121
enum EventSelectionFlags {
22-
kIsBBV0A = 0, // cell-averaged time in V0A in beam-beam window
23-
kIsBBV0C, // cell-averaged time in V0C in beam-beam window (for Run 2 only)
24-
kIsBBFDA, // cell-averaged time in FDA (or AD in Run2) in beam-beam window
25-
kIsBBFDC, // cell-averaged time in FDC (or AD in Run2) in beam-beam window
26-
kIsBBT0A, // cell-averaged time in T0A in beam-beam window
27-
kIsBBT0C, // cell-averaged time in T0C in beam-beam window
28-
kNoBGV0A, // cell-averaged time in V0A in beam-gas window
29-
kNoBGV0C, // cell-averaged time in V0C in beam-gas window (for Run 2 only)
30-
kNoBGFDA, // cell-averaged time in FDA (AD in Run2) in beam-gas window
31-
kNoBGFDC, // cell-averaged time in FDC (AD in Run2) in beam-gas window
32-
kNoBGT0A, // cell-averaged time in T0A in beam-gas window
33-
kNoBGT0C, // cell-averaged time in T0C in beam-gas window
34-
kIsBBZNA, // time in common ZNA channel in beam-beam window
35-
kIsBBZNC, // time in common ZNC channel in beam-beam window
36-
kIsBBZAC, // time in ZNA and ZNC in beam-beam window - circular cut in ZNA-ZNC plane
37-
kNoBGZNA, // time in common ZNA channel is outside of beam-gas window
38-
kNoBGZNC, // time in common ZNC channel is outside of beam-gas window
39-
kNoV0MOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline VOM correlation
40-
kNoSPDOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline SPD correlation
41-
kNoV0Casymmetry, // no beam-gas according to correlation of V0C multiplicities in V0C3 and V0C012
42-
kIsGoodTimeRange, // good time range
43-
kNoIncompleteDAQ, // complete event according to DAQ flags
44-
kNoTPCLaserWarmUp, // no TPC laser warm-up event (used in Run 1)
45-
kNoTPCHVdip, // no TPC HV dip
46-
kNoPileupFromSPD, // no pileup according to SPD vertexer
47-
kNoV0PFPileup, // no out-of-bunch pileup according to V0 past-future info
48-
kNoSPDClsVsTklBG, // no beam-gas according to cluster-vs-tracklet correlation
49-
kNoV0C012vsTklBG, // no beam-gas according to V0C012-vs-tracklet correlation
50-
kNoInconsistentVtx, // no inconsistency in SPD and Track vertices
51-
kNoPileupInMultBins, // no pileup according to multiplicity-differential pileup checks
52-
kNoPileupMV, // no pileup according to multi-vertexer
53-
kNoPileupTPC, // no pileup in TPC
54-
kIsTriggerTVX, // FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level
55-
kIsINT1, // SPDGFO >= 1 || V0A || V0C
56-
kNoITSROFrameBorder, // bunch crossing is far from ITS RO Frame border
57-
kNoTimeFrameBorder, // bunch crossing is far from Time Frame borders
58-
kNoSameBunchPileup, // reject collisions in case of pileup with another collision in the same foundBC
59-
kIsGoodZvtxFT0vsPV, // small difference between z-vertex from PV and from FT0
60-
kIsVertexITSTPC, // at least one ITS-TPC track (reject vertices built from ITS-only tracks)
61-
kIsVertexTOFmatched, // at least one of vertex contributors is matched to TOF
62-
kIsVertexTRDmatched, // at least one of vertex contributors is matched to TRD
63-
kNsel // counter
22+
kIsBBV0A = 0, // cell-averaged time in V0A in beam-beam window
23+
kIsBBV0C, // cell-averaged time in V0C in beam-beam window (for Run 2 only)
24+
kIsBBFDA, // cell-averaged time in FDA (or AD in Run2) in beam-beam window
25+
kIsBBFDC, // cell-averaged time in FDC (or AD in Run2) in beam-beam window
26+
kIsBBT0A, // cell-averaged time in T0A in beam-beam window
27+
kIsBBT0C, // cell-averaged time in T0C in beam-beam window
28+
kNoBGV0A, // cell-averaged time in V0A in beam-gas window
29+
kNoBGV0C, // cell-averaged time in V0C in beam-gas window (for Run 2 only)
30+
kNoBGFDA, // cell-averaged time in FDA (AD in Run2) in beam-gas window
31+
kNoBGFDC, // cell-averaged time in FDC (AD in Run2) in beam-gas window
32+
kNoBGT0A, // cell-averaged time in T0A in beam-gas window
33+
kNoBGT0C, // cell-averaged time in T0C in beam-gas window
34+
kIsBBZNA, // time in common ZNA channel in beam-beam window
35+
kIsBBZNC, // time in common ZNC channel in beam-beam window
36+
kIsBBZAC, // time in ZNA and ZNC in beam-beam window - circular cut in ZNA-ZNC plane
37+
kNoBGZNA, // time in common ZNA channel is outside of beam-gas window
38+
kNoBGZNC, // time in common ZNC channel is outside of beam-gas window
39+
kNoV0MOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline VOM correlation
40+
kNoSPDOnVsOfPileup, // no out-of-bunch pileup according to online-vs-offline SPD correlation
41+
kNoV0Casymmetry, // no beam-gas according to correlation of V0C multiplicities in V0C3 and V0C012
42+
kIsGoodTimeRange, // good time range
43+
kNoIncompleteDAQ, // complete event according to DAQ flags
44+
kNoTPCLaserWarmUp, // no TPC laser warm-up event (used in Run 1)
45+
kNoTPCHVdip, // no TPC HV dip
46+
kNoPileupFromSPD, // no pileup according to SPD vertexer
47+
kNoV0PFPileup, // no out-of-bunch pileup according to V0 past-future info
48+
kNoSPDClsVsTklBG, // no beam-gas according to cluster-vs-tracklet correlation
49+
kNoV0C012vsTklBG, // no beam-gas according to V0C012-vs-tracklet correlation
50+
kNoInconsistentVtx, // no inconsistency in SPD and Track vertices
51+
kNoPileupInMultBins, // no pileup according to multiplicity-differential pileup checks
52+
kNoPileupMV, // no pileup according to multi-vertexer
53+
kNoPileupTPC, // no pileup in TPC
54+
kIsTriggerTVX, // FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level
55+
kIsINT1, // SPDGFO >= 1 || V0A || V0C
56+
kNoITSROFrameBorder, // bunch crossing is far from ITS RO Frame border
57+
kNoTimeFrameBorder, // bunch crossing is far from Time Frame borders
58+
kNoSameBunchPileup, // reject collisions in case of pileup with another collision in the same foundBC
59+
kIsGoodZvtxFT0vsPV, // small difference between z-vertex from PV and from FT0
60+
kIsVertexITSTPC, // at least one ITS-TPC track (reject vertices built from ITS-only tracks)
61+
kIsVertexTOFmatched, // at least one of vertex contributors is matched to TOF
62+
kIsVertexTRDmatched, // at least one of vertex contributors is matched to TRD
63+
kNoHighOccupancyAgressive, // no occupancy according to the agressive cuts
64+
kNoHighOccupancyStrict, // no occupancy according to the strict cuts
65+
kNoHighOccupancyMedium, // no occupancy according to the medium cuts
66+
kNoHighOccupancyRelaxed, // no occupancy according to the relaxed cuts
67+
kNoHighOccupancyGentle, // no occupancy according to the gentle cuts
68+
kNoCollInTimeRangeStandard, // no collisions in specified time range
69+
kNoCollInTimeRangeNarrow, // no collisions in specified time range (narrower than Standard)
70+
kNsel // counter
6471
};
6572

6673
extern const char* selectionLabels[kNsel];
@@ -147,7 +154,7 @@ class EventSelectionParams
147154
int fITSROFrameStartBorderMargin = 10; // number of bcs to cut in the beginning of ITS readout frame
148155
int fITSROFrameEndBorderMargin = 20; // number of bcs to cut in the end of ITS readout frame
149156

150-
ClassDefNV(EventSelectionParams, 5)
157+
ClassDefNV(EventSelectionParams, 6)
151158
};
152159

153160
#endif // COMMON_CCDB_EVENTSELECTIONPARAMS_H_

Common/Core/CMakeLists.txt

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,25 @@
1010
# or submit itself to any jurisdiction.
1111

1212
o2physics_add_library(AnalysisCore
13-
SOURCES TrackSelection.cxx
14-
OrbitRange.cxx
15-
PID/ParamBase.cxx
16-
CollisionAssociation.cxx
17-
TrackSelectionDefaults.cxx
18-
EventPlaneHelper.cxx
19-
TableHelper.cxx
20-
PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsParameters ROOT::EG O2::CCDB ROOT::Physics O2::FT0Base O2::FV0Base)
13+
SOURCES TrackSelection.cxx
14+
OrbitRange.cxx
15+
PID/ParamBase.cxx
16+
CollisionAssociation.cxx
17+
TrackSelectionDefaults.cxx
18+
EventPlaneHelper.cxx
19+
TableHelper.cxx
20+
MetadataHelper.cxx
21+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsParameters ROOT::EG O2::CCDB ROOT::Physics O2::FT0Base O2::FV0Base)
2122

2223
o2physics_target_root_dictionary(AnalysisCore
23-
HEADERS TrackSelection.h
24-
TrackSelectionDefaults.h
25-
OrbitRange.h
26-
TableHelper.h
27-
EventPlaneHelper.h
28-
PID/ParamBase.h
29-
PID/DetectorResponse.h
30-
PID/PIDTOF.h
31-
PID/TPCPIDResponse.h
32-
LINKDEF AnalysisCoreLinkDef.h)
24+
HEADERS TrackSelection.h
25+
TrackSelectionDefaults.h
26+
OrbitRange.h
27+
TableHelper.h
28+
MetadataHelper.h
29+
EventPlaneHelper.h
30+
PID/ParamBase.h
31+
PID/DetectorResponse.h
32+
PID/PIDTOF.h
33+
PID/TPCPIDResponse.h
34+
LINKDEF AnalysisCoreLinkDef.h)

0 commit comments

Comments
 (0)