CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/FastSimulation/ShowerDevelopment/interface/EMShower.h

Go to the documentation of this file.
00001 #ifndef EMShower_H
00002 #define EMShower_H
00003 
00004 #include "FastSimulation/Particle/interface/RawParticle.h"
00005 
00006 //Famos Headers
00007 #include "FastSimulation/ShowerDevelopment/interface/EMECALShowerParametrization.h"
00008 #include "FastSimulation/ShowerDevelopment/interface/RadialInterval.h"
00009 #include "CLHEP/GenericFunctions/IncompleteGamma.hh"
00010 #include "DataFormats/Math/interface/Vector3D.h"
00011 
00012 #include <vector>
00013 
00019 class EcalHitMaker;
00020 class PreshowerHitMaker;
00021 class HcalHitMaker;
00022 class GammaDistributionGenerator;
00023 class RandomEngine;
00024 class GammaFunctionGenerator;
00025 
00026 class EMShower 
00027 {
00028 
00029   typedef math::XYZVector XYZPoint;
00030 
00031   typedef std::pair<XYZPoint,double> Spot;
00032   typedef std::pair<unsigned int, double> Step;
00033   typedef std::vector<Step> Steps;
00034   typedef Steps::const_iterator step_iterator;
00035 
00036  public:
00037 
00038   EMShower(const RandomEngine* engine,
00039            GammaFunctionGenerator* gamma,
00040            EMECALShowerParametrization* const myParam,
00041            std::vector<const RawParticle*>* const myPart,
00042            EcalHitMaker  * const myGrid=NULL,
00043            PreshowerHitMaker * const myPreshower=NULL);
00044 
00045   virtual ~EMShower(){;}
00046 
00048   void prepareSteps();
00049 
00051   void compute();
00052 
00054   //  inline double getMeanDepth() const {return globalMeanDepth;};  
00055 
00057   inline double getMaximumOfShower() const {return globalMaximum;}
00058 
00060   void setGrid(EcalHitMaker * const myGrid) { theGrid=myGrid;}
00061 
00063   void setPreshower(PreshowerHitMaker * const myPresh ) ;
00064 
00066   void setHcal(HcalHitMaker * const myHcal);
00067 
00068  private:
00069 
00070   // The longitudinal development ersatzt.
00071   double gam(double x, double a) const;
00072 
00073   // Energy deposited in the layer t-dt-> t, in units of E0 (initial energy)
00074   double deposit(double t, double a, double b, double dt);
00075 
00076   // Energy deposited between 0 and t, in units of E0 (initial energy)
00077   double deposit(double a, double b, double t);
00078 
00079   // Set the intervals for the radial development
00080   void setIntervals(unsigned icomp,RadialInterval& rad);
00081   
00082   // The parametrization
00083   EMECALShowerParametrization* const theParam;
00084 
00085   // The Calorimeter properties
00086   const ECALProperties* theECAL;
00087   const HCALProperties* theHCAL;
00088   const PreshowerLayer1Properties* theLayer1;
00089   const PreshowerLayer2Properties* theLayer2;
00090 
00091   // The incident particle(s)
00092   std::vector<const RawParticle*>* const thePart;
00093   unsigned int nPart;
00094 
00095   // The basic quantities for the shower development.
00096   std::vector<double> theNumberOfSpots;
00097   std::vector<double> Etot;
00098   std::vector<double> E; 
00099   std::vector<double> photos;
00100   std::vector<double> T;
00101   std::vector<double> a; 
00102   std::vector<double> b;
00103   std::vector<double> Ti; 
00104   std::vector<double> TSpot;
00105   std::vector<double> aSpot; 
00106   std::vector<double> bSpot;
00107 
00108   // F.B : Use the maximum of the shower rather the center of gravity 
00109   //  std::vector<double> meanDepth;  
00110   //  double globalMeanDepth;
00111   std::vector<double> maximumOfShower;
00112   std::vector<std::vector<double> >depositedEnergy;
00113   std::vector<double> meanDepth;
00114   double innerDepth, outerDepth;
00115   
00116   double globalMaximum;
00117 
00118   double totalEnergy;
00119 
00120   // The steps for the longitudinal development
00121   Steps steps; 
00122   unsigned nSteps;
00123   bool stepsCalculated;
00124 
00125   // The crystal grid
00126   EcalHitMaker * theGrid;
00127 
00128   // The preshower 
00129   PreshowerHitMaker * thePreshower;
00130 
00131   // The HCAL hitmaker
00132   HcalHitMaker * theHcalHitMaker;
00133 
00134   // Is there a preshower ? 
00135   bool hasPreshower;
00136   // Histos
00137   //  Histos* myHistos;
00138 
00139   Genfun::IncompleteGamma myIncompleteGamma;
00140 
00141   // Random engine
00142   const RandomEngine* random;
00143 
00144   // integer gamma function generator
00145   GammaFunctionGenerator * myGammaGenerator;
00146 
00147   
00148   
00149 };
00150 
00151 #endif