Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:45

0001 #ifndef HFShower_H
0002 #define HFShower_H
0003 
0004 //FastSimulation Headers
0005 #include "FastSimulation/ShowerDevelopment/interface/HDShowerParametrization.h"
0006 
0007 #include "DataFormats/Math/interface/Vector3D.h"
0008 
0009 #include <vector>
0010 
0011 /**
0012  * \author Salavat Abdullin
0013  * \date: 21-Oct-2004
0014  * \parameterized hadronic shower simulation
0015  * \based on paper G.Gridhammer, M.Rudowicz, S.Peters, SLAC-PUB-5072
0016  */
0017 
0018 class EcalHitMaker;
0019 class HcalHitMaker;
0020 class RandomEngineAndDistribution;
0021 
0022 class HFShower {
0023 public:
0024   typedef math::XYZVector XYZPoint;
0025 
0026   typedef std::pair<XYZPoint, double> Spot;
0027   typedef std::pair<unsigned int, double> Step;
0028   typedef std::vector<Step> Steps;
0029   typedef Steps::const_iterator step_iterator;
0030 
0031   HFShower(const RandomEngineAndDistribution* engine,
0032            HDShowerParametrization* myParam,
0033            EcalHitMaker* myGrid,
0034            HcalHitMaker* myHcalHitMaker,
0035            int onECAL,
0036            double epart);
0037 
0038   virtual ~HFShower() { ; }
0039 
0040   /// Compute the shower longitudinal and lateral development
0041   bool compute();
0042 
0043 private:
0044   // The longitudinal development ersatzt.
0045   double gam(double x, double a) const { return pow(x, a - 1.) * exp(-x); }
0046 
0047   // Transverse integrated probability function (for 4R max size)
0048   // integral of the transverse ansatz f(r) =  2rR/(r**2 + R**2)**2 ->
0049   // 1/R - R/(R**2+r**2) | at limits 4R - 0
0050   double transProb(double factor, double R, double r) {
0051     double fsq = factor * factor;
0052     return ((fsq + 1.) / fsq) * r * r / (r * r + R * R);
0053   }
0054   // Compute longE[i] and transR[i] for all nsteps
0055   void makeSteps(int nsteps);
0056 
0057   int indexFinder(double x, const std::vector<double>& Fhist);
0058 
0059   // The parametrization
0060   HDShowerParametrization* theParam;
0061 
0062   // The Calorimeter properties
0063   const ECALProperties* theECALproperties;
0064   const HCALProperties* theHCALproperties;
0065 
0066   // Basic parameters of the simulation
0067   double theR1, theR2, theR3;
0068   double alpEM, betEM, alpHD, betHD, part, tgamEM, tgamHD;
0069 
0070   // The basic quantities for the shower development.
0071   double lambdaEM, lambdaHD, x0EM, x0HD;
0072   double depthStart;
0073   double aloge;
0074 
0075   std::vector<int> detector, nspots;
0076   std::vector<double> eStep, rlamStep;
0077   std::vector<double> x0curr, x0depth;
0078   std::vector<double> lamstep, lamcurr, lamdepth, lamtotal;
0079 
0080   int infinity;  // big number of cycles if exit is on a special condition
0081 
0082   // The crystal grid
0083   EcalHitMaker* theGrid;
0084 
0085   // The HCAL
0086   HcalHitMaker* theHcalHitMaker;
0087 
0088   // OnECAL flag as an input parameter ...
0089   int onEcal;
0090 
0091   // Input energy to distribute
0092   double e;
0093 
0094   // HCAL losses option (0-off, 1-on)
0095   int lossesOpt;
0096   // Number of longitudinal steps in HCAL
0097   int nDepthSteps;
0098   // Number of bins in the transverse probability histogram
0099   int nTRsteps;
0100   // Transverse size tuning factor
0101   double transParam;
0102   // Transverse normalization : 1 for HB/HE, 0.5 for HF (narrow showers)
0103   double transFactor;
0104   // HCAL energy spot size
0105   double eSpotSize;
0106   // Longitudinal step size (lambda units)
0107   double depthStep;
0108   // Energy threshold (one depth step -> nDepthSteps);
0109   double criticalEnergy;
0110   // Transverse size cut (in character transverse size units)
0111   double maxTRfactor;
0112   // Balance between ECAL and HCAL "visible" energy (default = 1.)
0113   double balanceEH;
0114   // Regulator of HCAL depth of the shower (to adjust/shrink it to CMS depth)
0115   double hcalDepthFactor;
0116 
0117   // Famos Random Engine
0118   const RandomEngineAndDistribution* random;
0119 };
0120 
0121 #endif