Belle II Software development
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 }

◆ 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 }

◆ 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 }

◆ 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);
95 clearLogLikelihoods();
96 return;
97 }
98 if (pdfValue <= 0) pdfValue = minPDFValue;
99 m_vxdLogl[iPart] += std::log(pdfValue);
100 }
101
102 m_numAdded++;
103 }

◆ 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 }

◆ 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 }