You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Detectors/TPC/calibration/include/TPCCalibration/CalculatedEdx.h
+70-30Lines changed: 70 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -20,16 +20,32 @@
20
20
// o2 includes
21
21
#include"DataFormatsTPC/TrackTPC.h"
22
22
#include"DataFormatsTPC/dEdxInfo.h"
23
+
#include"TPCBase/Mapper.h"
23
24
#include"GPUO2InterfaceRefit.h"
24
25
#include"CalibdEdxContainer.h"
26
+
#include"CorrectionMapsHelper.h"
25
27
#include"CommonUtils/TreeStreamRedirector.h"
26
28
#include"TPCCalibration/CorrectdEdxDistortions.h"
27
29
#include"TPCFastTransformPOD.h"
30
+
#include"GPUCommonRtypes.h"
28
31
#include<vector>
32
+
#include<map>
33
+
#include<unordered_map>
34
+
#include<string>
35
+
#include<utility>
29
36
30
37
namespaceo2::tpc
31
38
{
32
39
40
+
/// \brief average cluster occupancy of a track, per TPC region
41
+
structAverageOccupancy {
42
+
doubleIROC = 0.;
43
+
doubleOROC1 = 0.;
44
+
doubleOROC2 = 0.;
45
+
doubleOROC3 = 0.;
46
+
ClassDefNV(AverageOccupancy, 1);
47
+
};
48
+
33
49
/// \brief dEdx calculation class
34
50
///
35
51
/// This class is used to calculate dEdx of reconstructed tracks.
@@ -46,7 +62,7 @@ namespace o2::tpc
46
62
/// c.setMembers(tpcTrackClIdxVecInput, clusterIndex, tpcTracks); // set the member variables: TrackTPC, TPCClRefElem, o2::tpc::ClusterNativeAccess
47
63
/// c.setRefit(); // set the refit pointer to perform refitting of tracks, otherwise setPropagateTrack to true
48
64
/// start looping over the tracks
49
-
/// c.calculatedEdx(track, output, 0.015, 0.60, CorrectionFlags::TopologyPol | CorrectionFlags::dEdxResidual, ClusterFlags::ExcludeEdgeCl) // this will fill the dEdxInfo output for given track
65
+
/// c.calculatedEdx(track, output, averageOcc, 0.015, 0.60, CorrectionFlags::TopologyPol | CorrectionFlags::dEdxResidual, ClusterFlags::ExcludeEdgeCl) // this will fill the dEdxInfo output and per-region average track occupancy averageOcc for given track
50
66
51
67
enumclassCorrectionFlags : unsignedshort {
52
68
None = 0,
@@ -61,11 +77,14 @@ enum class CorrectionFlags : unsigned short {
61
77
enumclassClusterFlags : unsignedshort {
62
78
None = 0,
63
79
ExcludeSingleCl = 1 << 0, ///< flag to exclude single clusters in dEdx calculation
64
-
ExcludeSplitCl = 1 << 1, ///< flag to exclude split clusters in dEdx calculation
65
-
ExcludeEdgeCl = 1 << 2, ///< flag to exclude sector edge clusters in dEdx calculation
66
-
ExcludeSubthresholdCl = 1 << 3, ///< flag to exclude subthreshold clusters in dEdx calculation
67
-
ExcludeSectorBoundaries = 1 << 4, ///< flag to exclude sector boundary clusters in subthreshold cluster treatment
68
-
ExcludeSharedCl = 1 << 5, ///< flag to exclude clusters shared between tracks
80
+
ExcludeSplitPadCl = 1 << 1, ///< flag to exclude split pad clusters in dEdx calculation
81
+
ExcludeSplitTimeCl = 1 << 2, ///< flag to exclude split time clusters in dEdx calculation
82
+
ExcludeSplitCl = 1 << 3, ///< flag to exclude split pad or time clusters in dEdx calculation
83
+
ExcludeEdgeCl = 1 << 4, ///< flag to exclude sector edge clusters in dEdx calculation
84
+
ExcludeSubthresholdCl = 1 << 5, ///< flag to exclude subthreshold clusters in dEdx calculation
85
+
ExcludeSectorBoundaries = 1 << 6, ///< flag to exclude sector boundary clusters in subthreshold cluster treatment
86
+
ExcludeSharedCl = 1 << 7, ///< flag to exclude clusters shared between tracks in dEdx calculation
87
+
ExcludeSamePadRowCl = 1 << 8, ///< flag to exclude clusters in the same pad row in dEdx calculation
69
88
};
70
89
71
90
inline CorrectionFlags operator&(CorrectionFlags a, CorrectionFlags b) { returnstatic_cast<CorrectionFlags>(static_cast<unsignedshort>(a) & static_cast<unsignedshort>(b)); }
@@ -95,6 +114,9 @@ class CalculatedEdx
95
114
/// \param propagate propagate the tracks to extract the track parameters instead of performing a refit
/// get the truncated mean for the input track with the truncation range, charge type, region and corrections
135
169
/// the cluster charge is normalized by effective length*gain, you can turn off the normalization by setting all corrections to false
136
170
/// \param track input track
137
171
/// \param output output dEdxInfo
172
+
/// \param averageOcc output average cluster occupancy of the track, per TPC region
138
173
/// \param low lower cluster cut
139
174
/// \param high higher cluster cut
140
-
/// \param mask to apply different corrections: TopologySimple = simple analytical topology correction, TopologyPol = topology correction from polynomials, GainFull = full gain map from calibration container,
175
+
/// \param correctionMask to apply different corrections: TopologySimple = simple analytical topology correction, TopologyPol = topology correction from polynomials, GainFull = full gain map from calibration container,
141
176
/// GainResidual = residuals gain map from calibration container, dEdxResidual = residual dEdx correction
/// \return returns cluster occupancy for given cluster time; only valid (non-sentinel) when the refit method is used, since the occupancy map is only filled by setRefit()
206
+
unsignedintgetOccupancy(float clTime) const;
207
+
208
+
/// \return returns true if given row index is in a stack boundary
209
+
boolisInStackBoundaries(int stackNumber, unsignedchar rowIndex, int stackBoundaryMethod);
210
+
166
211
/// load calibration objects from CCDB
167
212
/// \param runNumberOrTimeStamp run number or time stamp
168
213
/// \param isMC set if dEdx space-charge corrections will be loaded for MC or real data
std::vector<TrackTPC>* mTracks{nullptr}; ///< vector containing the tpc tracks which will be processed
228
264
std::vector<TPCClRefElem>* mTPCTrackClIdxVecInput{nullptr}; ///< input vector with TPC tracks cluster indicies
@@ -233,18 +269,22 @@ class CalculatedEdx
233
269
std::vector<unsignedint> mTPCRefitterOccMap; ///< externally set TPC clusters occupancy map
234
270
std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mRefit{nullptr}; ///< TPC refitter used for TPC tracks refit during the reconstruction
235
271
236
-
intmMaxMissingCl{1}; ///< maximum number of missing clusters for subthreshold check
237
-
floatmMinChargeTotThreshold{50}; ///< upper limit for minimum charge tot value in subthreshold treatment, i.e for a high dEdx track adding a minimum value of 500 to track as a virtual charge doesn't make sense
238
-
floatmMinChargeMaxThreshold{50}; ///< upper limit for minimum charge max value in subthreshold treatment, i.e for a high dEdx track adding a minimum value of 500 to track as a virtual charge doesn't make sense
239
-
floatmFieldNominalGPUBz{5}; ///< magnetic field in kG, used for track propagation
240
-
boolmPropagateTrack{false}; ///< propagating the track instead of performing a refit
intmMaxMissingCl{1}; ///< maximum number of missing clusters for subthreshold check
273
+
floatmMinChargeTotThreshold{50}; ///< upper limit for minimum charge tot value in subthreshold treatment, i.e for a high dEdx track adding a minimum value of 500 to track as a virtual charge doesn't make sense
274
+
floatmMinChargeMaxThreshold{50}; ///< upper limit for minimum charge max value in subthreshold treatment, i.e for a high dEdx track adding a minimum value of 500 to track as a virtual charge doesn't make sense
275
+
floatmFieldNominalGPUBz{5}; ///< magnetic field in kG, used for track propagation
276
+
boolmPropagateTrack{false}; ///< propagating the track instead of performing a refit (faster than refit)
277
+
boolmPropagateParams{false}; ///< propagating the parameters instead of full propagation (faster than track propagation)
std::unordered_map<std::string, std::unique_ptr<o2::utils::TreeStreamRedirector>> mStreamers; ///< debug streamers, keyed by output file name so each debugRootFile gets its own tree
281
+
longmDebugTrackIndex{-1}; ///< running index of the track being processed, written to the debug trees so per-cluster rows can be grouped back into tracks
244
282
245
283
CorrectdEdxDistortions mSCdEdxCorrection; ///< for space-charge correction of dE/dx
284
+
285
+
std::array<std::vector<unsignedchar>, 4> mStackBoundaries = {{{0, 62}, {63, 96}, {97, 126}, {127, 151}}}; // for excluding stack boundaries in dEdx calculation
0 commit comments