Skip to content

Commit c9d4710

Browse files
committed
Study: add SV prong and V0 output
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 4c1a27b commit c9d4710

6 files changed

Lines changed: 391 additions & 40 deletions

File tree

Detectors/GlobalTrackingWorkflow/study/include/GlobalTrackingStudy/TrackMCStudy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace o2::trackstudy
2020
{
2121

2222
/// create a processor spec
23-
o2::framework::DataProcessorSpec getTrackMCStudySpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool checkSV);
23+
o2::framework::DataProcessorSpec getTrackMCStudySpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool checkSV, bool useCCDBParams, bool enableCasc, bool enable3body);
2424

2525
} // namespace o2::trackstudy
2626

Detectors/GlobalTrackingWorkflow/study/include/GlobalTrackingStudy/TrackMCStudyConfig.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define O2_TRACKING_STUDY_CONFIG_H
1414
#include "CommonUtils/ConfigurableParam.h"
1515
#include "CommonUtils/ConfigurableParamHelper.h"
16+
#include <vector>
1617

1718
namespace o2::trackstudy
1819
{
@@ -33,9 +34,13 @@ struct TrackMCStudyConfig : o2::conf::ConfigurableParamHelper<TrackMCStudyConfig
3334
int nOccBinsDrift = 10; // number of bins for TPC max drift time, where we integrate the occupancies
3435
int nTBPerOccBin = 48; // number of TB per occ bin
3536
float rejectClustersResStat = 0.1;
36-
float maxTPCRefExtrap = 2; // max dX to extrapolate the track ref when extrapolating track true posions
37-
int minITSClForITSoutput = 7; // create special ITS otput only for long enough tracks
38-
int decayPDG[5] = {310, 3122, 411, 421, -1}; // decays to study, must end by -1
37+
float maxTPCRefExtrap = 2; // max dX to extrapolate the track ref when extrapolating track true posions
38+
int minITSClForITSoutput = 7; // create special ITS otput only for long enough tracks
39+
std::vector<int> decayPDG = {310, 3122, 411, 421}; // decays to study, matched on |PDG|
40+
std::vector<int> selectMCPDG = {}; // if non-empty, only MC tracks with exactly these PDG codes are collected
41+
bool checkSVertexerCuts = true; // replay the SVertexer V0 selection on the prongs of decays
42+
bool storeRecSV = true; // store all reconstructed V0s with the MC origin of their prongs
43+
float recSVSamplingFrac = 1.f; // fraction of combinatorial reconstructed V0s to store, true decays are always kept
3944
O2ParamDef(TrackMCStudyConfig, "trmcconf");
4045
};
4146
} // namespace o2::trackstudy

Detectors/GlobalTrackingWorkflow/study/include/GlobalTrackingStudy/TrackMCStudyTypes.h

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "CommonConstants/LHCConstants.h"
2020
#include "CommonDataFormat/TimeStamp.h"
2121
#include "ReconstructionDataFormats/PrimaryVertex.h"
22+
#include "ReconstructionDataFormats/V0.h"
2223
#include "SimulationDataFormat/TrackReference.h"
2324
#include <array>
2425
#include <vector>
@@ -320,5 +321,77 @@ struct MCVertex {
320321
ClassDefNV(MCVertex, 2);
321322
};
322323

324+
/// State of one prong of a MC decay with respect to the SVertexer seeds pool.
325+
/// A prong which was reconstructed but never made it into the pool can never form a V0,
326+
/// whatever the pair cuts do, so this has to be checked before interpreting SVCheck::rejV0.
327+
struct SVProngInfo {
328+
o2::dataformats::VtxTrackIndex gid; // reco track used as this prong, unset if not reconstructed
329+
int32_t poolEntry = -1; // entry in the SVertexer seeds pool, -1 if not seeded
330+
int8_t poolSide = -1; // SVertexer::POS / SVertexer::NEG
331+
int32_t vBrMin = -1; // vertex bracket of the seed
332+
int32_t vBrMax = -1;
333+
float minR = -1.f; // lowest radial point of the seed, used by the causality cut
334+
uint8_t seedRej = 0; // SVertexer::SeedRej, why the track never entered the pool
335+
int8_t nITSclu = -1;
336+
bool hasTPC = false;
337+
338+
bool isReconstructed() const { return gid.isSourceSet(); }
339+
bool isSeeded() const { return poolEntry >= 0; }
340+
341+
ClassDefNV(SVProngInfo, 1);
342+
};
343+
344+
/// Why a MC decay was or was not reconstructed as a V0 by the SVertexer.
345+
/// stage says how far the decay got, and only if it reached CutRejected is rejV0 meaningful.
346+
struct SVCheck {
347+
enum Stage : int8_t {
348+
NotChecked = -1, // SV checking disabled or decay not eligible
349+
NoProngs, // at least one prong has no reconstructed track at all
350+
NotSeeded, // a prong was reconstructed but rejected before the seeds pool, see prong seedRej
351+
SameCharge, // prongs did not end up as one positive and one negative seed
352+
NoBracketOverlap, // seeds share no primary vertex, so the pair is never even tried
353+
CutRejected, // the pair was tried and rejected, see rejV0
354+
Found // the pair passes the SVertexer selection
355+
};
356+
std::array<SVProngInfo, 2> prongs{};
357+
int foundSVID = -1; // reconstructed V0 matched to this decay by MC labels, -1 if none
358+
int8_t stage = NotChecked; // Stage
359+
uint8_t rejV0 = 0; // SVertexer::V0Rej, only if stage == CutRejected
360+
bool pairInReco = false; // the reconstruction built a V0 out of exactly the two prongs replayed
361+
bool replayConsistent = true; // false if the replay verdict differs from pairInReco
362+
363+
bool isReconstructed() const { return foundSVID >= 0; }
364+
365+
bool isFound() const { return stage == Found; }
366+
bool bothProngsReconstructed() const { return prongs[0].isReconstructed() && prongs[1].isReconstructed(); }
367+
bool bothProngsSeeded() const { return prongs[0].isSeeded() && prongs[1].isSeeded(); }
368+
369+
ClassDefNV(SVCheck, 1);
370+
};
371+
372+
/// A reconstructed V0 together with the MC origin of its prongs, to study the composition of
373+
/// the sample: which V0s are real decays and which are combinatorial.
374+
struct RecSVInfo {
375+
enum Kind : int8_t {
376+
Unknown = -1, // MC information unavailable for at least one prong
377+
TrueDecay, // both prongs are daughters of the same MC mother
378+
DifferentMothers, // prongs come from unrelated MC particles, i.e. combinatorial
379+
FakeProng // at least one prong track has a fake MC label
380+
};
381+
o2::dataformats::V0 v0;
382+
o2::dataformats::V0Index v0ID{};
383+
std::array<o2::MCCompLabel, 2> prongLbl{};
384+
std::array<int, 2> prongPDG{0, 0};
385+
int mcMotherPDG = 0; // PDG of the common mother, 0 if there is none
386+
int mcMotherEntry = -1; // entry in the decays pool of mcMotherDecID, -1 if not checked
387+
int8_t mcMotherDecID = -1; // which decay type the pool of mcMotherEntry refers to
388+
int8_t kind = Unknown; // Kind
389+
390+
bool isTrueDecay() const { return kind == TrueDecay; }
391+
bool isCheckedDecay() const { return mcMotherEntry >= 0; }
392+
393+
ClassDefNV(RecSVInfo, 1);
394+
};
395+
323396
} // namespace o2::trackstudy
324397
#endif

Detectors/GlobalTrackingWorkflow/study/src/GlobalTrackingStudyLinkDef.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
#pragma link C++ class o2::trackstudy::ITSHitInfo + ;
4444
#pragma link C++ class std::vector < o2::trackstudy::ITSHitInfo> + ;
4545

46+
#pragma link C++ class o2::trackstudy::SVProngInfo + ;
47+
#pragma link C++ class std::vector < o2::trackstudy::SVProngInfo> + ;
48+
#pragma link C++ class o2::trackstudy::SVCheck + ;
49+
#pragma link C++ class std::vector < o2::trackstudy::SVCheck> + ;
50+
#pragma link C++ class o2::trackstudy::RecSVInfo + ;
51+
#pragma link C++ class std::vector < o2::trackstudy::RecSVInfo> + ;
52+
4653
#pragma link C++ class o2::checkresid::Point + ;
4754
#pragma link C++ class std::vector < o2::checkresid::Point> + ;
4855
#pragma link C++ class o2::checkresid::Track + ;

0 commit comments

Comments
 (0)