Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:19

0001 #ifndef EMShower_H
0002 #define EMShower_H
0003 
0004 #include "CommonTools/BaseParticlePropagator/interface/RawParticle.h"
0005 
0006 //Famos Headers
0007 #include "FastSimulation/ShowerDevelopment/interface/EMECALShowerParametrization.h"
0008 #include "FastSimulation/ShowerDevelopment/interface/RadialInterval.h"
0009 #include "CLHEP/GenericFunctions/IncompleteGamma.hh"
0010 #include "DataFormats/Math/interface/Vector3D.h"
0011 
0012 #include <vector>
0013 
0014 /** 
0015  * \author Patrick Janot
0016  * \date: 25-Jan-2004
0017  */
0018 
0019 class EcalHitMaker;
0020 class PreshowerHitMaker;
0021 class HcalHitMaker;
0022 class GammaDistributionGenerator;
0023 class RandomEngineAndDistribution;
0024 class GammaFunctionGenerator;
0025 
0026 class EMShower {
0027   typedef math::XYZVector XYZPoint;
0028 
0029   typedef std::pair<XYZPoint, double> Spot;
0030   typedef std::pair<unsigned int, double> Step;
0031   typedef std::vector<Step> Steps;
0032   typedef Steps::const_iterator step_iterator;
0033 
0034 public:
0035   EMShower(RandomEngineAndDistribution const* engine,
0036            GammaFunctionGenerator* gamma,
0037            EMECALShowerParametrization* const myParam,
0038            std::vector<const RawParticle*>* const myPart,
0039            EcalHitMaker* const myGrid = nullptr,
0040            PreshowerHitMaker* const myPreshower = nullptr,
0041            bool bFixedLength = false);
0042 
0043   virtual ~EMShower() { ; }
0044 
0045   /// Computes the steps before the real compute
0046   void prepareSteps();
0047 
0048   /// Compute the shower longitudinal and lateral development
0049   void compute();
0050 
0051   /// get the depth of the centre of gravity of the shower(s)
0052   //  inline double getMeanDepth() const {return globalMeanDepth;};
0053 
0054   /// get the depth of the maximum of the shower
0055   inline double getMaximumOfShower() const { return globalMaximum; }
0056 
0057   /// set the grid address
0058   void setGrid(EcalHitMaker* const myGrid) { theGrid = myGrid; }
0059 
0060   /// set the preshower address
0061   void setPreshower(PreshowerHitMaker* const myPresh);
0062 
0063   /// set the HCAL address
0064   void setHcal(HcalHitMaker* const myHcal);
0065 
0066 private:
0067   // The longitudinal development ersatzt.
0068   double gam(double x, double a) const;
0069 
0070   // Energy deposited in the layer t-dt-> t, in units of E0 (initial energy)
0071   double deposit(double t, double a, double b, double dt);
0072 
0073   // Energy deposited between 0 and t, in units of E0 (initial energy)
0074   double deposit(double a, double b, double t);
0075 
0076   // Set the intervals for the radial development
0077   void setIntervals(unsigned icomp, RadialInterval& rad);
0078 
0079   // The parametrization
0080   EMECALShowerParametrization* const theParam;
0081 
0082   // The Calorimeter properties
0083   const ECALProperties* theECAL;
0084   const HCALProperties* theHCAL;
0085   const PreshowerLayer1Properties* theLayer1;
0086   const PreshowerLayer2Properties* theLayer2;
0087 
0088   // The incident particle(s)
0089   std::vector<const RawParticle*>* const thePart;
0090   unsigned int nPart;
0091 
0092   // The basic quantities for the shower development.
0093   std::vector<double> theNumberOfSpots;
0094   std::vector<double> Etot;
0095   std::vector<double> E;
0096   std::vector<double> photos;
0097   std::vector<double> T;
0098   std::vector<double> a;
0099   std::vector<double> b;
0100   std::vector<double> Ti;
0101   std::vector<double> TSpot;
0102   std::vector<double> aSpot;
0103   std::vector<double> bSpot;
0104 
0105   // F.B : Use the maximum of the shower rather the center of gravity
0106   //  std::vector<double> meanDepth;
0107   //  double globalMeanDepth;
0108   std::vector<double> maximumOfShower;
0109   std::vector<std::vector<double> > depositedEnergy;
0110   std::vector<double> meanDepth;
0111   double innerDepth, outerDepth;
0112 
0113   double globalMaximum;
0114 
0115   double totalEnergy;
0116 
0117   // The steps for the longitudinal development
0118   Steps steps;
0119   unsigned nSteps;
0120   bool stepsCalculated;
0121 
0122   // The crystal grid
0123   EcalHitMaker* theGrid;
0124 
0125   // The preshower
0126   PreshowerHitMaker* thePreshower;
0127 
0128   // The HCAL hitmaker
0129   HcalHitMaker* theHcalHitMaker;
0130 
0131   // Is there a preshower ?
0132   bool hasPreshower;
0133   // Histos
0134 
0135   //  Histos* myHistos;
0136   Genfun::IncompleteGamma myIncompleteGamma;
0137 
0138   // Random engine
0139   const RandomEngineAndDistribution* random;
0140 
0141   // integer gamma function generator
0142   GammaFunctionGenerator* myGammaGenerator;
0143 
0144   bool bFixedLength_;
0145 };
0146 
0147 #endif