7 CLHEP::HepRandomEngine& eng,
9 : rndEngine_(eng), det_id_(det_id) {
21 if (direction.
z() > 10 || direction.
x() > 200 || direction.
y() > 200) {
32 double momentum = hit.
pabs();
33 double length = direction.
mag();
35 for (
int i = 0;
i < NumberOfSegmentation;
i++) {
37 double((
i + 0.5) / NumberOfSegmentation) * direction);
40 for (
int i = 0;
i < NumberOfSegmentation;
i++) {
42 double((
i + 0.5) / NumberOfSegmentation) * direction);
56 edm::LogInfo(
"RPixLinearChargeDivider") <<
"energy dep. sum=" << sum;
63 double particleMomentum,
67 std::vector<RPixEnergyDepositUnit>& elossVector) {
68 double particleMass = 139.6;
81 double segmentLength = length / NumberOfSegs;
86 double segmentEloss = (eloss * 1000) / NumberOfSegs;
87 for (
int i = 0;
i < NumberOfSegs;
i++) {
90 particleMomentum * 1000, particleMass, deltaCutoff, segmentLength, segmentEloss, &(
rndEngine_)) /
92 elossVector[
i].setEnergy(de);
98 double ratio = eloss / sum;
99 for (
int ii = 0;
ii < NumberOfSegs;
ii++)
100 elossVector[
ii].setEnergy(ratio * elossVector[
ii].
Energy());
102 double averageEloss = eloss / NumberOfSegs;
103 for (
int ii = 0;
ii < NumberOfSegs;
ii++)
104 elossVector[
ii].setEnergy(averageEloss);
T getParameter(std::string const &) const
RPixLinearChargeDivider(const edm::ParameterSet ¶ms, CLHEP::HepRandomEngine &eng, uint32_t det_id)
std::vector< RPixEnergyDepositUnit > the_energy_path_distribution_
~RPixLinearChargeDivider()
Local3DPoint exitPoint() const
Exit point in the local Det frame.
SiG4UniversalFluctuation * fluctuate
void FluctuateEloss(int pid, double particleMomentum, double eloss, double length, int NumberOfSegs, std::vector< RPixEnergyDepositUnit > &elossVector)
CLHEP::HepRandomEngine & rndEngine_
Abs< T >::type abs(const T &t)
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
double SampleFluctuations(const double momentum, const double mass, double &tmax, const double length, const double meanLoss, CLHEP::HepRandomEngine *)
float energyLoss() const
The energy deposit in the PSimHit, in ???.
std::vector< RPixEnergyDepositUnit > divide(const PSimHit &hit)
Local3DPoint entryPoint() const
Entry point in the local Det frame.