9#include <vxd/dataobjects/VXDElectronDeposit.h>
10#include <vxd/dataobjects/VXDSimHit.h>
18 return total.getElectrons();
23 std::vector<std::pair<float, float>> result;
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);
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
std::vector< unsigned int > m_electronProfile
Energy depsoition profile encoded using the ElectronDeposit class.
ROOT::Math::XYZVector getPosOut() const
Return the end point of the electron deposition in local coordinates.
std::vector< std::pair< float, float > > getElectronsConstantDistance(double length) const
Get the electron deposition along constant stepsize.
float getElectrons() const
Return the number of created electrons.
std::vector< std::pair< float, float > > getElectronProfile() const
Get the decoded electron profile.
ROOT::Math::XYZVector getPosIn() const
Return the start point of the electron deposition in local coordinates.
std::vector< std::pair< float, float > > getElectronsConstantNumber(double electronsPerStep) const
Get the electron deposition with constant number of electrons between sampling points.
Abstract base class for different kinds of events.