9 #include <vxd/dataobjects/VXDElectronDeposit.h>
10 #include <vxd/dataobjects/VXDSimHit.h>
15 float VXDSimHit::getElectrons()
const
18 return total.getElectrons();
21 std::vector<std::pair<float, float>> VXDSimHit::getElectronProfile()
const
23 std::vector<std::pair<float, float>> result;
24 result.reserve(m_electronProfile.size());
25 for (
unsigned int encoded : m_electronProfile) {
32 std::vector<std::pair<float, float>> VXDSimHit::getElectronsConstantDistance(
double length)
const
34 double totalLength = (getPosOut() - getPosIn()).
R();
35 const int nSteps = (int)(totalLength / length) + 1;
36 std::vector<std::pair<float, float>> result;
37 result.reserve(nSteps);
40 const double deltaFraction = 1. / nSteps;
42 std::vector<unsigned int>::const_iterator currentPointIt = m_electronProfile.begin();
47 for (
int i = 0; i < nSteps; ++i) {
49 const double fraction = min((i + 1) * deltaFraction, 1.0);
53 lastPoint = currentPoint;
57 const double weight = (fraction - lastPoint.
getFraction()) /
61 result.emplace_back(fraction, electrons);
66 std::vector<std::pair<float, float>> VXDSimHit::getElectronsConstantNumber(
double electronsPerStep)
const
69 const int nSteps = (int)(total.getElectrons() / electronsPerStep) + 1;
70 std::vector<std::pair<float, float>> result;
71 result.reserve(nSteps);
73 double deltaElectrons = total.getElectrons() / nSteps;
75 std::vector<unsigned int>::const_iterator currentPointIt = m_electronProfile.begin();
80 for (
int i = 0; i < nSteps; ++i) {
82 const double electrons = min((i + 1) * deltaElectrons, (
double)total.getElectrons());
86 lastPoint = currentPoint;
90 const double weight = (electrons - lastPoint.
getElectrons()) /
94 result.emplace_back(fraction, electrons);
Packed class to represent energy deposit along a path in electrons.
unsigned int getElectrons() const
get the number of deposited electrons
float getFraction() const
get the fraction along the path
Abstract base class for different kinds of events.