CMS 3D CMS Logo

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