CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/FastSimulation/ShowerDevelopment/interface/HDShower.h

Go to the documentation of this file.
00001 #ifndef HDShower_H
00002 #define HDShower_H
00003 
00004 //FastSimulation Headers
00005 #include "FastSimulation/ShowerDevelopment/interface/HDShowerParametrization.h"
00006 
00007 #include "DataFormats/Math/interface/Vector3D.h"
00008 
00009 #include <vector>
00010 
00018 class EcalHitMaker;
00019 class HcalHitMaker;
00020 class RandomEngine;
00021 
00022 class HDShower 
00023 {
00024 
00025  public:
00026 
00027   typedef math::XYZVector XYZPoint;
00028 
00029   typedef std::pair<XYZPoint,double> Spot;
00030   typedef std::pair<unsigned int, double> Step;
00031   typedef std::vector<Step> Steps;
00032   typedef Steps::const_iterator step_iterator;
00033 
00034   HDShower(const RandomEngine* engine,
00035            HDShowerParametrization* myParam,
00036            EcalHitMaker* myGrid, 
00037            HcalHitMaker* myHcalHitMaker,
00038            int onECAL, 
00039            double epart);
00040 
00041   int getmip() {return mip;}
00042 
00043   virtual ~HDShower() {;}
00044 
00046   bool compute();
00047 
00048  private:
00049 
00050   // The longitudinal development ersatzt.
00051   double gam(double x, double a) const { return pow(x,a-1.)*exp(-x); }
00052 
00053   // Transverse integrated probability function (for 4R max size)
00054   // integral of the transverse ansatz f(r) =  2rR/(r**2 + R**2)**2 ->
00055   // 1/R - R/(R**2+r**2) | at limits 4R - 0
00056   double transProb(double factor, double R, double r) {
00057     double fsq = factor * factor; 
00058     return ((fsq + 1.)/fsq) * r * r / (r*r + R*R) ; 
00059   }
00060   // Compute longE[i] and transR[i] for all nsteps
00061   void makeSteps(int nsteps);
00062 
00063   int indexFinder(double x, const std::vector<double> & Fhist);  
00064 
00065   // The parametrization
00066   HDShowerParametrization* theParam;
00067 
00068   // The Calorimeter properties
00069   const ECALProperties* theECALproperties;
00070   const HCALProperties* theHCALproperties;
00071 
00072   // Basic parameters of the simulation
00073   double theR1, theR2, theR3;
00074   double alpEM, betEM, alpHD, betHD, part, tgamEM, tgamHD;
00075 
00076   // The basic quantities for the shower development.
00077   double lambdaEM, lambdaHD, x0EM, x0HD;
00078   double depthStart;
00079   double aloge;
00080 
00081   std::vector<int>    detector, nspots;
00082   std::vector<double> eStep, rlamStep;
00083   std::vector<double> x0curr, x0depth;
00084   std::vector<double> lamstep, lamcurr, lamdepth, lamtotal;
00085   
00086   int infinity; // big number of cycles if exit is on a special condition
00087 
00088   // The crystal grid
00089   EcalHitMaker * theGrid;
00090 
00091   // The HCAL 
00092   HcalHitMaker * theHcalHitMaker;
00093 
00094   // OnECAL flag as an input parameter ... 
00095   int onEcal;
00096 
00097   // MIP in ECAL map flag
00098   int mip;
00099 
00100   // Input energy to distribute
00101   double e;
00102 
00103   // HCAL losses option (0-off, 1-on)
00104   int lossesOpt;
00105   // Number of longitudinal steps in HCAL
00106   int nDepthSteps;
00107   // Number of bins in the transverse probability histogram
00108   int nTRsteps;
00109   // Transverse size tuning factor 
00110   double transParam;
00111   // Transverse normalization : 1 for HB/HE, 0.5 for HF (narrow showers)
00112   double transFactor;
00113   // HCAL energy spot size
00114   double eSpotSize;
00115   // Longitudinal step size (lambda units)
00116   double depthStep;
00117   // Energy threshold (one depth step -> nDepthSteps);
00118   double criticalEnergy;
00119   // Transverse size cut (in character transverse size units)
00120   double maxTRfactor;
00121   // Balance between ECAL and HCAL "visible" energy (default = 1.)
00122   double balanceEH;
00123   // Regulator of HCAL depth of the shower (to adjust/shrink it to CMS depth) 
00124   double hcalDepthFactor;
00125 
00126   // Famos Random Engine
00127   const RandomEngine* random;
00128   
00129 };
00130 
00131 #endif