Belle II Software release-09-00-00
reconstruction data objects
Collaboration diagram for reconstruction data objects:

Classes

class  KLMMuonIDDNNInputVariable
 KLM MuonID DNN input variables datastore object to store the input variables for retraining KLMMuonIDDNNExpertModule. More...
 
class  VXDDedxLikelihood
 Container for likelihoods obtained by the VXD dE/dx PID (VXDDedxPIDModule). More...
 
class  VXDDedxTrack
 Debug output for VXDDedxPID module. More...
 

Functions

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
 
double getDedx (Const::EDetector detector) const
 Get dE/dx truncated mean for given detector.
 
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.
 
void clearLogLikelihoods ()
 Clear log likelihoods (set to zero) and reset the counter of added log likelihood values.
 
void addLogLikelihoods (const std::vector< const TH2F * > &PDFs, Dedx::Detector detector, bool truncated)
 Calculate and add log likelihoods to array m_vxdLogl.
 
void addLogLikelihoods (const std::vector< const TH2F * > &PDFs, double dedxValue, double minPDFValue)
 Calculate and add log likelihoods to array m_vxdLogl.
 

Detailed Description

Function Documentation

◆ addDedx()

void addDedx ( int  layer,
double  distance,
double  dedxValue 
)

add dE/dx information for a VXD layer

Definition at line 27 of file VXDDedxTrack.cc.

28 {
29 dedxLayer.push_back(layer);
30 dist.push_back(distance);
31 dedx.push_back(dedxValue);
32 m_length += distance;
33 }
double m_length
total distance travelled by the track
Definition: VXDDedxTrack.h:146
std::vector< double > dist
distance flown through active medium in current segment
Definition: VXDDedxTrack.h:138
std::vector< double > dedxLayer
layer id corresponding to dE/dx measurement
Definition: VXDDedxTrack.h:139
std::vector< double > dedx
extracted dE/dx (arb.
Definition: VXDDedxTrack.h:137

◆ addHit()

void addHit ( int  sid,
int  layer,
int  adcCount,
double  dx,
double  dEdx 
)

Add a single hit to the object.

Definition at line 18 of file VXDDedxTrack.cc.

19 {
20 m_sensorID.push_back(sid);
21 m_layer.push_back(layer);
22 m_adcCount.push_back(adcCount);
23 m_dx.push_back(dx);
24 m_dEdx.push_back(dEdx);
25 }
std::vector< double > m_dx
path length in layer
Definition: VXDDedxTrack.h:133
std::vector< int > m_layer
VXD layer number.
Definition: VXDDedxTrack.h:130
std::vector< int > m_adcCount
adcCount per hit
Definition: VXDDedxTrack.h:132
std::vector< int > m_sensorID
unique sensor ID
Definition: VXDDedxTrack.h:131
std::vector< double > m_dEdx
charge per path length
Definition: VXDDedxTrack.h:134

◆ addLogLikelihoods() [1/2]

void addLogLikelihoods ( const std::vector< const TH2F * > &  PDFs,
Dedx::Detector  detector,
bool  truncated 
)

Calculate and add log likelihoods to array m_vxdLogl.

Parameters
PDFsPDF's
detectordetector (PXD or SVD)
truncatedif true, use dE/dx truncated mean, otherwise use dE/dx measured in layers

Definition at line 62 of file VXDDedxTrack.cc.

63 {
64 if (detector != Dedx::c_PXD and detector != Dedx::c_SVD) return;
65
66 if (truncated) {
67 addLogLikelihoods(PDFs, m_dedxAvgTruncated[detector], 1e-3);
68 } else {
69 for (size_t i = 0; i < dedx.size(); i++) {
70 if (detector == Dedx::c_PXD and std::abs(dedxLayer[i]) > 2) continue;
71 if (detector == Dedx::c_SVD and std::abs(dedxLayer[i]) < 3) continue;
72 addLogLikelihoods(PDFs, dedx[i], 1e-5);
73 }
74 }
75
76 }
double m_dedxAvgTruncated[2]
dE/dx truncated mean per track
Definition: VXDDedxTrack.h:155
void addLogLikelihoods(const std::vector< const TH2F * > &PDFs, Dedx::Detector detector, bool truncated)
Calculate and add log likelihoods to array m_vxdLogl.
Definition: VXDDedxTrack.cc:62

◆ addLogLikelihoods() [2/2]

void addLogLikelihoods ( const std::vector< const TH2F * > &  PDFs,
double  dedxValue,
double  minPDFValue 
)
private

Calculate and add log likelihoods to array m_vxdLogl.

Parameters
PDFsPDF's
dedxValuevalue of dE/dx
minPDFValueminimal PDF value (used when bins are found empty)

Definition at line 78 of file VXDDedxTrack.cc.

79 {
80 if (dedxValue <= 0) return;
81
82 int binX = PDFs[0]->GetXaxis()->FindFixBin(m_p);
83 int binY = PDFs[0]->GetYaxis()->FindFixBin(dedxValue);
84 bool inRange = binX > 0 and binX <= PDFs[0]->GetNbinsX() and binY > 0 and binY <= PDFs[0]->GetNbinsY();
85 for (unsigned int iPart = 0; iPart < Const::ChargedStable::c_SetSize; iPart++) {
86 double pdfValue = 0;
87 const auto& pdf = PDFs[iPart];
88 if (inRange) {
89 pdfValue = const_cast<TH2F*>(pdf)->Interpolate(m_p, dedxValue);
90 } else {
91 pdfValue = pdf->GetBinContent(binX, binY);
92 }
93 if (pdfValue != pdfValue) {
94 B2ERROR("pdfValue is NAN for a track with p=" << m_p << " and dedx=" << dedxValue);
96 return;
97 }
98 if (pdfValue <= 0) pdfValue = minPDFValue;
99 m_vxdLogl[iPart] += std::log(pdfValue);
100 }
101
102 m_numAdded++;
103 }
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Definition: Const.h:615
double m_p
momentum at the IP
Definition: VXDDedxTrack.h:142
double m_vxdLogl[Const::ChargedStable::c_SetSize]
log likelihood for each particle
Definition: VXDDedxTrack.h:158
int m_numAdded
counter of added log likelihood values
Definition: VXDDedxTrack.h:159
void clearLogLikelihoods()
Clear log likelihoods (set to zero) and reset the counter of added log likelihood values.
Definition: VXDDedxTrack.cc:56

◆ clearLogLikelihoods()

void clearLogLikelihoods ( )

Clear log likelihoods (set to zero) and reset the counter of added log likelihood values.

Definition at line 56 of file VXDDedxTrack.cc.

57 {
58 for (auto& logl : m_vxdLogl) logl = 0;
59 m_numAdded = 0;
60 }

◆ getDedx()

double getDedx ( Const::EDetector  detector) const

Get dE/dx truncated mean for given detector.

Definition at line 35 of file VXDDedxTrack.cc.

36 {
37 if (detector == Const::PXD) return m_dedxAvgTruncated[Dedx::c_PXD];
38 if (detector == Const::SVD) return m_dedxAvgTruncated[Dedx::c_SVD];
39 return 0.0;
40 }

◆ getDedxError()

double getDedxError ( Const::EDetector  detector) const

Get the error on the dE/dx truncated mean for given detector.

Definition at line 42 of file VXDDedxTrack.cc.

43 {
44 if (detector == Const::PXD) return m_dedxAvgTruncatedErr[Dedx::c_PXD];
45 if (detector == Const::SVD) return m_dedxAvgTruncatedErr[Dedx::c_SVD];
46 return 0.0;
47 }
double m_dedxAvgTruncatedErr[2]
standard deviation of m_dedxAvgTruncated
Definition: VXDDedxTrack.h:156

◆ getDedxMean()

double getDedxMean ( Const::EDetector  detector) const

Get the dE/dx mean for given detector.

Definition at line 49 of file VXDDedxTrack.cc.

50 {
51 if (detector == Const::PXD) return m_dedxAvg[Dedx::c_PXD];
52 if (detector == Const::SVD) return m_dedxAvg[Dedx::c_SVD];
53 return 0.0;
54 }
double m_dedxAvg[2]
dE/dx mean value per track
Definition: VXDDedxTrack.h:154