Belle II Software development
CDCDedxTrack.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <framework/datastore/RelationsObject.h>
12#include <framework/gearbox/Const.h>
13
14#include <vector>
15
16namespace Belle2 {
26 friend class CDCDedxPIDModule;
27 friend class CDCDedxScanModule;
28 friend class CDCDedxCorrectionModule;
29
30 public:
31
35 m_track(0), m_charge(0), m_cosTheta(0), m_p(0), m_pCDC(0), m_length(0.0), m_injring(-1),
36 m_injtime(-1), m_pdg(-999), m_mcmass(0), m_motherPDG(0), m_pTrue(0), m_cosThetaTrue(0),
39 {
41
42 // set default values for all particles
43 for (unsigned int i = 0; i < Const::ChargedStable::c_SetSize; i++) {
44 m_predmean[i] = 0.0;
45 m_predres[i] = 0.0;
46 m_cdcChi[i] = -999.;
47 m_cdcLogl[i] = 0.0;
48 }
49 }
50
52 void addDedx(int nhitscombined, int wirelongesthit, int layer, double distance, double dedxValue)
53 {
54 m_lNHitsCombined.push_back(nhitscombined);
55 m_lWireLongestHit.push_back(wirelongesthit);
56 m_lLayer.push_back(layer);
57 m_lPath.push_back(distance);
58 m_lDedx.push_back(dedxValue);
59
60 m_length += distance;
61 }
62
64 void addHit(int lwire, int wire, int layer, double doca, double docaRS, double enta, double entaRS,
65 int adcCount, int adcbaseCount, double dE, double path, double dedx, double cellHeight, double cellHalfWidth,
66 int driftT, double driftD, double driftDRes, double wiregain, double twodcor,
67 double onedcor, int foundByTrackFinder, double weightPionHypo, double weightKaonHypo, double weightProtHypo)
68 {
69
70 m_hLWire.push_back(lwire);
71 m_hWire.push_back(wire);
72 m_hLayer.push_back(layer);
73 m_hPath.push_back(path);
74 m_hDedx.push_back(dedx);
75 m_hADCCount.push_back(adcCount);
76 m_hADCBaseCount.push_back(adcbaseCount);
77 m_hDoca.push_back(doca);
78 m_hDocaRS.push_back(docaRS);
79 m_hEnta.push_back(enta);
80 m_hEntaRS.push_back(entaRS);
81 m_hDriftT.push_back(driftT);
82 m_hdE.push_back(dE);
83 m_hCellHeight.push_back(cellHeight);
84 m_hCellHalfWidth.push_back(cellHalfWidth);
85 m_hDriftD.push_back(driftD);
86 m_hDriftDRes.push_back(driftDRes);
87 m_hWireGain.push_back(wiregain);
88 m_hTwodCor.push_back(twodcor);
89 m_hOnedCor.push_back(onedcor);
90 m_hFoundByTrackFinder.push_back(foundByTrackFinder);
91 m_hWeightPionHypo.push_back(weightPionHypo);
92 m_hWeightKaonHypo.push_back(weightKaonHypo);
93 m_hWeightProtHypo.push_back(weightProtHypo);
94 }
95
97 double trackID() const { return m_track; }
98
100 double getPDG() const { return m_pdg; }
101
103 double getDedx() const { return m_dedxAvgTruncated; }
104
106 double getDedxNoSat() const { return m_dedxAvgTruncatedNoSat; }
107
109 double getDedxError() const { return m_dedxAvgTruncatedErr; }
110
112 double getDedxMean() const { return m_dedxAvg; }
113
115 std::vector< double > getDedxList() const { return m_hDedx; }
116
118 double getMomentum() const { return m_pCDC; }
119
121 double getCosTheta() const { return m_cosTheta; }
122
124 int getCharge() const { return m_charge; }
125
127 double getInjectionTime() const { return m_injtime; }
128
130 double getInjectionRing() const { return m_injring; }
131
133 double getLength() const { return m_length; }
134
136 double getCosineCorrection() const { return m_cosCor; }
137
139 double getCosEdgeCorrection() const { return m_cosEdgeCor; }
140
142 double getRunGain() const { return m_runGain; }
143
145 double getScaleFactor() const { return m_scale; }
146
148 double getTimeMean() const { return m_timeGain; }
149
151 double getTimeReso() const { return m_timeReso; }
152
154 double getSimulatedDedx() const { return m_simDedx; }
155
157 void setDedx(double mean) { m_dedxAvgTruncated = mean; }
158
160 void setDedxNoSat(double mean) { m_dedxAvgTruncatedNoSat = mean; }
161
163 void setDedxError(double error) { m_dedxAvgTruncatedErr = error; }
164
166 void setDedxMean(double mean) { m_dedxAvg = mean; }
167
169 void setSimulatedDedx(double dedx) { m_simDedx = dedx; }
170
171
172 // Layer level
174 int getNLayerHits() const { return m_lDedx.size(); }
175
177 double getNLayerHitsUsed() const { return m_lNHitsUsed; }
178
180 int getNHitsCombined(int i) const { return m_lNHitsCombined[i]; }
181
183 int getWireLongestHit(int i) const { return m_lWireLongestHit[i]; }
184
186 int getLayer(int i) const { return m_lLayer[i]; }
187
189 double getLayerPath(int i) const { return m_lPath[i]; }
190
192 double getLayerDedx(int i) const { return m_lDedx[i]; }
193
195 void setLayerDedx(int i, double dedx) { m_lDedx[i] = dedx; }
196
197
198 // Hit level
200 int size() const { return m_hDedx.size(); }
201
203 int getWireInLayer(int i) const { return m_hLWire[i]; }
204
206 int getWire(int i) const { return m_hWire[i]; }
207
209 int getHitLayer(int i) const { return m_hLayer[i]; }
210
212 double getPath(int i) const { return m_hPath[i]; }
213
215 double getDedx(int i) const { return m_hDedx[i]; }
216
218 int getADCCount(int i) const { return m_hADCCount[i]; }
219
221 int getADCBaseCount(int i) const { return m_hADCBaseCount[i]; }
222
224 double getNonLADCCorrection(int i) const { return (m_hADCBaseCount[i] * 1.0) / m_hADCCount[i]; }
225
227 double getDoca(int i) const { return m_hDoca[i]; }
228
230 double getEnta(int i) const { return m_hEnta[i]; }
231
233 double getDocaRS(int i) const { return m_hDocaRS[i]; }
234
236 double getEntaRS(int i) const { return m_hEntaRS[i]; }
237
239 int getDriftT(int i) const { return m_hDriftT[i]; }
240
242 double getDE(int i) const { return m_hdE[i]; }
243
245 double getCellHeight(int i) const { return m_hCellHeight[i]; }
246
248 double getCellHalfWidth(int i) const { return m_hCellHalfWidth[i]; }
249
251 double getDriftD(int i) const { return m_hDriftD[i]; }
252
254 double getDriftDRes(int i) const { return m_hDriftDRes[i]; }
255
257 double getWireGain(int i) const { return m_hWireGain[i]; }
258
260 double getTwoDCorrection(int i) const { return m_hTwodCor[i]; }
261
263 double getOneDCorrection(int i) const { return m_hOnedCor[i]; }
264
267 int getFoundByTrackFinder(int i) const { return m_hFoundByTrackFinder[i]; }
268
270 double getWeightPionHypo(int i) const { return m_hWeightPionHypo[i]; }
271
273 double getWeightKaonHypo(int i) const { return m_hWeightKaonHypo[i]; }
274
276 double getWeightProtonHypo(int i) const { return m_hWeightProtHypo[i]; }
277
279 double getChi(int i) const { return m_cdcChi[i]; }
280
282 double getPmean(int i) const { return m_predmean[i]; }
283
285 double getPreso(int i) const { return m_predres[i]; }
286
288 void setDedx(int i, double dedx) { m_hDedx[i] = dedx; }
289
290 private:
291
292 // track level information
295 double m_cosTheta;
296 double m_p;
297 double m_pCDC;
298 double m_length;
299 double m_injring;
300 double m_injtime;
302 // dE/dx simulation
303 double m_pdg;
304 double m_mcmass;
305 double m_motherPDG;
306 double m_pTrue;
308 double m_simDedx;
310 // calibration constants
311 double m_scale;
312 double m_cosCor;
314 double m_runGain;
315 double m_timeGain;
316 double m_timeReso;
318 std::vector<double> m_hWireGain;
319 std::vector<double> m_hTwodCor;
320 std::vector<double> m_hOnedCor;
324 // track level dE/dx measurements
325 double m_dedxAvg;
333 // layer level information (just don't mix with the hit arrays)
335 std::vector<int> m_lNHitsCombined;
336 std::vector<int> m_lWireLongestHit;
337 std::vector<int> m_lLayer;
338 std::vector<double> m_lPath;
339 std::vector<double> m_lDedx;
341 // hit level information
342 std::vector<int> m_hLWire;
343 std::vector<int> m_hWire;
344 std::vector<int> m_hLayer;
345 std::vector<double> m_hPath;
346 std::vector<double> m_hDedx;
347 std::vector<int> m_hADCCount;
348 std::vector<int> m_hADCBaseCount;
349 std::vector<double> m_hDoca;
350 std::vector<double> m_hEnta;
351 std::vector<double> m_hDocaRS;
352 std::vector<double> m_hEntaRS;
353 std::vector<double> m_hdE;
354 std::vector<int> m_hDriftT;
355 std::vector<double> m_hDriftD;
356 std::vector<double> m_hDriftDRes;
357 std::vector<int> m_hFoundByTrackFinder;
358 std::vector<double> m_hWeightPionHypo;
359 std::vector<double> m_hWeightKaonHypo;
360 std::vector<double> m_hWeightProtHypo;
362 std::vector<double> m_hCellHeight;
363 std::vector<double> m_hCellHalfWidth;
366 };
368}
This module may be used to apply the corrections to dE/dx per the calibration constants.
Extract CDC dE/dx information from fitted tracks.
This class performs the same function as CDCDedxPIDModule, but does so without using real objects fro...
Debug output for CDCDedxPID module.
Definition: CDCDedxTrack.h:25
std::vector< double > m_hOnedCor
calibration 1-D correction (indexed on number of hits)
Definition: CDCDedxTrack.h:320
double m_cdcChi[Const::ChargedStable::c_SetSize]
chi values for each particle type
Definition: CDCDedxTrack.h:329
std::vector< double > m_hDocaRS
distance of closest approach to sense wire after rescalling cell L=W
Definition: CDCDedxTrack.h:351
std::vector< double > m_hDoca
distance of closest approach to sense wire
Definition: CDCDedxTrack.h:349
std::vector< int > m_lWireLongestHit
wire id for the longest hit in the layer
Definition: CDCDedxTrack.h:336
std::vector< double > m_hDedx
charge per path length (dE/dx)
Definition: CDCDedxTrack.h:346
double m_mcmass
MC PID mass.
Definition: CDCDedxTrack.h:304
std::vector< double > m_hCellHeight
height of the CDC cell
Definition: CDCDedxTrack.h:362
double getTimeMean() const
Return the injection gain for this track.
Definition: CDCDedxTrack.h:148
int getHitLayer(int i) const
Return the (global) layer number for a hit.
Definition: CDCDedxTrack.h:209
int getADCBaseCount(int i) const
Return the base adcCount (no non-linearity) for this hit.
Definition: CDCDedxTrack.h:221
double m_cosEdgeCor
calibration cosine edge correction
Definition: CDCDedxTrack.h:313
double getSimulatedDedx() const
Get the track-level MC dE/dx mean for this track.
Definition: CDCDedxTrack.h:154
int getADCCount(int i) const
Return the adcCount for this hit.
Definition: CDCDedxTrack.h:218
std::vector< double > m_hEnta
entrance angle in CDC cell
Definition: CDCDedxTrack.h:350
double m_dedxAvgTruncated
dE/dx truncated mean per track
Definition: CDCDedxTrack.h:326
void setDedx(int i, double dedx)
Set the dE/dx value for this hit.
Definition: CDCDedxTrack.h:288
double m_p
momentum at the IP
Definition: CDCDedxTrack.h:296
void setDedxError(double error)
Set the error on the dE/dx truncated mean for this track.
Definition: CDCDedxTrack.h:163
double getDriftDRes(int i) const
Return the drift distance resolution for this hit.
Definition: CDCDedxTrack.h:254
double m_dedxAvgTruncatedErr
standard deviation of m_dedxAvgTruncated
Definition: CDCDedxTrack.h:328
double getDedxMean() const
Get the dE/dx mean for this track.
Definition: CDCDedxTrack.h:112
double getDriftD(int i) const
Return the drift distance for this hit.
Definition: CDCDedxTrack.h:251
void setSimulatedDedx(double dedx)
Set the track level MC dE/dx mean for this track.
Definition: CDCDedxTrack.h:169
int getLayer(int i) const
Return the (global) layer number for a layer hit.
Definition: CDCDedxTrack.h:186
std::vector< int > m_hLayer
layer number
Definition: CDCDedxTrack.h:344
double m_dedxAvgTruncatedNoSat
dE/dx truncated mean per track without the saturation correction
Definition: CDCDedxTrack.h:327
double getDoca(int i) const
Return the distance of closest approach to the sense wire for this hit.
Definition: CDCDedxTrack.h:227
double getDedx() const
Get dE/dx truncated mean for this track.
Definition: CDCDedxTrack.h:103
double getPath(int i) const
Return the path length through the cell for this hit.
Definition: CDCDedxTrack.h:212
int getWireInLayer(int i) const
Return the sensor ID for this hit: wire number in the layer.
Definition: CDCDedxTrack.h:203
std::vector< int > m_hADCCount
adcCount per hit
Definition: CDCDedxTrack.h:347
double getPmean(int i) const
Return the PID (predicted mean) value.
Definition: CDCDedxTrack.h:282
std::vector< double > m_hWeightKaonHypo
weight for kaon hypothesis from KalmanFitterInfo
Definition: CDCDedxTrack.h:359
double getOneDCorrection(int i) const
Return the 1D correction for this hit.
Definition: CDCDedxTrack.h:263
int getWireLongestHit(int i) const
Return the wire number of the longest hit per layer.
Definition: CDCDedxTrack.h:183
CDCDedxTrack()
Default constructor.
Definition: CDCDedxTrack.h:33
double getWeightKaonHypo(int i) const
Return the max weights from KalmanFitterInfo using kaon hypothesis.
Definition: CDCDedxTrack.h:273
int m_lNHitsUsed
number of hits on this track used for truncated mean
Definition: CDCDedxTrack.h:334
double m_simDedx
track level MC dE/dx truncated mean
Definition: CDCDedxTrack.h:308
std::vector< int > m_hADCBaseCount
adcCount base count (uncorrected) per hit
Definition: CDCDedxTrack.h:348
void setDedx(double mean)
Set the dE/dx truncated average for this track.
Definition: CDCDedxTrack.h:157
double getCosineCorrection() const
Return the cosine correction for this track.
Definition: CDCDedxTrack.h:136
double getEntaRS(int i) const
Return rescaled enta value for cell height=width assumption.
Definition: CDCDedxTrack.h:236
double getLayerDedx(int i) const
Return the total dE/dx for this layer.
Definition: CDCDedxTrack.h:192
double getCellHalfWidth(int i) const
Return the half-width of the CDC cell.
Definition: CDCDedxTrack.h:248
std::vector< int > m_hLWire
wire ID within the layer
Definition: CDCDedxTrack.h:342
std::vector< int > m_hDriftT
drift time for each hit
Definition: CDCDedxTrack.h:354
std::vector< int > m_hFoundByTrackFinder
the 'found by track finder' flag for the given hit
Definition: CDCDedxTrack.h:357
double m_cosCor
calibration cosine correction
Definition: CDCDedxTrack.h:312
double getPDG() const
Get the identity of the particle.
Definition: CDCDedxTrack.h:100
std::vector< double > m_hTwodCor
calibration 2-D correction (indexed on number of hits)
Definition: CDCDedxTrack.h:319
std::vector< double > m_hWeightPionHypo
weight for pion hypothesis from KalmanFitterInfo
Definition: CDCDedxTrack.h:358
void setDedxMean(double mean)
Set the dE/dx mean for this track.
Definition: CDCDedxTrack.h:166
std::vector< double > m_hDriftD
drift distance for each hit
Definition: CDCDedxTrack.h:355
std::vector< double > m_hDriftDRes
drift distance resolution for each hit
Definition: CDCDedxTrack.h:356
std::vector< double > m_hPath
path length in the CDC cell
Definition: CDCDedxTrack.h:345
double m_predres[Const::ChargedStable::c_SetSize]
predicted dE/dx resolution
Definition: CDCDedxTrack.h:322
double getTwoDCorrection(int i) const
Return the 2D correction for this hit.
Definition: CDCDedxTrack.h:260
double m_motherPDG
MC PID of mother particle.
Definition: CDCDedxTrack.h:305
double m_runGain
calibration run gain
Definition: CDCDedxTrack.h:314
void addDedx(int nhitscombined, int wirelongesthit, int layer, double distance, double dedxValue)
add dE/dx information for a CDC layer
Definition: CDCDedxTrack.h:52
double m_timeGain
calibration injection time gain
Definition: CDCDedxTrack.h:315
std::vector< int > m_lNHitsCombined
number of hits combined in the layer
Definition: CDCDedxTrack.h:335
double getPreso(int i) const
Return the PID (predicted reso) value.
Definition: CDCDedxTrack.h:285
void addHit(int lwire, int wire, int layer, double doca, double docaRS, double enta, double entaRS, int adcCount, int adcbaseCount, double dE, double path, double dedx, double cellHeight, double cellHalfWidth, int driftT, double driftD, double driftDRes, double wiregain, double twodcor, double onedcor, int foundByTrackFinder, double weightPionHypo, double weightKaonHypo, double weightProtHypo)
Add a single hit to the object.
Definition: CDCDedxTrack.h:64
int getNLayerHits() const
Return the number of layer hits for this track.
Definition: CDCDedxTrack.h:174
int getFoundByTrackFinder(int i) const
Return the TrackFinder which added the given hit to track.
Definition: CDCDedxTrack.h:267
int getDriftT(int i) const
Return the drift time for this hit.
Definition: CDCDedxTrack.h:239
double getCosTheta() const
Return cos(theta) for this track.
Definition: CDCDedxTrack.h:121
std::vector< double > m_lPath
distance flown through active medium in current segment
Definition: CDCDedxTrack.h:338
double m_timeReso
calibration injection time gain
Definition: CDCDedxTrack.h:316
double getInjectionRing() const
Return cos(theta) for this track.
Definition: CDCDedxTrack.h:130
double m_pdg
MC PID.
Definition: CDCDedxTrack.h:303
int getCharge() const
Return the charge for this track.
Definition: CDCDedxTrack.h:124
double m_cosTheta
cos(theta) for the track
Definition: CDCDedxTrack.h:295
double getWireGain(int i) const
Return the wire gain for this hit.
Definition: CDCDedxTrack.h:257
double getWeightPionHypo(int i) const
Return the max weights from KalmanFitterInfo using pion hypothesis.
Definition: CDCDedxTrack.h:270
double getTimeReso() const
Return the injection reso for this track.
Definition: CDCDedxTrack.h:151
int getWire(int i) const
Return the sensor ID for this hit: wire number for CDC (0-14336)
Definition: CDCDedxTrack.h:206
double m_scale
scale factor to make electrons ~1
Definition: CDCDedxTrack.h:311
std::vector< double > m_hWeightProtHypo
weight for proton hypothesis from KalmanFitterInfo
Definition: CDCDedxTrack.h:360
double getDocaRS(int i) const
Return rescaled doca value for cell height=width assumption.
Definition: CDCDedxTrack.h:233
std::vector< double > m_hEntaRS
entrance angle in CDC cell after rescalling cell L=W
Definition: CDCDedxTrack.h:352
double m_pCDC
momentum at the inner layer of the CDC
Definition: CDCDedxTrack.h:297
double m_length
total distance travelled by the track
Definition: CDCDedxTrack.h:298
double m_injring
injection ring type of track's event
Definition: CDCDedxTrack.h:299
double getCosEdgeCorrection() const
Return the cosine correction for this track.
Definition: CDCDedxTrack.h:139
double m_cdcLogl[Const::ChargedStable::c_SetSize]
log likelihood for each particle, not including momentum prior
Definition: CDCDedxTrack.h:330
std::vector< double > m_hWireGain
calibration hit gain (indexed on number of hits)
Definition: CDCDedxTrack.h:318
double getRunGain() const
Return the run gain for this track.
Definition: CDCDedxTrack.h:142
std::vector< double > getDedxList() const
Return the vector of dE/dx values for this track.
Definition: CDCDedxTrack.h:115
double m_dedxAvg
dE/dx mean value per track
Definition: CDCDedxTrack.h:325
void setLayerDedx(int i, double dedx)
Set the total dE/dx for this layer.
Definition: CDCDedxTrack.h:195
double getNonLADCCorrection(int i) const
Return the factor introduce for adcCount (non-linearity) correction.
Definition: CDCDedxTrack.h:224
void setDedxNoSat(double mean)
Set the dE/dx truncated average without the saturation correction for this track.
Definition: CDCDedxTrack.h:160
int m_charge
particle charge from tracking (+1 or -1)
Definition: CDCDedxTrack.h:294
std::vector< double > m_hCellHalfWidth
half-width of the CDC cell
Definition: CDCDedxTrack.h:363
ClassDef(CDCDedxTrack, 17)
Debug output for CDCDedxPID module.
double getDedxError() const
Get the error on the dE/dx truncated mean for this track.
Definition: CDCDedxTrack.h:109
double getWeightProtonHypo(int i) const
Return the max weights from KalmanFitterInfo using proton hypothesis.
Definition: CDCDedxTrack.h:276
double getEnta(int i) const
Return the entrance angle in the CDC cell for this hit.
Definition: CDCDedxTrack.h:230
double getInjectionTime() const
Return cos(theta) for this track.
Definition: CDCDedxTrack.h:127
double m_pTrue
MC true momentum.
Definition: CDCDedxTrack.h:306
int m_track
ID number of the Track.
Definition: CDCDedxTrack.h:293
double getDedx(int i) const
Return the dE/dx value for this hit.
Definition: CDCDedxTrack.h:215
double trackID() const
Return the track ID.
Definition: CDCDedxTrack.h:97
double m_injtime
time since last injection of track's event
Definition: CDCDedxTrack.h:300
double m_predmean[Const::ChargedStable::c_SetSize]
predicted dE/dx truncated mean
Definition: CDCDedxTrack.h:321
double getLayerPath(int i) const
Return the distance travelled in this layer.
Definition: CDCDedxTrack.h:189
std::vector< int > m_hWire
continuous wire ID in the CDC
Definition: CDCDedxTrack.h:343
double getChi(int i) const
Return the PID (chi) value.
Definition: CDCDedxTrack.h:279
std::vector< double > m_hdE
charge per hit
Definition: CDCDedxTrack.h:353
std::vector< double > m_lDedx
extracted dE/dx (arb.
Definition: CDCDedxTrack.h:339
double m_cosThetaTrue
MC true cos(theta)
Definition: CDCDedxTrack.h:307
double getScaleFactor() const
Return the scale factor for this track.
Definition: CDCDedxTrack.h:145
double getLength() const
Return the total path length for this track.
Definition: CDCDedxTrack.h:133
double getCellHeight(int i) const
Return the height of the CDC cell.
Definition: CDCDedxTrack.h:245
double getDE(int i) const
Return the ionization charge collected for this hit.
Definition: CDCDedxTrack.h:242
int getNHitsCombined(int i) const
Return the number of hits combined per layer.
Definition: CDCDedxTrack.h:180
double getDedxNoSat() const
Get dE/dx truncated mean without the saturation correction for this track.
Definition: CDCDedxTrack.h:106
int size() const
Return the number of hits for this track.
Definition: CDCDedxTrack.h:200
std::vector< int > m_lLayer
layer id corresponding to dedx
Definition: CDCDedxTrack.h:337
double getNLayerHitsUsed() const
Return the number of hits used to determine the truncated mean.
Definition: CDCDedxTrack.h:177
double getMomentum() const
Return the track momentum valid in the CDC.
Definition: CDCDedxTrack.h:118
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition: Const.h:615
Defines interface for accessing relations of objects in StoreArray.
Abstract base class for different kinds of events.