Skip to content

Commit b6583da

Browse files
committed
V0: add to mctrack study
Signed-off-by: Felix Schlepper <[email protected]>
1 parent 8ffe167 commit b6583da

File tree

6 files changed

+215
-83
lines changed

6 files changed

+215
-83
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct TrackMCStudyConfig : o2::conf::ConfigurableParamHelper<TrackMCStudyConfig
2222
float minPtMC = 0.05;
2323
float maxTglMC = 1.5;
2424
float maxRMC = 33.;
25+
float minRMC = 0.;
2526
float maxPosTglMC = 2.;
2627
float maxPVZOffset = 15.;
2728
float decayMotherMaxT = 1.0f; // max TOF in ns for mother particles to study
@@ -31,6 +32,7 @@ struct TrackMCStudyConfig : o2::conf::ConfigurableParamHelper<TrackMCStudyConfig
3132
float rejectClustersResStat = 0.;
3233
float maxTPCRefExtrap = 2; // max dX to extrapolate the track ref when extrapolating track true posions
3334
int decayPDG[5] = {310, 3122, 411, 421, -1}; // decays to study, must end by -1
35+
std::string mcParticleFilter; // only accept these mc particle (comma separated), leave empty to accetable all species
3436
O2ParamDef(TrackMCStudyConfig, "trmcconf");
3537
};
3638
} // namespace o2::trackstudy

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

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,30 @@
2121
#include "ReconstructionDataFormats/PrimaryVertex.h"
2222
#include <array>
2323
#include <vector>
24+
#include <bit>
25+
#include <format>
2426

2527
namespace o2::trackstudy
2628
{
27-
struct MCTrackInfo {
2829

29-
inline float getMCTimeMUS() const { return bcInTF * o2::constants::lhc::LHCBunchSpacingMUS; }
30-
inline bool hasITSHitOnLr(int i) const { return (pattITSCl & ((0x1 << i) & 0x7f)) != 0; }
30+
struct ITSTrackInfo {
31+
inline bool hasITSHitOnLr(int i) const { return (pattClITS & ((0x1 << i) & 0x7f)) != 0; }
3132
int getNITSClusCont() const;
3233
int getNITSClusForAB() const;
3334
int getLowestITSLayer() const;
3435
int getHighestITSLayer() const;
36+
int getNITSClusTrackable() const noexcept { return std::popcount(pattClITS); }
37+
38+
std::string getPattString() const { return std::format("{:07b}", pattClITS); }
39+
40+
uint8_t nClITS = 0;
41+
uint8_t pattClITS = 0;
42+
43+
ClassDefNV(ITSTrackInfo, 1);
44+
};
45+
46+
struct MCTrackInfo : public ITSTrackInfo {
47+
inline float getMCTimeMUS() const { return bcInTF * o2::constants::lhc::LHCBunchSpacingMUS; }
3548

3649
o2::track::TrackPar track{};
3750
o2::MCCompLabel label{};
@@ -41,21 +54,20 @@ struct MCTrackInfo {
4154
int pdg = 0;
4255
int pdgParent = 0;
4356
int parentEntry = -1;
44-
int16_t nTPCCl = 0;
45-
int16_t nTPCClShared = 0;
57+
uint16_t nTPCCl = 0;
58+
uint16_t nTPCClShared = 0;
4659
int8_t parentDecID = -1;
47-
uint8_t minTPCRow = -1;
48-
uint8_t maxTPCRow = 0;
60+
int8_t minTPCRow = -1;
61+
int8_t maxTPCRow = 0;
4962
uint8_t nUsedPadRows = 0;
5063
uint8_t maxTPCRowInner = 0; // highest row in the sector containing the lowest one
51-
uint8_t minTPCRowSect = -1;
52-
uint8_t maxTPCRowSect = -1;
53-
int8_t nITSCl = 0;
54-
int8_t pattITSCl = 0;
55-
ClassDefNV(MCTrackInfo, 4);
64+
int8_t minTPCRowSect = -1;
65+
int8_t maxTPCRowSect = -1;
66+
uint8_t nITSClInv = 0;
67+
ClassDefNV(MCTrackInfo, 5);
5668
};
5769

58-
struct RecTrack {
70+
struct RecTrack : public ITSTrackInfo {
5971
enum FakeFlag {
6072
FakeITS = 0x1 << 0,
6173
FakeTPC = 0x1 << 1,
@@ -71,19 +83,23 @@ struct RecTrack {
7183
o2::MCEventLabel pvLabel{};
7284
short pvID = -1;
7385
uint8_t flags = 0;
74-
uint8_t nClITS = 0;
7586
uint8_t nClTPC = 0;
76-
uint8_t pattITS = 0;
7787
int8_t lowestPadRow = -1;
88+
o2::dataformats::PrimaryVertex pv;
89+
o2::track::TrackParCov pvtrack{};
7890

91+
bool isFake() const { return flags != 0; }
7992
bool isFakeGLO() const { return flags & FakeGLO; }
8093
bool isFakeITS() const { return flags & FakeITS; }
8194
bool isFakeTPC() const { return flags & FakeTPC; }
8295
bool isFakeTRD() const { return flags & FakeTRD; }
8396
bool isFakeTOF() const { return flags & FakeTOF; }
8497
bool isFakeITSTPC() const { return flags & FakeITSTPC; }
98+
bool isFakeITSTPCTRD() const { return flags & FakeITSTPCTRD; }
99+
100+
float getTrack2Beam() const { return (pvID >= 0) ? pvtrack.getX() * pvtrack.getTgl() - pvtrack.getZ() + pv.getZ() : -9999.f; };
85101

86-
ClassDefNV(RecTrack, 1);
102+
ClassDefNV(RecTrack, 3);
87103
};
88104

89105
struct TrackPairInfo {

Detectors/GlobalTrackingWorkflow/study/src/GlobalTrackingStudyLinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#pragma link C++ class std::vector < o2::trackstudy::RecTrack> + ;
2828
#pragma link C++ class o2::trackstudy::TrackFamily + ;
2929
#pragma link C++ class std::vector < o2::trackstudy::TrackFamily> + ;
30+
#pragma link C++ class o2::trackstudy::ITSTrackInfo + ;
3031
#pragma link C++ class o2::trackstudy::MCTrackInfo + ;
3132
#pragma link C++ class std::vector < o2::trackstudy::MCTrackInfo> + ;
3233
#pragma link C++ class o2::trackstudy::RecPV + ;

0 commit comments

Comments
 (0)