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 friend class CDCDedxPIDCreatorModule;
30
31 public:
32
36 m_cosTheta(0), m_p(0), m_pCDC(0), m_length(0.0), m_injring(-1), m_injtime(-1),
37 m_track(0), m_charge(0), m_pdg(-999), m_mcmass(0), m_motherPDG(0), m_pTrue(0), m_cosThetaTrue(0),
40 {
42
43 // set default values for all particles
44 for (unsigned int i = 0; i < Const::ChargedStable::c_SetSize; i++) {
45 m_predmean[i] = 0.0;
46 m_predres[i] = 0.0;
47 m_cdcChi[i] = -999.;
48 m_cdcLogl[i] = 0.0;
49 }
50 }
51
53 void addDedx(int nhitscombined, int wirelongesthit, int layer, double distance, double dedxValue)
54 {
55 m_lNHitsCombined.push_back(nhitscombined);
56 m_lWireLongestHit.push_back(wirelongesthit);
57 m_lLayer.push_back(layer);
58 m_lPath.push_back(distance);
59 m_lDedx.push_back(dedxValue);
60
61 m_length += distance;
62 }
63
65 void addHit(int lwire, int wire, int layer, double doca, double docaRS, double enta, double entaRS,
66 int adcCount, int adcbaseCount, double dE, double path, double dedx, double cellHeight, double cellHalfWidth,
67 int driftT, double driftD, double driftDRes, double coscor, double wiregain, double twodcor,
68 double onedcor, int foundByTrackFinder, double weightPionHypo, double weightKaonHypo, double weightProtHypo)
69 {
70
71 m_hLWire.push_back(lwire);
72 m_hWire.push_back(wire);
73 m_hLayer.push_back(layer);
74 m_hPath.push_back(path);
75 m_hDedx.push_back(dedx);
76 m_hADCCount.push_back(adcCount);
77 m_hADCBaseCount.push_back(adcbaseCount);
78 m_hDoca.push_back(doca);
79 m_hDocaRS.push_back(docaRS);
80 m_hEnta.push_back(enta);
81 m_hEntaRS.push_back(entaRS);
82 m_hDriftT.push_back(driftT);
83 m_hdE.push_back(dE);
84 m_hCellHeight.push_back(cellHeight);
85 m_hCellHalfWidth.push_back(cellHalfWidth);
86 m_hDriftD.push_back(driftD);
87 m_hDriftDRes.push_back(driftDRes);
88 m_hCosCor.push_back(coscor);
89 m_hWireGain.push_back(wiregain);
90 m_hTwodCor.push_back(twodcor);
91 m_hOnedCor.push_back(onedcor);
92 m_hFoundByTrackFinder.push_back(foundByTrackFinder);
93 m_hWeightPionHypo.push_back(weightPionHypo);
94 m_hWeightKaonHypo.push_back(weightKaonHypo);
95 m_hWeightProtHypo.push_back(weightProtHypo);
96 }
97
99 double trackID() const { return m_track; }
100
102 double getPDG() const { return m_pdg; }
103
105 double getDedx() const { return m_dedxAvgTruncated; }
106
108 double getDedxNoSat() const { return m_dedxAvgTruncatedNoSat; }
109
111 double getDedxError() const { return m_dedxAvgTruncatedErr; }
112
114 double getDedxMean() const { return m_dedxAvg; }
115
117 const std::vector<double>& getDedxList() const { return m_hDedx; }
118
120 double getMomentum() const { return m_pCDC; }
121
123 double getCosTheta() const { return m_cosTheta; }
124
126 int getCharge() const { return m_charge; }
127
129 double getInjectionTime() const { return m_injtime; }
130
132 double getInjectionRing() const { return m_injring; }
133
135 double getLength() const { return m_length; }
136
138 double getCosEdgeCorrection() const { return m_cosEdgeCor; }
139
141 double getRunGain() const { return m_runGain; }
142
144 double getScaleFactor() const { return m_scale; }
145
147 double getTimeMean() const { return m_timeGain; }
148
150 double getTimeReso() const { return m_timeReso; }
151
153 double getSimulatedDedx() const { return m_simDedx; }
154
156 void setDedx(double mean) { m_dedxAvgTruncated = mean; }
157
159 void setDedxNoSat(double mean) { m_dedxAvgTruncatedNoSat = mean; }
160
162 void setDedxError(double error) { m_dedxAvgTruncatedErr = error; }
163
165 void setDedxMean(double mean) { m_dedxAvg = mean; }
166
168 void setSimulatedDedx(double dedx) { m_simDedx = dedx; }
169
170
171 // Layer level
173 int getNLayerHits() const { return m_lDedx.size(); }
174
176 double getNLayerHitsUsed() const { return m_lNHitsUsed; }
177
179 int getNHitsCombined(int i) const { return m_lNHitsCombined[i]; }
180
182 int getWireLongestHit(int i) const { return m_lWireLongestHit[i]; }
183
185 int getLayer(int i) const { return m_lLayer[i]; }
186
188 double getLayerPath(int i) const { return m_lPath[i]; }
189
191 double getLayerDedx(int i) const { return m_lDedx[i]; }
192
194 void setLayerDedx(int i, double dedx) { m_lDedx[i] = dedx; }
195
196
197 // Hit level
199 int size() const { return m_hDedx.size(); }
200
202 int getWireInLayer(int i) const { return m_hLWire[i]; }
203
205 int getWire(int i) const { return m_hWire[i]; }
206
208 int getHitLayer(int i) const { return m_hLayer[i]; }
209
211 double getPath(int i) const { return m_hPath[i]; }
212
214 double getDedx(int i) const { return m_hDedx[i]; }
215
217 int getADCCount(int i) const { return m_hADCCount[i]; }
218
220 int getADCBaseCount(int i) const { return m_hADCBaseCount[i]; }
221
223 double getNonLADCCorrection(int i) const { return (m_hADCBaseCount[i] * 1.0) / m_hADCCount[i]; }
224
226 double getDoca(int i) const { return m_hDoca[i]; }
227
229 double getEnta(int i) const { return m_hEnta[i]; }
230
232 double getDocaRS(int i) const { return m_hDocaRS[i]; }
233
235 double getEntaRS(int i) const { return m_hEntaRS[i]; }
236
238 int getDriftT(int i) const { return m_hDriftT[i]; }
239
241 double getDE(int i) const { return m_hdE[i]; }
242
244 double getCellHeight(int i) const { return m_hCellHeight[i]; }
245
247 double getCellHalfWidth(int i) const { return m_hCellHalfWidth[i]; }
248
250 double getDriftD(int i) const { return m_hDriftD[i]; }
251
253 double getDriftDRes(int i) const { return m_hDriftDRes[i]; }
254
256 double getCosineCorrection(int i) const { return m_hCosCor[i]; }
257
259 double getWireGain(int i) const { return m_hWireGain[i]; }
260
262 double getTwoDCorrection(int i) const { return m_hTwodCor[i]; }
263
265 double getOneDCorrection(int i) const { return m_hOnedCor[i]; }
266
269 int getFoundByTrackFinder(int i) const { return m_hFoundByTrackFinder[i]; }
270
272 double getWeightPionHypo(int i) const { return m_hWeightPionHypo[i]; }
273
275 double getWeightKaonHypo(int i) const { return m_hWeightKaonHypo[i]; }
276
278 double getWeightProtonHypo(int i) const { return m_hWeightProtHypo[i]; }
279
281 double getChi(int i) const { return m_cdcChi[i]; }
282
284 double getPmean(int i) const { return m_predmean[i]; }
285
287 double getPreso(int i) const { return m_predres[i]; }
288
290 void setDedx(int i, double dedx) { m_hDedx[i] = dedx; }
291
292 private:
293
294 // hit level information
295 std::vector<int> m_hLWire;
296 std::vector<int> m_hWire;
297 std::vector<int> m_hLayer;
298 std::vector<double> m_hPath;
299 std::vector<double> m_hDedx;
300 std::vector<int> m_hADCCount;
301 std::vector<int> m_hADCBaseCount;
302 std::vector<double> m_hDoca;
303 std::vector<double> m_hEnta;
304 std::vector<double> m_hDocaRS;
305 std::vector<double> m_hEntaRS;
306 std::vector<double> m_hdE;
307 std::vector<int> m_hDriftT;
308 std::vector<double> m_hDriftD;
309 std::vector<double> m_hDriftDRes;
310 std::vector<int> m_hFoundByTrackFinder;
311 std::vector<double> m_hWeightPionHypo;
312 std::vector<double> m_hWeightKaonHypo;
313 std::vector<double> m_hWeightProtHypo;
314
315 std::vector<double> m_hCellHeight;
316 std::vector<double> m_hCellHalfWidth;
317
318 // track level information
319 double m_cosTheta;
320 double m_p;
321 double m_pCDC;
322 double m_length;
323 double m_injring;
324 double m_injtime;
327
328 // dE/dx simulation
329 double m_pdg;
330 double m_mcmass;
331 double m_motherPDG;
332 double m_pTrue;
334 double m_simDedx;
335
336 // calibration constants
339
340 std::vector<double> m_hCosCor;
341 std::vector<double> m_hWireGain;
342 std::vector<double> m_hTwodCor;
343 std::vector<double> m_hOnedCor;
344
345 double m_scale;
347 double m_runGain;
348 double m_timeGain;
349 double m_timeReso;
350
351 // track level dE/dx measurements
354 double m_dedxAvg;
358
359
360 // layer level information (just don't mix with the hit arrays)
361 std::vector<int> m_lNHitsCombined;
362 std::vector<int> m_lWireLongestHit;
363 std::vector<int> m_lLayer;
364 std::vector<double> m_lPath;
365 std::vector<double> m_lDedx;
367
369 };
370
371}
std::vector< double > m_hOnedCor
calibration 1-D correction (indexed on number of hits)
double m_cdcChi[Const::ChargedStable::c_SetSize]
chi values for each particle type
std::vector< double > m_hDocaRS
distance of closest approach to sense wire after rescalling cell L=W
std::vector< double > m_hDoca
distance of closest approach to sense wire
std::vector< int > m_lWireLongestHit
wire id for the longest hit in the layer
std::vector< double > m_hDedx
charge per path length (dE/dx)
double m_mcmass
MC PID mass.
std::vector< double > m_hCellHeight
height of the CDC cell
double getTimeMean() const
Return the injection gain for this track.
int getHitLayer(int i) const
Return the (global) layer number for a hit.
int getADCBaseCount(int i) const
Return the base adcCount (no non-linearity) for this hit.
double m_cosEdgeCor
calibration cosine edge correction
double getSimulatedDedx() const
Get the track-level MC dE/dx mean for this track.
int getADCCount(int i) const
Return the adcCount for this hit.
std::vector< double > m_hEnta
entrance angle in CDC cell
double m_dedxAvgTruncated
dE/dx truncated mean per track
void setDedx(int i, double dedx)
Set the dE/dx value for this hit.
double m_p
momentum at the IP
void setDedxError(double error)
Set the error on the dE/dx truncated mean for this track.
double getDriftDRes(int i) const
Return the drift distance resolution for this hit.
double m_dedxAvgTruncatedErr
standard deviation of m_dedxAvgTruncated
double getDedxMean() const
Get the dE/dx mean for this track.
double getDriftD(int i) const
Return the drift distance for this hit.
void setSimulatedDedx(double dedx)
Set the track level MC dE/dx mean for this track.
int getLayer(int i) const
Return the (global) layer number for a layer hit.
std::vector< int > m_hLayer
layer number
double m_dedxAvgTruncatedNoSat
dE/dx truncated mean per track without the saturation correction
double getDoca(int i) const
Return the distance of closest approach to the sense wire for this hit.
double getDedx() const
Get dE/dx truncated mean for this track.
double getPath(int i) const
Return the path length through the cell for this hit.
int getWireInLayer(int i) const
Return the sensor ID for this hit: wire number in the layer.
std::vector< int > m_hADCCount
adcCount per hit
double getPmean(int i) const
Return the PID (predicted mean) value.
double getCosineCorrection(int i) const
Return the cosine correction for this hit.
std::vector< double > m_hWeightKaonHypo
weight for kaon hypothesis from KalmanFitterInfo
double getOneDCorrection(int i) const
Return the 1D correction for this hit.
int getWireLongestHit(int i) const
Return the wire number of the longest hit per layer.
CDCDedxTrack()
Default constructor.
double getWeightKaonHypo(int i) const
Return the max weights from KalmanFitterInfo using kaon hypothesis.
int m_lNHitsUsed
number of hits on this track used for truncated mean
double m_simDedx
track level MC dE/dx truncated mean
std::vector< int > m_hADCBaseCount
adcCount base count (uncorrected) per hit
void setDedx(double mean)
Set the dE/dx truncated average for this track.
double getEntaRS(int i) const
Return rescaled enta value for cell height=width assumption.
double getLayerDedx(int i) const
Return the total dE/dx for this layer.
double getCellHalfWidth(int i) const
Return the half-width of the CDC cell.
std::vector< int > m_hLWire
wire ID within the layer
std::vector< int > m_hDriftT
drift time for each hit
std::vector< int > m_hFoundByTrackFinder
the 'found by track finder' flag for the given hit
double getPDG() const
Get the identity of the particle.
ClassDef(CDCDedxTrack, 19)
Debug output for CDCDedxPID module.
std::vector< double > m_hTwodCor
calibration 2-D correction (indexed on number of hits)
std::vector< double > m_hWeightPionHypo
weight for pion hypothesis from KalmanFitterInfo
void setDedxMean(double mean)
Set the dE/dx mean for this track.
std::vector< double > m_hDriftD
drift distance for each hit
std::vector< double > m_hDriftDRes
drift distance resolution for each hit
std::vector< double > m_hPath
path length in the CDC cell
double m_predres[Const::ChargedStable::c_SetSize]
predicted dE/dx resolution
double getTwoDCorrection(int i) const
Return the 2D correction for this hit.
double m_motherPDG
MC PID of mother particle.
double m_runGain
calibration run gain
void addDedx(int nhitscombined, int wirelongesthit, int layer, double distance, double dedxValue)
add dE/dx information for a CDC layer
double m_timeGain
calibration injection time gain
std::vector< int > m_lNHitsCombined
number of hits combined in the layer
double getPreso(int i) const
Return the PID (predicted reso) value.
int getNLayerHits() const
Return the number of layer hits for this track.
int getFoundByTrackFinder(int i) const
Return the TrackFinder which added the given hit to track.
int getDriftT(int i) const
Return the drift time for this hit.
double getCosTheta() const
Return cos(theta) for this track.
std::vector< double > m_lPath
distance flown through active medium in current segment
double m_timeReso
calibration injection time gain
double getInjectionRing() const
Return cos(theta) for this track.
double m_pdg
MC PID.
int getCharge() const
Return the charge for this track.
double m_cosTheta
cos(theta) for the track
double getWireGain(int i) const
Return the wire gain for this hit.
double getWeightPionHypo(int i) const
Return the max weights from KalmanFitterInfo using pion hypothesis.
std::vector< double > m_hCosCor
calibration cosine correction (indexed on number of hits)
double getTimeReso() const
Return the injection reso for this track.
int getWire(int i) const
Return the sensor ID for this hit: wire number for CDC (0-14336)
double m_scale
scale factor to make electrons ~1
std::vector< double > m_hWeightProtHypo
weight for proton hypothesis from KalmanFitterInfo
double getDocaRS(int i) const
Return rescaled doca value for cell height=width assumption.
std::vector< double > m_hEntaRS
entrance angle in CDC cell after rescalling cell L=W
double m_pCDC
momentum at the inner layer of the CDC
double m_length
total distance travelled by the track
double m_injring
injection ring type of track's event
double getCosEdgeCorrection() const
Return the cosine correction for this track.
double m_cdcLogl[Const::ChargedStable::c_SetSize]
log likelihood for each particle, not including momentum prior
std::vector< double > m_hWireGain
calibration hit gain (indexed on number of hits)
double getRunGain() const
Return the run gain for this track.
double m_dedxAvg
dE/dx mean value per track
void setLayerDedx(int i, double dedx)
Set the total dE/dx for this layer.
double getNonLADCCorrection(int i) const
Return the factor introduce for adcCount (non-linearity) correction.
void setDedxNoSat(double mean)
Set the dE/dx truncated average without the saturation correction for this track.
int m_charge
particle charge from tracking (+1 or -1)
std::vector< double > m_hCellHalfWidth
half-width of the CDC cell
double getDedxError() const
Get the error on the dE/dx truncated mean for this track.
double getWeightProtonHypo(int i) const
Return the max weights from KalmanFitterInfo using proton hypothesis.
double getEnta(int i) const
Return the entrance angle in the CDC cell for this hit.
double getInjectionTime() const
Return cos(theta) for this track.
double m_pTrue
MC true momentum.
int m_track
ID number of the Track.
double getDedx(int i) const
Return the dE/dx value for this hit.
double trackID() const
Return the track ID.
double m_injtime
time since last injection of track's event
double m_predmean[Const::ChargedStable::c_SetSize]
predicted dE/dx truncated mean
double getLayerPath(int i) const
Return the distance travelled in this layer.
std::vector< int > m_hWire
continuous wire ID in the CDC
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 coscor, double wiregain, double twodcor, double onedcor, int foundByTrackFinder, double weightPionHypo, double weightKaonHypo, double weightProtHypo)
Add a single hit to the object.
double getChi(int i) const
Return the PID (chi) value.
std::vector< double > m_hdE
charge per hit
std::vector< double > m_lDedx
extracted dE/dx (arb.
double m_cosThetaTrue
MC true cos(theta)
double getScaleFactor() const
Return the scale factor for this track.
double getLength() const
Return the total path length for this track.
double getCellHeight(int i) const
Return the height of the CDC cell.
double getDE(int i) const
Return the ionization charge collected for this hit.
int getNHitsCombined(int i) const
Return the number of hits combined per layer.
double getDedxNoSat() const
Get dE/dx truncated mean without the saturation correction for this track.
int size() const
Return the number of hits for this track.
std::vector< int > m_lLayer
layer id corresponding to dedx
const std::vector< double > & getDedxList() const
Return the vector of dE/dx values for this track.
double getNLayerHitsUsed() const
Return the number of hits used to determine the truncated mean.
double getMomentum() const
Return the track momentum valid in the CDC.
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition Const.h:615
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Abstract base class for different kinds of events.