Belle II Software development
VXDDedxTrack.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 <reconstruction/dataobjects/DedxConstants.h>
12
13#include <framework/datastore/RelationsObject.h>
14#include <framework/gearbox/Const.h>
15
16#include <vector>
17
18namespace Belle2 {
28 friend class VXDDedxPIDModule;
29
30 public:
31
35 m_eventID(0), m_trackID(0),
36 m_p(0), m_cosTheta(0), m_charge(0),
37 m_length(0.0), m_nHits(0), m_nHitsUsed(0),
38 m_pdg(0), m_motherPDG(0), m_pTrue(0)
39 {
40 // set default values for all detectors
41 for (int i = 0; i <= Dedx::c_SVD; i++)
43
44 // set default values for all particles
45 for (unsigned int i = 0; i < Const::ChargedStable::c_SetSize; i++)
46 m_vxdLogl[i] = 0.0;
47 }
48
50 void addHit(int sid, int layer, int adcCount, double dx, double dEdx)
51 {
52 m_sensorID.push_back(sid);
53 m_layer.push_back(layer);
54 m_adcCount.push_back(adcCount);
55 m_dx.push_back(dx);
56 m_dEdx.push_back(dEdx);
57 }
58
60 void addDedx(int layer, double distance, double dedxValue)
61 {
62 dedxLayer.push_back(layer);
63 dist.push_back(distance);
64 dedx.push_back(dedxValue);
65 m_length += distance;
66 }
67
69 double getDedx(Const::EDetector detector) const
70 {
71 int iDet = (int)(detector - Const::PXD);
72 if (iDet < 0 or iDet > Dedx::c_SVD)
73 return 0.0;
74 return m_dedxAvgTruncated[iDet];
75 }
76
78 double getDedxError(Const::EDetector detector) const
79 {
80 int iDet = (int)(detector - Const::PXD);
81 if (iDet < 0 or iDet > Dedx::c_SVD)
82 return 0.0;
83 return m_dedxAvgTruncatedErr[iDet];
84 }
85
87 double getDedxMean(Const::EDetector detector) const
88 {
89 int iDet = (int)(detector - Const::PXD);
90 if (iDet < 0 or iDet > Dedx::c_SVD)
91 return 0.0;
92 return m_dedxAvg[iDet];
93 }
94
96 double eventID() const { return m_eventID; }
98 double trackID() const { return m_trackID; }
100 double getCosTheta() const { return m_cosTheta; }
101
103 double getMomentum() const { return m_p; }
105 double getTrueMomentum() const { return m_pTrue; }
107 double size() const { return m_nHits; }
109 double getNHitsUsed() const { return m_nHitsUsed; }
110
112 int getLayer(int i) const { return m_layer[i]; }
114 int getSensorID(int i) const { return m_sensorID[i]; }
116 int getADCCount(int i) const { return m_adcCount[i]; }
118 double getDx(int i) const { return m_dx[i]; }
120 double getDedx(int i) const { return m_dEdx[i]; }
121
123 std::vector< double > getDedxList() const { return m_dEdx; }
124
125 private:
126
130 // hit level information
131 std::vector<int> m_layer;
132 std::vector<int> m_sensorID;
133 std::vector<int> m_adcCount;
134 std::vector<double> m_dx;
135 std::vector<double> m_dEdx;
137 // one entry per layer (just don't mix with the hit arrays)
138 std::vector<double> dedx;
139 std::vector<double> dist;
140 std::vector<double> dedxLayer;
142 // track level information
143 double m_p;
144 double m_cosTheta;
145 short m_charge;
147 double m_length;
148 short m_nHits;
151 double m_pdg;
152 double m_motherPDG;
153 double m_pTrue;
155 double m_dedxAvg[2];
162 };
164}
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition: Const.h:615
EDetector
Enum for identifying the detector components (detector and subdetector).
Definition: Const.h:42
Defines interface for accessing relations of objects in StoreArray.
Extract dE/dx from fitted tracks.
Debug output for VXDDedxPID module.
Definition: VXDDedxTrack.h:27
void addHit(int sid, int layer, int adcCount, double dx, double dEdx)
Add a single hit to the object.
Definition: VXDDedxTrack.h:50
void addDedx(int layer, double distance, double dedxValue)
add dE/dx information for a VXD layer
Definition: VXDDedxTrack.h:60
int getSensorID(int i) const
Return the sensor ID for this hit.
Definition: VXDDedxTrack.h:114
int getADCCount(int i) const
Return the adcCount for this hit.
Definition: VXDDedxTrack.h:116
double m_p
momentum at the IP
Definition: VXDDedxTrack.h:143
int m_trackID
ID number of the Track.
Definition: VXDDedxTrack.h:128
std::vector< double > m_dx
path length in layer
Definition: VXDDedxTrack.h:134
int getLayer(int i) const
Return the (global) layer number.
Definition: VXDDedxTrack.h:112
double m_dedxAvgTruncated[2]
dE/dx truncated mean per track
Definition: VXDDedxTrack.h:156
ClassDef(VXDDedxTrack, 2)
Debug output for VXDDedxPID module.
short m_nHitsUsed
number of hits on this track used in the truncated mean
Definition: VXDDedxTrack.h:149
short m_charge
particle charge from tracking (+1 or -1)
Definition: VXDDedxTrack.h:145
double getDx(int i) const
Return the path length through the layer.
Definition: VXDDedxTrack.h:118
std::vector< int > m_layer
VXD layer number.
Definition: VXDDedxTrack.h:131
std::vector< int > m_adcCount
adcCount per hit
Definition: VXDDedxTrack.h:133
double getDedxError(Const::EDetector detector) const
Get the error on the dE/dx truncated mean for given detector.
Definition: VXDDedxTrack.h:78
double m_motherPDG
MC PID of mother particle.
Definition: VXDDedxTrack.h:152
int m_eventID
event in which this Track was found
Definition: VXDDedxTrack.h:127
double getCosTheta() const
Return cos(theta) for this yrack.
Definition: VXDDedxTrack.h:100
double getTrueMomentum() const
Return the MC truemomentum valid at the IP.
Definition: VXDDedxTrack.h:105
double m_pdg
MC PID.
Definition: VXDDedxTrack.h:151
double getDedxMean(Const::EDetector detector) const
Get the dE/dx mean for given detector.
Definition: VXDDedxTrack.h:87
double m_cosTheta
cos(theta) for the track
Definition: VXDDedxTrack.h:144
double m_vxdLogl[Const::ChargedStable::c_SetSize]
log likelihood for each particle, not including momentum prior
Definition: VXDDedxTrack.h:159
double getDedx(Const::EDetector detector) const
Get dE/dx truncated mean for given detector.
Definition: VXDDedxTrack.h:69
double getNHitsUsed() const
Return the number of hits used to determine the truncated mean.
Definition: VXDDedxTrack.h:109
double m_length
total distance travelled by the track
Definition: VXDDedxTrack.h:147
std::vector< int > m_sensorID
unique sensor ID
Definition: VXDDedxTrack.h:132
double m_dedxAvgTruncatedErr[2]
standard deviation of m_dedxAvgTruncated
Definition: VXDDedxTrack.h:157
std::vector< double > getDedxList() const
Return the vector of dE/dx values for this track.
Definition: VXDDedxTrack.h:123
double size() const
Return the number of hits for this track.
Definition: VXDDedxTrack.h:107
double m_dedxAvg[2]
dE/dx mean value per track
Definition: VXDDedxTrack.h:155
double m_pTrue
MC true momentum.
Definition: VXDDedxTrack.h:153
double getDedx(int i) const
Return the dE/dx value for this hit.
Definition: VXDDedxTrack.h:120
double trackID() const
Return the track ID.
Definition: VXDDedxTrack.h:98
std::vector< double > dist
distance flown through active medium in current segment
Definition: VXDDedxTrack.h:139
short m_nHits
number of hits on this track
Definition: VXDDedxTrack.h:148
double eventID() const
Return the event ID.
Definition: VXDDedxTrack.h:96
std::vector< double > m_dEdx
charge per path length
Definition: VXDDedxTrack.h:135
VXDDedxTrack()
Default constructor.
Definition: VXDDedxTrack.h:33
std::vector< double > dedxLayer
layer id corresponding to dE/dx measurement
Definition: VXDDedxTrack.h:140
std::vector< double > dedx
extracted dE/dx (arb.
Definition: VXDDedxTrack.h:138
double getMomentum() const
Return the momentum valid at the IP.
Definition: VXDDedxTrack.h:103
Abstract base class for different kinds of events.