CMS 3D CMS Logo

HDShower.cc
Go to the documentation of this file.
1 //updated by Reza Goldouzian
2 //FastSimulation Headers
5 
8 
9 // CMSSW headers
11 
12 #include <cmath>
13 
14 // number attempts for transverse distribution if exit on a spec. condition
15 #define infinity 10000
16 // debugging flag ( 0, 1, 2, 3)
17 #define debug 0
18 
19 using namespace edm;
20 
22  HDShowerParametrization* myParam,
23  EcalHitMaker* myGrid,
24  HcalHitMaker* myHcalHitMaker,
25  int onECAL,
26  double epart,
27  double pmip)
28  : theParam(myParam),
29  theGrid(myGrid),
30  theHcalHitMaker(myHcalHitMaker),
31  onEcal(onECAL),
32  e(epart),
33  // pmip(pmip),
34  random(engine) {
35  // To get an access to constants read in FASTCalorimeter
36  // FASTCalorimeter * myCalorimeter= FASTCalorimeter::instance();
37 
38  // Values taken from FamosGeneric/FamosCalorimeter/src/FASTCalorimeter.cc
39  lossesOpt = myParam->hsParameters()->getHDlossesOpt();
41  nTRsteps = myParam->hsParameters()->getHDnTRsteps();
42  transParam = myParam->hsParameters()->getHDtransParam();
43  eSpotSize = myParam->hsParameters()->getHDeSpotSize();
44  depthStep = myParam->hsParameters()->getHDdepthStep();
47  balanceEH = myParam->hsParameters()->getHDbalanceEH();
49 
50  // Special tr.size fluctuations
51  transParam *= (1. + random->flatShoot());
52 
53  // Special long. fluctuations
54  hcalDepthFactor += 0.05 * (2. * random->flatShoot() - 1.);
55 
56  transFactor = 1.; // normally 1, in HF - might be smaller
57  // to take into account
58  // a narrowness of the HF shower (Cherenkov light)
59 
60  // simple protection ...
61  if (e < 0)
62  e = 0.;
63 
64  // Get the Famos Histos pointer
65  // myHistos = FamosHistos::instance();
66  // std::cout << " Hello FamosShower " << std::endl;
67 
70 
71  double emax = theParam->emax();
72  double emid = theParam->emid();
73  double emin = theParam->emin();
74  double effective = e;
75 
76  if (e < emid) {
77  theParam->setCase(1);
78  // avoid "underflow" below Emin (for parameters calculation only)
79  if (e < emin)
80  effective = emin;
81  } else
82  theParam->setCase(2);
83 
84  // Avoid "overflow" beyond Emax (for parameters)
85  if (effective > 0.5 * emax) {
86  eSpotSize *= 2.5;
87  if (effective > emax) {
88  effective = emax;
89  eSpotSize *= 4.;
90  depthStep *= 2.;
91  if (effective > 1000.)
92  eSpotSize *= 2.;
93  }
94  }
95 
96  if (debug == 2)
97  LogInfo("FastCalorimetry") << " HDShower : " << std::endl
98  << " Energy " << e << std::endl
99  << " lossesOpt " << lossesOpt << std::endl
100  << " nDepthSteps " << nDepthSteps << std::endl
101  << " nTRsteps " << nTRsteps << std::endl
102  << " transParam " << transParam << std::endl
103  << " eSpotSize " << eSpotSize << std::endl
104  << " criticalEnergy " << criticalEnergy << std::endl
105  << " maxTRfactor " << maxTRfactor << std::endl
106  << " balanceEH " << balanceEH << std::endl
107  << "hcalDepthFactor " << hcalDepthFactor << std::endl;
108 
109  double alpEM1 = theParam->alpe1();
110  double alpEM2 = theParam->alpe2();
111 
112  double betEM1 = theParam->bete1();
113  double betEM2 = theParam->bete2();
114 
115  double alpHD1 = theParam->alph1();
116  double alpHD2 = theParam->alph2();
117 
118  double betHD1 = theParam->beth1();
119  double betHD2 = theParam->beth2();
120 
121  double part1 = theParam->part1();
122  double part2 = theParam->part2();
123 
124  aloge = std::log(effective);
125 
126  double edpar = (theParam->e1() + aloge * theParam->e2()) * effective;
127  double aedep = std::log(edpar);
128 
129  if (debug == 2)
130  LogInfo("FastCalorimetry") << " HDShower : " << std::endl
131  << " edpar " << edpar << " aedep " << aedep << std::endl
132  << " alpEM1 " << alpEM1 << std::endl
133  << " alpEM2 " << alpEM2 << std::endl
134  << " betEM1 " << betEM1 << std::endl
135  << " betEM2 " << betEM2 << std::endl
136  << " alpHD1 " << alpHD1 << std::endl
137  << " alpHD2 " << alpHD2 << std::endl
138  << " betHD1 " << betHD1 << std::endl
139  << " betHD2 " << betHD2 << std::endl
140  << " part1 " << part1 << std::endl
141  << " part2 " << part2 << std::endl;
142 
143  // private members to set
144  theR1 = theParam->r1();
145  theR2 = theParam->r2();
146  theR3 = theParam->r3();
147 
148  alpEM = alpEM1 + alpEM2 * aedep;
149  tgamEM = tgamma(alpEM);
150  betEM = betEM1 - betEM2 * aedep;
151  alpHD = alpHD1 + alpHD2 * aedep;
152  tgamHD = tgamma(alpHD);
153  betHD = betHD1 - betHD2 * aedep;
154  part = part1 - part2 * aedep;
155  if (part > 1.)
156  part = 1.; // protection - just in case of
157 
158  if (debug == 2)
159  LogInfo("FastCalorimetry") << " HDShower : " << std::endl
160  << " alpEM " << alpEM << std::endl
161  << " tgamEM " << tgamEM << std::endl
162  << " betEM " << betEM << std::endl
163  << " alpHD " << alpHD << std::endl
164  << " tgamHD " << tgamHD << std::endl
165  << " betHD " << betHD << std::endl
166  << " part " << part << std::endl;
167 
168  if (onECAL) {
171  } else {
172  lambdaEM = 0.;
173  x0EM = 0.;
174  }
177 
178  if (debug == 2)
179  LogInfo("FastCalorimetry") << " HDShower e " << e << std::endl
180  << " x0EM = " << x0EM << std::endl
181  << " x0HD = " << x0HD << std::endl
182  << " lamEM = " << lambdaEM << std::endl
183  << " lamHD = " << lambdaHD << std::endl;
184 
185  // Starting point of the shower
186  // try first with ECAL lambda
187 
188  double sum1 = 0.; // lambda path from the ECAL/HF entrance;
189  double sum2 = 0.; // lambda path from the interaction point;
190  double sum3 = 0.; // x0 path from the interaction point;
191  int nsteps = 0; // full number of longitudinal steps (counter);
192 
193  int nmoresteps; // how many longitudinal steps in addition to
194  // one (if interaction happens there) in ECAL
195 
196  mip = 1; // just to initiate particle as MIP in ECAL
197 
198  if (e < criticalEnergy)
199  nmoresteps = 1;
200  else
201  nmoresteps = nDepthSteps;
202 
203  depthECAL = 0.;
204  depthGAP = 0.;
205  depthGAPx0 = 0.;
206  if (onECAL) {
207  depthECAL = theGrid->ecalTotalL0(); // ECAL depth segment
208  //depthECAL = theGrid->ecalTotalL0() + theGrid->ps1TotalL0() + theGrid->ps2TotalL0() + theGrid->ps2eeTotalL0(); //TEST: include preshower
209  depthGAP = theGrid->ecalHcalGapTotalL0(); // GAP depth segment
210  depthGAPx0 = theGrid->ecalHcalGapTotalX0(); // GAP depth x0
211  }
212 
213  depthHCAL = theGrid->hcalTotalL0(); // HCAL depth segment
215 
216  //---------------------------------------------------------------------------
217  // Depth simulation & various protections, among them
218  // if too deep - get flat random in the allowed region
219  // if no HCAL material behind - force to deposit in ECAL
220  double maxDepth = depthToHCAL + depthHCAL - 1.1 * depthStep;
221  double depthStart = std::log(1. / random->flatShoot()); // starting point lambda unts
222  //std::cout<<"generated depth "<<depthStart<<std::endl;
223  if (pmip == 1) {
225  } else {
226  depthStart = depthStart * 0.9 * depthECAL / std::log(1. / pmip);
227  }
228  // std::cout<<"modified depth "<<depthStart<<std::endl;
229 
230  if (e < emin) {
231  if (debug)
232  LogInfo("FastCalorimetry") << " FamosHDShower : e <emin -> depthStart = 0" << std::endl;
233  depthStart = 0.;
234  }
235 
236  if (depthStart > maxDepth) {
237  if (debug)
238  LogInfo("FastCalorimetry") << " FamosHDShower : depthStart too big ... = " << depthStart << std::endl;
240  if (depthStart < 0.)
241  depthStart = 0.;
242  if (debug)
243  LogInfo("FastCalorimetry") << " FamosHDShower : depthStart re-calculated = " << depthStart << std::endl;
244  }
245 
246  if (onECAL && e < emid) {
247  if (depthECAL > depthStep && (depthECAL - depthStart) / depthECAL > 0.2) {
248  depthStart = 0.5 * depthECAL * random->flatShoot();
249  if (debug)
250  LogInfo("FastCalorimetry") << " FamosHDShower : small energy, "
251  << " depthStart reduced to = " << depthStart << std::endl;
252  }
253  }
254 
255  if (depthHCAL < depthStep) {
256  if (debug)
257  LogInfo("FastCalorimetry") << " FamosHDShower : depthHCAL too small ... = " << depthHCAL
258  << " depthStart -> forced to 0 !!!" << std::endl;
259  depthStart = 0.;
260  nmoresteps = 0;
261 
262  if (depthECAL < depthStep) {
263  nsteps = -1;
264  LogInfo("FastCalorimetry") << " FamosHDShower : too small ECAL and HCAL depths - "
265  << " particle is lost !!! " << std::endl;
266  }
267  }
268 
269  if (debug)
270  LogInfo("FastCalorimetry") << " FamosHDShower depths(lam) - " << std::endl
271  << " ECAL = " << depthECAL << std::endl
272  << " GAP = " << depthGAP << std::endl
273  << " HCAL = " << depthHCAL << std::endl
274  << " starting point = " << depthStart << std::endl;
275 
276  if (onEcal) {
277  if (debug)
278  LogInfo("FastCalorimetry") << " FamosHDShower : onECAL" << std::endl;
279  if (depthStart < depthECAL) {
280  if (debug)
281  LogInfo("FastCalorimetry") << " FamosHDShower : depthStart < depthECAL" << std::endl;
282  if (depthECAL > depthStep && (depthECAL - depthStart) / depthECAL > 0.1) {
283  if (debug)
284  LogInfo("FastCalorimetry") << " FamosHDShower : enough space to make ECAL step" << std::endl;
285 
286  // ECAL - one step
287  nsteps++;
288  sum1 += depthECAL; // at the end of step
289  sum2 += depthECAL - depthStart;
290  sum3 += sum2 * lambdaEM / x0EM;
291  lamtotal.push_back(sum1);
292  lamdepth.push_back(sum2);
293  lamcurr.push_back(lambdaEM);
294  lamstep.push_back(depthECAL - depthStart);
295  x0depth.push_back(sum3);
296  x0curr.push_back(x0EM);
297  detector.push_back(1);
298  mip = 0;
299 
300  if (debug)
301  LogInfo("FastCalorimetry") << " FamosHDShower : "
302  << " in ECAL sum1, sum2 " << sum1 << " " << sum2 << std::endl;
303 
304  // Gap - no additional step after ECAL
305  // just move further to HCAL over the gap
306  sum1 += depthGAP;
307  sum2 += depthGAP;
308  sum3 += depthGAPx0;
309  } else { // Just shift starting point to HCAL
310  // cout << " FamosHDShower : not enough space to make ECAL step" << std::endl;
311  if (debug)
312  LogInfo("FastCalorimetry") << " FamosHDShower : goto HCAL" << std::endl;
313 
315  sum1 += depthStart;
316  }
317  } else { // GAP or HCAL
319  depthStart = depthToHCAL; // just a shift to HCAL for simplicity
320  }
321  sum1 += depthStart;
322  if (debug)
323  LogInfo("FastCalorimetry") << " FamosHDShower : goto HCAL" << std::endl;
324  }
325  } else { // Forward
326  if (debug)
327  LogInfo("FastCalorimetry") << " FamosHDShower : forward" << std::endl;
328  sum1 += depthStart;
329  transFactor = 0.5; // makes narower tresverse size of shower
330  }
331 
332  for (int i = 0; i < nmoresteps; i++) {
333  sum1 += depthStep;
334  if (sum1 > (depthECAL + depthGAP + depthHCAL))
335  break;
336  sum2 += depthStep;
337  sum3 += sum2 * lambdaHD / x0HD;
338  lamtotal.push_back(sum1);
339  lamdepth.push_back(sum2);
340  lamcurr.push_back(lambdaHD);
341  lamstep.push_back(depthStep);
342  x0depth.push_back(sum3);
343  x0curr.push_back(x0HD);
344  detector.push_back(3);
345  nsteps++;
346  }
347 
348  // Make fractions of energy and transverse radii at each step
349 
350  if (nsteps > 0) {
351  makeSteps(nsteps);
352  }
353 }
354 
355 void HDShower::makeSteps(int nsteps) {
356  double sumes = 0.;
357  double sum = 0.;
358  std::vector<double> temp;
359 
360  if (debug)
361  LogInfo("FastCalorimetry") << " FamosHDShower::makeSteps - "
362  << " nsteps required : " << nsteps << std::endl;
363 
364  int count = 0;
365  for (int i = 0; i < nsteps; i++) {
366  double deplam = lamdepth[i] - 0.5 * lamstep[i];
367  double depx0 = x0depth[i] - 0.5 * lamstep[i] / x0curr[i];
368  double x = betEM * depx0;
369  double y = betHD * deplam;
370 
371  if (debug == 2)
372  LogInfo("FastCalorimetry") << " FamosHDShower::makeSteps "
373  << " - step " << i << " depx0, x = " << depx0 << ", " << x
374  << " deplam, y = " << deplam << ", " << y << std::endl;
375 
376  double est = (part * betEM * gam(x, alpEM) * lamcurr[i] / (x0curr[i] * tgamEM) +
377  (1. - part) * betHD * gam(y, alpHD) / tgamHD) *
378  lamstep[i];
379 
380  // protection ...
381  if (est < 0.) {
382  LogInfo("FastCalorimetry") << "*** FamosHDShower::makeSteps "
383  << " - negative step energy !!!" << std::endl;
384  break;
385  }
386 
387  // for estimates only
388  sum += est;
389  int nPest = (int)(est * e / sum / eSpotSize);
390 
391  if (debug == 2)
392  LogInfo("FastCalorimetry") << " FamosHDShower::makeSteps - nPoints estimate = " << nPest << std::endl;
393 
394  if (nPest <= 1 && count != 0)
395  break;
396 
397  // good step - to proceed
398 
399  temp.push_back(est);
400  sumes += est;
401 
402  rlamStep.push_back(transParam * (theR1 + (theR2 - theR3 * aloge)) * deplam * transFactor);
403  count++;
404  }
405 
406  // fluctuations in ECAL and re-distribution of remaining energy in HCAL
407  if (detector[0] == 1 && count > 1) {
408  double oldECALenergy = temp[0];
409  double oldHCALenergy = sumes - oldECALenergy;
410  double newECALenergy = 2. * sumes;
411  for (int i = 0; newECALenergy > sumes && i < infinity; i++)
412  newECALenergy = 2. * balanceEH * random->flatShoot() * oldECALenergy;
413 
414  if (debug == 2)
415  LogInfo("FastCalorimetry") << "*** FamosHDShower::makeSteps "
416  << " ECAL fraction : old/new - " << oldECALenergy / sumes << "/"
417  << newECALenergy / sumes << std::endl;
418 
419  temp[0] = newECALenergy;
420  double newHCALenergy = sumes - newECALenergy;
421  double newHCALreweight = newHCALenergy / oldHCALenergy;
422 
423  for (int i = 1; i < count; i++) {
424  temp[i] *= newHCALreweight;
425  }
426  }
427 
428  // final re-normalization of the energy fractions
429  for (int i = 0; i < count; i++) {
430  eStep.push_back(temp[i] * e / sumes);
431  nspots.push_back((int)(eStep[i] / eSpotSize) + 1);
432 
433  if (debug)
434  LogInfo("FastCalorimetry") << " step " << i << " det: " << detector[i]
435  << " xO and lamdepth at the end of step = " << x0depth[i] << " " << lamdepth[i]
436  << " Estep func = " << eStep[i] << " Rstep = " << rlamStep[i]
437  << " Nspots = " << nspots[i] << " espot = " << eStep[i] / (double)nspots[i]
438  << std::endl;
439  }
440 
441  // The only step is in ECAL - let's make the size bigger ...
442  if (count == 1 and detector[0] == 1)
443  rlamStep[0] *= 2.;
444 
445  if (debug) {
446  if (eStep[0] > 0.95 * e && detector[0] == 1)
447  LogInfo("FastCalorimetry") << " FamosHDShower::makeSteps - "
448  << "ECAL energy = " << eStep[0] << " out of total = " << e << std::endl;
449  }
450 }
451 
453  // TimeMe theT("FamosHDShower::compute");
454 
455  bool status = false;
456  int numLongit = eStep.size();
457  if (debug)
458  LogInfo("FastCalorimetry") << " FamosHDShower::compute - "
459  << " N_long.steps required : " << numLongit << std::endl;
460 
461  if (numLongit > 0) {
462  status = true;
463  // Prepare the trsanverse probability function
464  std::vector<double> Fhist;
465  std::vector<double> rhist;
466  for (int j = 0; j < nTRsteps + 1; j++) {
467  rhist.push_back(maxTRfactor * j / nTRsteps);
468  Fhist.push_back(transProb(maxTRfactor, 1., rhist[j]));
469  if (debug == 3)
470  LogInfo("FastCalorimetry") << "indexFinder - i, Fhist[i] = " << j << " " << Fhist[j] << std::endl;
471  }
472 
473  // Longitudinal steps
474  for (int i = 0; i < numLongit; i++) {
475  double currentDepthL0 = lamtotal[i] - 0.5 * lamstep[i];
476  // vary the longitudinal profile if needed
477  if (detector[i] != 1)
478  currentDepthL0 *= hcalDepthFactor;
479  if (debug)
480  LogInfo("FastCalorimetry") << " FamosHDShower::compute - detector = " << detector[i]
481  << " currentDepthL0 = " << currentDepthL0 << std::endl;
482 
483  double maxTRsize = maxTRfactor * rlamStep[i]; // in lambda units
484  double rbinsize = maxTRsize / nTRsteps;
485  double espot = eStep[i] / (double)nspots[i]; // re-adjust espot
486 
487  if (espot > 2. || espot < 0.)
488  LogInfo("FastCalorimetry") << " FamosHDShower::compute - unphysical espot = " << espot << std::endl;
489 
490  int ecal = 0;
491  if (detector[i] != 1) {
492  bool setHDdepth = theHcalHitMaker->setDepth(currentDepthL0);
493 
494  if (debug)
495  LogInfo("FastCalorimetry") << " FamosHDShower::compute - status of "
496  << " theHcalHitMaker->setDepth(currentDepthL0) is " << setHDdepth << std::endl;
497 
498  if (!setHDdepth) {
499  currentDepthL0 -= lamstep[i];
500  setHDdepth = theHcalHitMaker->setDepth(currentDepthL0);
501  }
502 
503  if (!setHDdepth)
504  continue;
505 
507 
508  //fill hcal longitudinal distribution histogram
509  } else {
510  ecal = 1;
511  bool status = theGrid->getPads(currentDepthL0);
512 
513  if (debug)
514  LogInfo("FastCalorimetry") << " FamosHDShower::compute - status of Grid = " << status << std::endl;
515 
516  if (!status)
517  continue;
518 
519  int ntry = nspots[i] * 10;
520  if (ntry >= infinity) { // use max allowed in case of too many spots
521  nspots[i] = 0.5 * infinity;
522  espot *= 0.1 * (double)ntry / double(nspots[i]);
523  } else {
524  espot *= 0.1; // fine-grain energy spots in ECAL
525  // to avoid false ECAL clustering
526  nspots[i] = ntry;
527  }
528 
529  theGrid->setSpotEnergy(espot);
530 
531  //fill ecal longitudinal distribution histogram
532  }
533 
534  // Transverse distribition
535  int nok = 0; // counter of OK
536  int count = 0;
537  int inf = infinity;
538  if (lossesOpt)
539  inf = nspots[i]; // if losses are enabled, otherwise
540  // only OK points are counted ...
541  if (nspots[i] > inf)
542  std::cout << " FamosHDShower::compute - at long.step " << i << " too many spots required : " << nspots[i]
543  << " !!! " << std::endl;
544 
545  for (int j = 0; j < inf; j++) {
546  if (nok == nspots[i])
547  break;
548  count++;
549 
550  double prob = random->flatShoot();
551  int index = indexFinder(prob, Fhist);
552  double radius = rlamStep[i] * rhist[index] + random->flatShoot() * rbinsize; // in-bin
553  double phi = 2. * M_PI * random->flatShoot();
554 
555  if (debug == 2)
556  LogInfo("FastCalorimetry") << std::endl
557  << " FamosHDShower::compute "
558  << " r = " << radius << " phi = " << phi << std::endl;
559 
560  bool result;
561  if (ecal) {
562  result = theGrid->addHit(radius, phi, 0);
563 
564  if (debug == 2)
565  LogInfo("FastCalorimetry") << " FamosHDShower::compute - "
566  << " theGrid->addHit result = " << result << std::endl;
567 
568  //fill ecal transverse distribution histogram
569  } else {
571 
572  if (debug == 2)
573  LogInfo("FastCalorimetry") << " FamosHDShower::compute - "
574  << " theHcalHitMaker->addHit result = " << result << std::endl;
575 
576  //fill hcal transverse distribution histogram
577  }
578 
579  if (result)
580  nok++;
581 
582  } // end of tranverse simulation
583 
584  if (count == infinity) {
585  if (debug)
586  LogInfo("FastCalorimetry") << " FamosHDShower::compute "
587  << " maximum number of"
588  << " transverse points " << count << " is used !!!" << std::endl;
589  }
590 
591  if (debug)
592  LogInfo("FastCalorimetry") << " FamosHDShower::compute "
593  << " long.step No." << i << " Ntry, Nok = " << count << " " << nok << std::endl;
594  } // end of longitudinal steps
595  } // end of no steps
596 
597  return status;
598 }
599 
600 int HDShower::indexFinder(double x, const std::vector<double>& Fhist) {
601  // binary search in the vector of doubles
602  int size = Fhist.size();
603 
604  int curr = size / 2;
605  int step = size / 4;
606  int iter;
607  int prevdir = 0;
608  int actudir = 0;
609 
610  for (iter = 0; iter < size; iter++) {
611  if (curr >= size || curr < 1)
612  LogWarning("FastCalorimetry") << " FamosHDShower::indexFinder - wrong current index = " << curr << " !!!"
613  << std::endl;
614 
615  if ((x <= Fhist[curr]) && (x > Fhist[curr - 1]))
616  break;
617  prevdir = actudir;
618  if (x > Fhist[curr]) {
619  actudir = 1;
620  } else {
621  actudir = -1;
622  }
623  if (prevdir * actudir < 0) {
624  if (step > 1)
625  step /= 2;
626  }
627  curr += actudir * step;
628  if (curr > size)
629  curr = size;
630  else {
631  if (curr < 1) {
632  curr = 1;
633  }
634  }
635 
636  if (debug == 3)
637  LogInfo("FastCalorimetry") << " indexFinder - end of iter." << iter << " curr, F[curr-1], F[curr] = " << curr
638  << " " << Fhist[curr - 1] << " " << Fhist[curr] << std::endl;
639  }
640 
641  if (debug == 3)
642  LogInfo("FastCalorimetry") << " indexFinder x = " << x << " found index = " << curr - 1 << std::endl;
643 
644  return curr - 1;
645 }
size
Write out results.
double ecalHcalGapTotalL0() const
ECAL-HCAL transition.
Definition: EcalHitMaker.h:91
HDShower(const RandomEngineAndDistribution *engine, HDShowerParametrization *myParam, EcalHitMaker *myGrid, HcalHitMaker *myHcalHitMaker, int onECAL, double epart, double pmip)
Definition: HDShower.cc:21
double depthStart
Definition: HDShower.h:75
EcalHitMaker * theGrid
Definition: HDShower.h:86
double radLenIncm() const override
Radiation length in cm.
bool addHit(double r, double phi, unsigned layer=0) override
double balanceEH
Definition: HDShower.h:119
double eSpotSize
Definition: HDShower.h:111
double radLenIncm() const override
Radiation length in cm.
double betEM
Definition: HDShower.h:71
double maxTRfactor
Definition: HDShower.h:117
double getHDtransParam() const
Definition: HSParameters.h:22
double criticalEnergy
Definition: HDShower.h:115
const ECALProperties * theECALproperties
Definition: HDShower.h:66
double ecalTotalL0() const
in the ECAL
Definition: EcalHitMaker.h:85
double depthGAP
Definition: HDShower.h:127
std::vector< double > lamstep
Definition: HDShower.h:81
int nTRsteps
Definition: HDShower.h:105
double x0EM
Definition: HDShower.h:74
bool compute()
Compute the shower longitudinal and lateral development.
Definition: HDShower.cc:452
double theR3
Definition: HDShower.h:70
std::vector< double > x0curr
Definition: HDShower.h:80
double getHDmaxTRfactor() const
Definition: HSParameters.h:26
double interactionLength() const override
Interaction length in cm.
double getHDcriticalEnergy() const
Definition: HSParameters.h:25
double betHD
Definition: HDShower.h:71
double getHDbalanceEH() const
Definition: HSParameters.h:27
int getHDnDepthSteps() const
Definition: HSParameters.h:20
#define debug
Definition: HDShower.cc:17
double theR1
Definition: HDShower.h:70
double theR2
Definition: HDShower.h:70
std::vector< double > lamdepth
Definition: HDShower.h:81
bool addHit(double r, double phi, unsigned layer=0) override
add the hit in the HCAL in local coordinates
Definition: HcalHitMaker.cc:30
std::vector< double > lamcurr
Definition: HDShower.h:81
double hcalDepthFactor
Definition: HDShower.h:121
double lambdaHD
Definition: HDShower.h:74
int onEcal
Definition: HDShower.h:92
int getHDlossesOpt() const
Definition: HSParameters.h:19
string inf
Definition: EcalCondDB.py:96
double transProb(double factor, double R, double r)
Definition: HDShower.h:53
double depthECAL
Definition: HDShower.h:127
std::vector< double > x0depth
Definition: HDShower.h:80
HDShowerParametrization * theParam
Definition: HDShower.h:63
double gam(double x, double a) const
Definition: HDShower.h:48
int infinity
Definition: HDShower.h:83
int mip
Definition: HDShower.h:95
int nDepthSteps
Definition: HDShower.h:103
void setSpotEnergy(double e) override
Set the spot energy.
Definition: HcalHitMaker.h:26
double depthGAPx0
Definition: HDShower.h:127
const HSParameters * hsParameters() const
double getHDdepthStep() const
Definition: HSParameters.h:24
double depthHCAL
Definition: HDShower.h:127
double aloge
Definition: HDShower.h:76
double ecalHcalGapTotalX0() const
ECAL-HCAL transition.
Definition: EcalHitMaker.h:70
#define M_PI
double tgamHD
Definition: HDShower.h:71
Log< level::Info, false > LogInfo
double alpEM
Definition: HDShower.h:71
double transParam
Definition: HDShower.h:107
std::vector< int > nspots
Definition: HDShower.h:78
part
Definition: HCALResponse.h:20
double alpHD
Definition: HDShower.h:71
double depthStep
Definition: HDShower.h:113
const HCALProperties * hcalProperties() const
HcalHitMaker * theHcalHitMaker
Definition: HDShower.h:89
std::vector< int > detector
Definition: HDShower.h:78
double transFactor
Definition: HDShower.h:109
std::vector< double > lamtotal
Definition: HDShower.h:81
bool getPads(double depth, bool inCm=false)
int lossesOpt
Definition: HDShower.h:101
double hcalTotalL0() const
in the HCAL
Definition: EcalHitMaker.h:88
double getHDeSpotSize() const
Definition: HSParameters.h:23
HLT enums.
double e
Definition: HDShower.h:98
const RandomEngineAndDistribution * random
Definition: HDShower.h:124
double getHDhcalDepthFactor() const
Definition: HSParameters.h:28
const ECALProperties * ecalProperties() const
double depthToHCAL
Definition: HDShower.h:127
float x
const HCALProperties * theHCALproperties
Definition: HDShower.h:67
std::vector< double > eStep
Definition: HDShower.h:79
int indexFinder(double x, const std::vector< double > &Fhist)
Definition: HDShower.cc:600
step
Definition: StallMonitor.cc:83
double lambdaEM
Definition: HDShower.h:74
double flatShoot(double xmin=0.0, double xmax=1.0) const
Log< level::Warning, false > LogWarning
std::vector< double > rlamStep
Definition: HDShower.h:79
double interactionLength() const override
Interaction length in cm: 18.5 for Standard ECAL.
void makeSteps(int nsteps)
Definition: HDShower.cc:355
double tgamEM
Definition: HDShower.h:71
int getHDnTRsteps() const
Definition: HSParameters.h:21
bool setDepth(double, bool inCm=false)
set the depth in X0 or Lambda0 units depending on showerType
void setSpotEnergy(double e) override
Definition: EcalHitMaker.h:112
double x0HD
Definition: HDShower.h:74