CMS 3D CMS Logo

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