|
|
Go to the documentation of this file.
19 vector<const RawParticle*>*
const myPart,
27 thePreshower(myPresh),
29 myGammaGenerator(
gamma),
49 for (
unsigned int i = 0;
i <
nPart; ++
i) {
59 double theMeanT = myParam->
meanT(lny);
60 double theMeanAlpha = myParam->
meanAlpha(lny);
61 double theMeanLnT = myParam->
meanLnT(lny);
63 double theSigmaLnT = myParam->
sigmaLnT(lny);
68 double rhop =
std::sqrt((1. + theCorrelation) / 2.);
89 aa =
std::exp(theMeanLnAlpha + theSigmaLnAlpha * (z1 * rhop -
z2 *
rhom));
93 T.push_back(
std::exp(theMeanLnT + theSigmaLnT * (z1 * rhop +
z2 *
rhom)));
94 b.push_back((
a[
i] - 1.) /
T[
i]);
129 int first_Ecal_step = 0;
130 int last_Ecal_step = 0;
175 stps = (
int)((radlen + 2.5) / 5.);
179 dt = radlen / (double)stps;
181 first_Ecal_step =
steps.size();
182 for (
int ist = 0; ist < stps; ++ist)
184 last_Ecal_step =
steps.size() - 1;
188 stps = static_cast<int>(radlen);
192 first_Ecal_step =
steps.size();
193 for (
int ist = 0; ist < stps; ++ist)
198 steps.push_back(stepLast);
200 last_Ecal_step =
steps.size() - 1;
213 if (dtFrontHcal < 30.) {
214 dt = 30. - dtFrontHcal;
223 double ESliceTot = 0.;
224 double MeanDepth = 0.;
230 for (
unsigned iStep = 0; iStep <
nSteps; ++iStep) {
233 double realTotalEnergy = 0;
236 for (
unsigned int i = 0;
i <
nPart; ++
i) {
244 MeanDepth /= ESliceTot;
249 if (realTotalEnergy < 0.001) {
255 if (last_Ecal_step +
offset >= 0)
284 for (
unsigned iStep = 0; iStep <
nSteps; ++iStep) {
322 double tt =
t - 0.5 *
dt;
324 double realTotalEnergy = 0.;
325 for (
unsigned int i = 0;
i <
nPart; ++
i) {
334 bool usePreviousGrid = (realTotalEnergy < 0.001);
340 if (iStep > 2 && realTotalEnergy < 0.000001)
343 if (
ecal && !usePreviousGrid) {
352 bool detailedShowerTail =
false;
354 if (
ecal && !usePreviousGrid) {
359 for (
unsigned int i = 0;
i <
nPart; ++
i) {
366 if (dE *
E[
i] < 0.000001)
387 if (dE *
E[
i] < 0.000001)
427 if (nSo > 0. && nS / nSo < 10.)
457 if (detailedShowerTail)
465 double eSpot = (nS > 0.) ? dE / nS : 0.;
466 double SpotEnergy = eSpot *
E[
i];
476 int nSpot = (
int)(nS + 0.5);
482 double taui =
tt /
Ti[
i];
497 unsigned nSpots_core = (unsigned)(dSpotsCore + 0.5);
498 unsigned nSpots_tail = ((unsigned)nSpot > nSpots_core) ? nSpot - nSpots_core : 0;
500 for (
unsigned icomp = 0; icomp < 2; ++icomp) {
501 double theR = (icomp == 0) ? theRC : theRT;
502 unsigned ncompspots = (icomp == 0) ? nSpots_core : nSpots_tail;
520 for (
unsigned irad = 0; irad < nrad; ++irad) {
527 double umin = radInterval.
getUmin(irad);
528 double umax = radInterval.
getUmax(irad);
532 for (
unsigned ispot = 0; ispot < nradspots; ++ispot) {
534 double ri = theR *
std::sqrt(z3 / (1. - z3));
543 if (detailedShowerTail) {
584 for (
unsigned i = 0;
i <
nPart; ++
i) {
647 unsigned nvals = myValues.size() / 2;
648 for (
unsigned iv = 0;
iv < nvals; ++
iv) {
655 if (myPresh !=
nullptr) {
668 if (fabs(
b2) < 1.
e-9)
void addInterval(double, double)
virtual double lightCollectionUniformity() const =0
Light Collection uniformity.
double rT(double tau, double E) const
void setSpotEnergy(double e) override
std::vector< double > Etot
double p(double tau, double E) const
const PreshowerLayer1Properties * theLayer1
void setParameters(double a, double b, double xm)
The parameters must be set before shooting.
double sigmaLnAlpha(double lny) const
std::vector< double > photos
const ECALProperties * theECAL
double nSpots(double E) const
std::vector< double > aSpot
double ps2TotalX0() const
total number of X0 in the PS (Layer2).
PreshowerHitMaker * thePreshower
std::vector< const RawParticle * > *const thePart
double criticalEnergy() const override
Critical energy in GeV (2.66E-3*(x0*Z/A)^1.1): 8.74E-3 for Standard ECAL.
static constexpr float b2
const PreshowerLayer1Properties * layer1Properties() const
double shoot(RandomEngineAndDistribution const *) const
double meanLnT(double lny) const
bool getPads(double depth, bool inCm=false)
void setHcal(HcalHitMaker *const myHcal)
set the HCAL address
void setIntervals(unsigned icomp, RadialInterval &rad)
bool addHit(double r, double phi, unsigned layer=0) override
void prepareSteps()
Computes the steps before the real compute.
const HCALProperties * theHCAL
double getUmax(unsigned i) const
Upper limit of the argument in the radius generator.
static constexpr float b1
double resE() const
a rough estimate of ECAL resolution sigma/E = resE/sqrt(E)
unsigned nIntervals() const
Number of intervals.
virtual double lightCollectionEfficiency() const =0
Light Collection efficiency.
double ps2eeTotalX0() const
double x0DepthOffset() const
get the offset (e.g the number of X0 after which the shower starts)
double getUmin(unsigned i) const
Lower limit of the argument in the radius generator.
bool addHit(double r, double phi, unsigned layer=0) override
double meanT(double lny) const
const ECALProperties * ecalProperties() const
double rC(double tau, double E) const
void compute()
Compute the shower longitudinal and lateral development.
std::vector< double > meanDepth
unsigned getNumberOfSpots(unsigned i) const
Number of spots in a given interval.
const PreshowerLayer2Properties * theLayer2
double gam(double x, double a) const
std::vector< std::vector< double > > depositedEnergy
const RandomEngineAndDistribution * random
void setSpotEnergy(double e) override
double meanAlpha(double lny) const
Genfun::IncompleteGamma myIncompleteGamma
std::vector< double > TSpot
double meanAlphaSpot(double alpha) const
const std::vector< double > & getTailIntervals() const
const PreshowerLayer2Properties * layer2Properties() const
void setPreshower(PreshowerHitMaker *const myPresh)
set the preshower address
double ecalTotalX0() const
in the ECAL
std::vector< double > bSpot
virtual double photoStatistics() const =0
Photostatistics (photons/GeV) in the homegeneous material.
const HCALProperties * hcalProperties() const
HcalHitMaker * theHcalHitMaker
double getSpotEnergy(unsigned i) const
Spot energy in a given interval.
double flatShoot(double xmin=0.0, double xmax=1.0) const
double meanTSpot(double T) const
double ps1TotalX0() const
bool setDepth(double, bool inCm=false)
set the depth in X0 or Lambda0 units depending on showerType
bool addHitDepth(double r, double phi, double depth=-1)
bool isHom() const
a rough estimate of ECAL resolution sigma/E = resE/sqrt(E)
EMShower(RandomEngineAndDistribution const *engine, GammaFunctionGenerator *gamma, EMECALShowerParametrization *const myParam, std::vector< const RawParticle * > *const myPart, EcalHitMaker *const myGrid=nullptr, PreshowerHitMaker *const myPreshower=nullptr, bool bFixedLength=false)
double spotFraction() const
Spot fraction wrt ECAL.
GammaFunctionGenerator * myGammaGenerator
double deposit(double t, double a, double b, double dt)
const std::vector< double > & getCoreIntervals() const
double hcalTotalX0() const
in the HCAL
double sigmaLnT(double lny) const
Power< A, B >::type pow(const A &a, const B &b)
bool addHit(double r, double phi, unsigned layer=0) override
add the hit in the HCAL in local coordinates
std::vector< double > theNumberOfSpots
std::vector< double > maximumOfShower
double mipsPerGeV() const override
Number of Mips/GeV [Default : 41.7 Mips/GeV or 24 MeV/Mips].
void setSpotEnergy(double e) override
Set the spot energy.
EMECALShowerParametrization *const theParam
double mipsPerGeV() const override
Number of Mips/GeV [Default : 59.5 Mips/GeV or 0.7*24 MeV/Mips].
std::pair< unsigned int, double > Step
double gaussShoot(double mean=0.0, double sigma=1.0) const
unsigned int poissonShoot(double mean) const
double meanLnAlpha(double lny) const
double correlationAlphaT(double lny) const