Belle II Software prerelease-10-00-00a
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 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_hWireGain.push_back(wiregain);
89 m_hTwodCor.push_back(twodcor);
90 m_hOnedCor.push_back(onedcor);
91 m_hFoundByTrackFinder.push_back(foundByTrackFinder);
92 m_hWeightPionHypo.push_back(weightPionHypo);
93 m_hWeightKaonHypo.push_back(weightKaonHypo);
94 m_hWeightProtHypo.push_back(weightProtHypo);
95 }
96
98 double trackID() const { return m_track; }
99
101 double getPDG() const { return m_pdg; }
102
104 double getDedx() const { return m_dedxAvgTruncated; }
105
107 double getDedxNoSat() const { return m_dedxAvgTruncatedNoSat; }
108
110 double getDedxError() const { return m_dedxAvgTruncatedErr; }
111
113 double getDedxMean() const { return m_dedxAvg; }
114
116 std::vector< double > getDedxList() const { return m_hDedx; }
117
119 double getMomentum() const { return m_pCDC; }
120
122 double getCosTheta() const { return m_cosTheta; }
123
125 int getCharge() const { return m_charge; }
126
128 double getInjectionTime() const { return m_injtime; }
129
131 double getInjectionRing() const { return m_injring; }
132
134 double getLength() const { return m_length; }
135
137 double getCosineCorrection() const { return m_cosCor; }
138
140 double getCosEdgeCorrection() const { return m_cosEdgeCor; }
141
143 double getRunGain() const { return m_runGain; }
144
146 double getScaleFactor() const { return m_scale; }
147
149 double getTimeMean() const { return m_timeGain; }
150
152 double getTimeReso() const { return m_timeReso; }
153
155 double getSimulatedDedx() const { return m_simDedx; }
156
158 void setDedx(double mean) { m_dedxAvgTruncated = mean; }
159
161 void setDedxNoSat(double mean) { m_dedxAvgTruncatedNoSat = mean; }
162
164 void setDedxError(double error) { m_dedxAvgTruncatedErr = error; }
165
167 void setDedxMean(double mean) { m_dedxAvg = mean; }
168
170 void setSimulatedDedx(double dedx) { m_simDedx = dedx; }
171
172
173 // Layer level
175 int getNLayerHits() const { return m_lDedx.size(); }
176
178 double getNLayerHitsUsed() const { return m_lNHitsUsed; }
179
181 int getNHitsCombined(int i) const { return m_lNHitsCombined[i]; }
182
184 int getWireLongestHit(int i) const { return m_lWireLongestHit[i]; }
185
187 int getLayer(int i) const { return m_lLayer[i]; }
188
190 double getLayerPath(int i) const { return m_lPath[i]; }
191
193 double getLayerDedx(int i) const { return m_lDedx[i]; }
194
196 void setLayerDedx(int i, double dedx) { m_lDedx[i] = dedx; }
197
198
199 // Hit level
201 int size() const { return m_hDedx.size(); }
202
204 int getWireInLayer(int i) const { return m_hLWire[i]; }
205
207 int getWire(int i) const { return m_hWire[i]; }
208
210 int getHitLayer(int i) const { return m_hLayer[i]; }
211
213 double getPath(int i) const { return m_hPath[i]; }
214
216 double getDedx(int i) const { return m_hDedx[i]; }
217
219 int getADCCount(int i) const { return m_hADCCount[i]; }
220
222 int getADCBaseCount(int i) const { return m_hADCBaseCount[i]; }
223
225 double getNonLADCCorrection(int i) const { return (m_hADCBaseCount[i] * 1.0) / m_hADCCount[i]; }
226
228 double getDoca(int i) const { return m_hDoca[i]; }
229
231 double getEnta(int i) const { return m_hEnta[i]; }
232
234 double getDocaRS(int i) const { return m_hDocaRS[i]; }
235
237 double getEntaRS(int i) const { return m_hEntaRS[i]; }
238
240 int getDriftT(int i) const { return m_hDriftT[i]; }
241
243 double getDE(int i) const { return m_hdE[i]; }
244
246 double getCellHeight(int i) const { return m_hCellHeight[i]; }
247
249 double getCellHalfWidth(int i) const { return m_hCellHalfWidth[i]; }
250
252 double getDriftD(int i) const { return m_hDriftD[i]; }
253
255 double getDriftDRes(int i) const { return m_hDriftDRes[i]; }
256
258 double getWireGain(int i) const { return m_hWireGain[i]; }
259
261 double getTwoDCorrection(int i) const { return m_hTwodCor[i]; }
262
264 double getOneDCorrection(int i) const { return m_hOnedCor[i]; }
265
268 int getFoundByTrackFinder(int i) const { return m_hFoundByTrackFinder[i]; }
269
271 double getWeightPionHypo(int i) const { return m_hWeightPionHypo[i]; }
272
274 double getWeightKaonHypo(int i) const { return m_hWeightKaonHypo[i]; }
275
277 double getWeightProtonHypo(int i) const { return m_hWeightProtHypo[i]; }
278
280 double getChi(int i) const { return m_cdcChi[i]; }
281
283 double getPmean(int i) const { return m_predmean[i]; }
284
286 double getPreso(int i) const { return m_predres[i]; }
287
289 void setDedx(int i, double dedx) { m_hDedx[i] = dedx; }
290
291 private:
292
293 // hit level information
294 std::vector<int> m_hLWire;
295 std::vector<int> m_hWire;
296 std::vector<int> m_hLayer;
297 std::vector<double> m_hPath;
298 std::vector<double> m_hDedx;
299 std::vector<int> m_hADCCount;
300 std::vector<int> m_hADCBaseCount;
301 std::vector<double> m_hDoca;
302 std::vector<double> m_hEnta;
303 std::vector<double> m_hDocaRS;
304 std::vector<double> m_hEntaRS;
305 std::vector<double> m_hdE;
306 std::vector<int> m_hDriftT;
307 std::vector<double> m_hDriftD;
308 std::vector<double> m_hDriftDRes;
309 std::vector<int> m_hFoundByTrackFinder;
310 std::vector<double> m_hWeightPionHypo;
311 std::vector<double> m_hWeightKaonHypo;
312 std::vector<double> m_hWeightProtHypo;
313
314 std::vector<double> m_hCellHeight;
315 std::vector<double> m_hCellHalfWidth;
316
317 // track level information
318 double m_cosTheta;
319 double m_p;
320 double m_pCDC;
321 double m_length;
322 double m_injring;
323 double m_injtime;
326
327 // dE/dx simulation
328 double m_pdg;
329 double m_mcmass;
330 double m_motherPDG;
331 double m_pTrue;
333 double m_simDedx;
334
335 // calibration constants
338 std::vector<double> m_hWireGain;
339 std::vector<double> m_hTwodCor;
340 std::vector<double> m_hOnedCor;
341
342 double m_scale;
343 double m_cosCor;
345 double m_runGain;
346 double m_timeGain;
347 double m_timeReso;
348
349 // track level dE/dx measurements
352 double m_dedxAvg;
356
357
358 // layer level information (just don't mix with the hit arrays)
359 std::vector<int> m_lNHitsCombined;
360 std::vector<int> m_lWireLongestHit;
361 std::vector<int> m_lLayer;
362 std::vector<double> m_lPath;
363 std::vector<double> m_lDedx;
365
367 };
368
369}
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.
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 getCosineCorrection() const
Return the cosine correction 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 m_cosCor
calibration cosine correction
double getPDG() const
Get the identity of the particle.
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.
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.
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.
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.
std::vector< double > getDedxList() const
Return the vector of dE/dx values for this track.
ClassDef(CDCDedxTrack, 18)
Debug output for CDCDedxPID module.
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
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
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.