8#include <reconstruction/dataobjects/VXDDedxTrack.h>
9#include <framework/logging/Logger.h>
30 dist.push_back(distance);
31 dedx.push_back(dedxValue);
51 if (detector == Const::PXD)
return m_dedxAvg[Dedx::c_PXD];
52 if (detector == Const::SVD)
return m_dedxAvg[Dedx::c_SVD];
64 if (detector != Dedx::c_PXD and detector != Dedx::c_SVD)
return;
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;
80 if (dedxValue <= 0)
return;
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();
87 const auto& pdf = PDFs[iPart];
89 pdfValue =
const_cast<TH2F*
>(pdf)->Interpolate(
m_p, dedxValue);
91 pdfValue = pdf->GetBinContent(binX, binY);
93 if (pdfValue != pdfValue) {
94 B2ERROR(
"pdfValue is NAN for a track with p=" <<
m_p <<
" and dedx=" << dedxValue);
98 if (pdfValue <= 0) pdfValue = minPDFValue;
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
EDetector
Enum for identifying the detector components (detector and subdetector).
double m_p
momentum at the IP
std::vector< double > m_dx
path length in layer
double m_dedxAvgTruncated[2]
dE/dx truncated mean per track
std::vector< int > m_layer
VXD layer number.
std::vector< int > m_adcCount
adcCount per hit
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
double m_dedxAvg[2]
dE/dx mean value per track
std::vector< double > dist
distance flown through active medium in current segment
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.
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.