24 vector<const RawParticle*>*
const myPart,
33 thePreshower(myPresh),
35 myGammaGenerator(gamma),
36 bFixedLength_(bFixedLength)
63 if (!
dbe->
get(
"EMShower/NumberOfParticles")) {}
70 for (
unsigned int i=0;
i<
nPart; ++
i ) {
81 if (!
dbe->
get(
"EMShower/ParticlesEnergy")) {}
83 dbe->
get(
"EMShower/ParticlesEnergy")->
Fill(log10(
E[i]));
96 double theMeanT = myParam->
meanT(lny);
97 double theMeanAlpha = myParam->
meanAlpha(lny);
98 double theMeanLnT = myParam->
meanLnT(lny);
100 double theSigmaLnT = myParam->
sigmaLnT(lny);
105 double rhop =
std::sqrt( (1.+theCorrelation)/2. );
106 double rhom =
std::sqrt( (1.-theCorrelation)/2. );
114 photos.push_back(
E[i] * fotos);
126 aa =
std::exp(theMeanLnAlpha + theSigmaLnAlpha * (z1*rhop-z2*rhom));
130 T.push_back(
std::exp(theMeanLnT + theSigmaLnT * (z1*rhop+z2*rhom)));
131 b.push_back((
a[i]-1.)/
T[i]);
134 meanDepth +=
a[
i]/
b[
i]*E[
i];
168 int first_Ecal_step=0;
169 int last_Ecal_step=0;
213 stps=(int)((radlen+2.5)/5.);
215 if ( stps == 0 ) stps = 1;
216 dt = radlen/(double)stps;
218 first_Ecal_step=
steps.size();
219 for (
int ist=0; ist<stps; ++ist )
220 steps.push_back(step);
221 last_Ecal_step=
steps.size()-1;
225 stps =
static_cast<int>(radlen);
226 if (stps == 0) stps = 1;
228 first_Ecal_step=
steps.size();
229 for (
int ist=0; ist<stps; ++ist )
steps.push_back(step);
232 Step stepLast (2,dt);
233 steps.push_back(stepLast);
235 last_Ecal_step=
steps.size()-1;
253 steps.push_back(step);
266 for(
unsigned iStep=0;iStep<
nSteps;++iStep)
270 double realTotalEnergy=0;
271 dt=
steps[iStep].second;
273 for (
unsigned int i=0;
i<
nPart; ++
i ) {
281 MeanDepth/=ESliceTot;
286 if(realTotalEnergy<0.001)
293 if(last_Ecal_step+offset>=0)
325 for (
unsigned iStep=0; iStep<
nSteps; ++iStep ) {
328 dt =
steps[iStep].second;
336 unsigned detector=
steps[iStep].first;
338 bool presh1 = detector==0;
339 bool presh2 = detector==1;
340 bool ecal = detector==2;
341 bool hcal = detector==3;
342 bool vfcal = detector==4;
343 bool gap = detector==5;
349 if ( vfcal )
continue;
362 double tt = t-0.5*
dt;
364 double realTotalEnergy=0.;
365 for (
unsigned int i=0;
i<
nPart; ++
i ) {
374 bool usePreviousGrid=(realTotalEnergy<0.001);
380 if(iStep>2&&realTotalEnergy<0.000001)
continue;
382 if (ecal && !usePreviousGrid)
390 if((ecal || hcal) && !status)
continue;
392 bool detailedShowerTail=
false;
394 if(ecal && !usePreviousGrid)
400 for (
unsigned int i=0;
i<
nPart; ++
i ) {
409 if (
dbe && fabs(dt-1.)< 1
e-5 &&
ecal) {
411 if (!
dbe->
get(
"EMShower/LongitudinalShape")) {}
415 dbe->
get(
"EMShower/LongitudinalShape")->
Fill(t, dE/dx);
424 if(dE*
E[i]<0.000001)
continue;
426 if(detailedShowerTail)
444 / tgamma(
aSpot[i]) );
456 if( nSo > 0. && nS/nSo < 10.) dE *= nS/nSo;
476 }
else if ( presh2 ) {
494 double eSpot = (nS>0.) ? dE/nS : 0.;
495 double SpotEnergy=eSpot*
E[
i];
505 int nSpot = (int)(nS+0.5);
512 double taui = tt/
Ti[
i];
525 if(dSpotsCore<0) dSpotsCore=0;
527 unsigned nSpots_core = (unsigned)(dSpotsCore+0.5);
528 unsigned nSpots_tail = ((unsigned)nSpot>nSpots_core) ? nSpot-nSpots_core : 0;
530 for(
unsigned icomp=0;icomp<2;++icomp)
533 double theR=(icomp==0) ? theRC : theRT ;
534 unsigned ncompspots=(icomp==0) ? nSpots_core : nSpots_tail;
558 for(
unsigned irad=0;irad<nrad;++irad)
564 double umin=radInterval.
getUmin(irad);
565 double umax=radInterval.
getUmax(irad);
569 for (
unsigned ispot=0; ispot<nradspots; ++ispot )
586 if (
dbe && fabs(dt-1.)< 1
e-5 && ecal) {
588 if (!
dbe->
get(
"EMShower/TransverseShape")) {}
593 dbe->
get(
"EMShower/TransverseShape")->
Fill(ri,1/E[i]*spote/drho);
594 dbe->
get(
"EMShower/ShapeRhoZ")->
Fill(ri, t, 1/E[i]*spote/(drho*dx));
609 if(detailedShowerTail)
723 unsigned nvals=myValues.size()/2;
724 for(
unsigned iv=0;iv<nvals;++iv)
752 if(fabs(b2) < 1.
e-9 ) b2 = 1.e-9;
void setSpotEnergy(double e)
Set the spot energy.
double ps2TotalX0() const
total number of X0 in the PS (Layer2).
std::vector< const RawParticle * > *const thePart
std::vector< double > theNumberOfSpots
double sigmaLnT(double lny) const
const HCALProperties * hcalProperties() const
double meanLnT(double lny) const
void prepareSteps()
Computes the steps before the real compute.
std::vector< double > maximumOfShower
bool addHit(double r, double phi, unsigned layer=0)
double meanAlphaSpot(double alpha) const
void setSpotEnergy(double e)
std::vector< double > aSpot
unsigned getNumberOfSpots(unsigned i) const
Number of spots in a given interval.
double meanT(double lny) const
bool addHit(double r, double phi, unsigned layer=0)
double deposit(double t, double a, double b, double dt)
void cd(void)
go to top directory (ie. root)
double gam(double x, double a) const
const HCALProperties * theHCAL
void setPreshower(PreshowerHitMaker *const myPresh)
set the preshower address
double rC(double tau, double E) const
const ECALProperties * theECAL
double ps2eeTotalX0() const
void setIntervals(unsigned icomp, RadialInterval &rad)
const std::vector< double > & getTailIntervals() const
void compute()
Compute the shower longitudinal and lateral development.
const std::vector< double > & getCoreIntervals() const
double gaussShoot(double mean=0.0, double sigma=1.0) const
std::vector< double > Etot
double spotFraction() const
Spot fraction wrt ECAL.
PreshowerHitMaker * thePreshower
std::vector< std::vector< double > > depositedEnergy
double ecalTotalX0() const
in the ECAL
bool addHitDepth(double r, double phi, double depth=-1)
unsigned int poissonShoot(double mean) const
double getUmin(unsigned i) const
Lower limit of the argument in the radius generator.
HcalHitMaker * theHcalHitMaker
double hcalTotalX0() const
in the HCAL
std::vector< double > meanDepth
double rT(double tau, double E) const
void setParameters(double a, double b, double xm)
The parameters must be set before shooting.
unsigned int offset(bool)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
std::vector< double > photos
const PreshowerLayer1Properties * layer1Properties() const
void setSpotEnergy(double e)
double correlationAlphaT(double lny) const
const ECALProperties * ecalProperties() const
unsigned nIntervals() const
Number of intervals.
double mipsPerGeV() const
Number of Mips/GeV [Default : 41.7 Mips/GeV or 24 MeV/Mips].
double mipsPerGeV() const
Number of Mips/GeV [Default : 59.5 Mips/GeV or 0.7*24 MeV/Mips].
double criticalEnergy() const
Critical energy in GeV (2.66E-3*(x0*Z/A)^1.1): 8.74E-3 for Standard ECAL.
double p(double tau, double E) const
const PreshowerLayer2Properties * layer2Properties() const
const PreshowerLayer2Properties * theLayer2
double flatShoot(double xmin=0.0, double xmax=1.0) const
bool getPads(double depth, bool inCm=false)
double meanLnAlpha(double lny) const
double nSpots(double E) const
virtual double lightCollectionEfficiency() const =0
Light Collection efficiency.
const PreshowerLayer1Properties * theLayer1
EMShower(const RandomEngine *engine, GammaFunctionGenerator *gamma, EMECALShowerParametrization *const myParam, std::vector< const RawParticle * > *const myPart, DQMStore *const dbeIn=NULL, EcalHitMaker *const myGrid=NULL, PreshowerHitMaker *const myPreshower=NULL, bool bFixedLength=false)
double meanTSpot(double T) const
double meanAlpha(double lny) const
virtual double lightCollectionUniformity() const =0
Light Collection uniformity.
EMECALShowerParametrization *const theParam
GammaFunctionGenerator * myGammaGenerator
double sigmaLnAlpha(double lny) const
std::vector< double > TSpot
double getSpotEnergy(unsigned i) const
Spot energy in a given interval.
Genfun::IncompleteGamma myIncompleteGamma
double ps1TotalX0() const
const RandomEngine * random
bool addHit(double r, double phi, unsigned layer=0)
add the hit in the HCAL in local coordinates
double getUmax(unsigned i) const
Upper limit of the argument in the radius generator.
virtual double photoStatistics() const =0
Photostatistics (photons/GeV) in the homegeneous material.
double x0DepthOffset() const
get the offset (e.g the number of X0 after which the shower starts)
std::pair< unsigned int, double > Step
Power< A, B >::type pow(const A &a, const B &b)
bool setDepth(double, bool inCm=false)
set the depth in X0 or Lambda0 units depending on showerType
void addInterval(double, double)
void setHcal(HcalHitMaker *const myHcal)
set the HCAL address
std::vector< double > bSpot