Skip to content

Commit 6a54652

Browse files
committed
Optionally extract TPC clusters MC truth resolution
1 parent 785f144 commit 6a54652

File tree

6 files changed

+262
-23
lines changed

6 files changed

+262
-23
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
#include "Framework/DataProcessorSpec.h"
1616
#include "Framework/Task.h"
1717
#include "ReconstructionDataFormats/GlobalTrackID.h"
18+
#include "TPCCalibration/CorrectionMapsLoader.h"
1819

1920
namespace o2::trackstudy
2021
{
2122

2223
/// create a processor spec
23-
o2::framework::DataProcessorSpec getTrackMCStudySpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus);
24+
o2::framework::DataProcessorSpec getTrackMCStudySpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts);
2425

2526
} // namespace o2::trackstudy
2627

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ struct TrackMCStudyConfig : o2::conf::ConfigurableParamHelper<TrackMCStudyConfig
2626
float maxPVZOffset = 15.;
2727
float decayMotherMaxT = 1.0f; // max TOF in ns for mother particles to study
2828
bool requireITSorTPCTrackRefs = true;
29+
bool requireTopBottomRefs = false;
30+
int minTPCRefsToExtractClRes = 4;
31+
float rejectClustersResStat = 0.6;
32+
float maxTPCRefExtrap = 2; // max dX to extrapolate the track ref when extrapolating track true posions
33+
float maxTRefExtrapErr = 0.005;
2934
int decayPDG[5] = {310, 3122, 411, 421, -1}; // decays to study, must end by -1
3035
O2ParamDef(TrackMCStudyConfig, "trmcconf");
3136
};

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

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ struct MCTrackInfo {
4343
int16_t nTPCClShared = 0;
4444
uint8_t minTPCRow = -1;
4545
uint8_t maxTPCRow = 0;
46+
uint8_t maxTPCRowInner = 0; // highest row in the sector containing the lowest one
47+
uint8_t minTPCRowSect = -1;
48+
uint8_t maxTPCRowSect = -1;
4649
int8_t nITSCl = 0;
4750
int8_t pattITSCl = 0;
48-
ClassDefNV(MCTrackInfo, 1);
51+
ClassDefNV(MCTrackInfo, 2);
4952
};
5053

5154
struct RecTrack {
@@ -109,6 +112,70 @@ struct TrackFamily { // set of tracks related to the same MC label
109112
ClassDefNV(TrackFamily, 1);
110113
};
111114

115+
struct ClResTPC {
116+
uint8_t sect = 0;
117+
uint8_t row = 0;
118+
uint8_t ncont = 0;
119+
uint8_t flags = 0;
120+
float snp = 0;
121+
float tgl = 0;
122+
float qmax = 0;
123+
float qtot = 0;
124+
float occ = 0;
125+
std::array<float, 3> clPos{};
126+
std::array<float, 3> below{};
127+
std::array<float, 3> above{};
128+
129+
int getNExt() const { return below[0] > 1. + above[0] > 1.; }
130+
131+
float getDY() const { return clPos[1] - getYRef(); }
132+
float getDZ() const { return clPos[2] - getZRef(); }
133+
134+
float getYRef() const
135+
{
136+
float y = 0;
137+
int n = 0;
138+
if (below[0] > 1.) {
139+
y += below[1];
140+
n++;
141+
}
142+
if (above[0] > 1.) {
143+
y += above[1];
144+
n++;
145+
}
146+
return n == 1 ? y : 0.5 * y;
147+
}
148+
149+
float getZRef() const
150+
{
151+
float z = 0;
152+
int n = 0;
153+
if (below[0] > 1.) {
154+
z += below[2];
155+
n++;
156+
}
157+
if (above[0] > 1.) {
158+
z += above[2];
159+
n++;
160+
}
161+
return n == 1 ? z : 0.5 * z;
162+
}
163+
164+
float getDXMin() const
165+
{
166+
float adxA = 1e9, adxB = 1e9;
167+
if (above[0] > 1.) {
168+
adxA = clPos[0] - above[0];
169+
}
170+
if (below[0] > 1.) {
171+
adxB = clPos[0] - below[0];
172+
}
173+
return std::abs(adxA) < std::abs(adxB) ? adxA : adxB;
174+
}
175+
176+
ClassDefNV(ClResTPC, 1);
177+
};
178+
112179
struct RecPV {
113180
o2::dataformats::PrimaryVertex pv{};
114181
o2::MCEventLabel mcEvLbl{};

Detectors/GlobalTrackingWorkflow/study/src/GlobalTrackingStudyLinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@
3333
#pragma link C++ class std::vector < o2::trackstudy::RecPV> + ;
3434
#pragma link C++ class o2::trackstudy::MCVertex + ;
3535
#pragma link C++ class std::vector < o2::trackstudy::MCVertex> + ;
36+
#pragma link C++ class o2::trackstudy::ClResTPC + ;
3637

3738
#endif

0 commit comments

Comments
 (0)