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#include <framework/datastore/RelationsObject.h>
13#include <framework/gearbox/Const.h>
14
15#include <vector>
16#include <TH2F.h>
17
18namespace Belle2 {
23
30 friend class VXDDedxPIDModule;
31
32 public:
33
35 VXDDedxTrack() = default;
36
38 void addHit(int sid, int layer, int adcCount, double dx, double dEdx);
39
41 void addDedx(int layer, double distance, double dedxValue);
42
44 double getDedx(Const::EDetector detector) const;
45
47 double getDedxError(Const::EDetector detector) const;
48
50 double getDedxMean(Const::EDetector detector) const;
51
53 int eventID() const { return m_eventID; }
54
56 int trackID() const { return m_trackID; }
57
59 double getCosTheta() const { return m_cosTheta; }
60
62 double getMomentum() const { return m_p; }
63
65 double getTrueMomentum() const { return m_pTrue; }
66
68 int size() const { return m_nHits; }
69
71 int getNHitsUsed() const { return m_nHitsUsed; }
72
74 int getLayer(int i) const { return m_layer[i]; }
75
77 int getSensorID(int i) const { return m_sensorID[i]; }
78
80 int getADCCount(int i) const { return m_adcCount[i]; }
81
83 double getDx(int i) const { return m_dx[i]; }
84
86 double getDedxOfHit(int i) const { return m_dEdx[i]; }
87
89 const std::vector<double>& getDedxList() const { return m_dEdx; }
90
95
102 void addLogLikelihoods(const std::vector<const TH2F*>& PDFs, Dedx::Detector detector, bool truncated);
103
108 bool areLogLikelihoodsAvailable() const {return m_numAdded > 0;}
109
114 const double* getLogLikelihoods() const {return m_vxdLogl;}
115
116 private:
117
124 void addLogLikelihoods(const std::vector<const TH2F*>& PDFs, double dedxValue, double minPDFValue);
125
126 // hit level information
127 std::vector<int> m_layer;
128 std::vector<int> m_sensorID;
129 std::vector<int> m_adcCount;
130 std::vector<double> m_dx;
131 std::vector<double> m_dEdx;
132
133 // one entry per layer (just don't mix with the hit arrays)
134 std::vector<double> dedx;
135 std::vector<double> dist;
136 std::vector<double> dedxLayer;
137
139
140 // dEdx information
141 double m_dedxAvg[2] = {0};
142 double m_dedxAvgTruncated[2] = {0};
143 double m_dedxAvgTruncatedErr[2] = {0};
144
145 // track level information
146 double m_p = 0;
147 double m_cosTheta = 0;
148 double m_length = 0;
149 short m_charge = 0;
150
151 // MC information
152 double m_pdg = 0;
153 double m_motherPDG = 0;
154 double m_pTrue = 0;
155
156 int m_numAdded = 0;
157 int m_eventID = 0;
158 int m_trackID = 0;
159 short m_nHits = 0;
160 short m_nHitsUsed = 0;
161
162
164 };
165
166}
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
bool areLogLikelihoodsAvailable() const
Are log likelihoods available?
int getSensorID(int i) const
Return the sensor ID for this hit.
int getADCCount(int i) const
Return the adcCount for this hit.
double m_p
momentum at the IP
int m_trackID
ID number of the Track.
int getNHitsUsed() const
Return the number of hits used to determine the truncated mean.
std::vector< double > m_dx
path length in layer
int getLayer(int i) const
Return the (global) layer number.
double m_dedxAvgTruncated[2]
dE/dx truncated mean per track
VXDDedxTrack()=default
Default constructor.
short m_nHitsUsed
number of hits on this track used in the truncated mean
short m_charge
particle charge from tracking (+1 or -1)
int eventID() const
Return the event ID.
double getDedxOfHit(int i) const
Return the dE/dx value for this hit.
double getDx(int i) const
Return the path length through the layer.
std::vector< int > m_layer
VXD layer number.
std::vector< int > m_adcCount
adcCount per hit
double m_motherPDG
MC PID of mother particle.
int m_eventID
event in which this Track was found
double getCosTheta() const
Return cos(theta) for this yrack.
double getTrueMomentum() const
Return the MC truemomentum valid at the IP.
double m_pdg
MC PID.
int trackID() const
Return the track ID.
const double * getLogLikelihoods() const
Get the array of log likelihoods.
double m_cosTheta
cos(theta) for the track
double m_vxdLogl[Const::ChargedStable::c_SetSize]
log likelihood for each particle
double m_length
total distance travelled by the track
std::vector< int > m_sensorID
unique sensor ID
double m_dedxAvgTruncatedErr[2]
standard deviation of m_dedxAvgTruncated
int m_numAdded
counter of added log likelihood values
ClassDef(VXDDedxTrack, 4)
class version for ROOT streamer
double m_dedxAvg[2]
dE/dx mean value per track
double m_pTrue
MC true momentum.
std::vector< double > dist
distance flown through active medium in current segment
short m_nHits
number of hits on this track
std::vector< double > m_dEdx
charge per path length
std::vector< double > dedxLayer
layer id corresponding to dE/dx measurement
std::vector< double > dedx
extracted dE/dx (arb.
int size() const
Return the number of hits for this track.
const std::vector< double > & getDedxList() const
Return the vector of dE/dx values for this track.
double getMomentum() const
Return the momentum valid at the IP.
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
void addHit(int sid, int layer, int adcCount, double dx, double dEdx)
Add a single hit to the object.
void addDedx(int layer, double distance, double dedxValue)
add dE/dx information for a VXD layer
void addLogLikelihoods(const std::vector< const TH2F * > &PDFs, Dedx::Detector detector, bool truncated)
Calculate and add log likelihoods to array m_vxdLogl.
void clearLogLikelihoods()
Clear log likelihoods (set to zero) and reset the counter of added log likelihood values.
double getDedxError(Const::EDetector detector) const
Get the error on the dE/dx truncated mean for given detector.
double getDedxMean(Const::EDetector detector) const
Get the dE/dx mean for given detector.
double getDedx(Const::EDetector detector) const
Get dE/dx truncated mean for given detector.
Abstract base class for different kinds of events.