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