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
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
0016
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
0046 void prepareSteps();
0047
0048
0049 void compute();
0050
0051
0052
0053
0054
0055 inline double getMaximumOfShower() const { return globalMaximum; }
0056
0057
0058 void setGrid(EcalHitMaker* const myGrid) { theGrid = myGrid; }
0059
0060
0061 void setPreshower(PreshowerHitMaker* const myPresh);
0062
0063
0064 void setHcal(HcalHitMaker* const myHcal);
0065
0066 private:
0067
0068 double gam(double x, double a) const;
0069
0070
0071 double deposit(double t, double a, double b, double dt);
0072
0073
0074 double deposit(double a, double b, double t);
0075
0076
0077 void setIntervals(unsigned icomp, RadialInterval& rad);
0078
0079
0080 EMECALShowerParametrization* const theParam;
0081
0082
0083 const ECALProperties* theECAL;
0084 const HCALProperties* theHCAL;
0085 const PreshowerLayer1Properties* theLayer1;
0086 const PreshowerLayer2Properties* theLayer2;
0087
0088
0089 std::vector<const RawParticle*>* const thePart;
0090 unsigned int nPart;
0091
0092
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
0106
0107
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
0118 Steps steps;
0119 unsigned nSteps;
0120 bool stepsCalculated;
0121
0122
0123 EcalHitMaker* theGrid;
0124
0125
0126 PreshowerHitMaker* thePreshower;
0127
0128
0129 HcalHitMaker* theHcalHitMaker;
0130
0131
0132 bool hasPreshower;
0133
0134
0135
0136 Genfun::IncompleteGamma myIncompleteGamma;
0137
0138
0139 const RandomEngineAndDistribution* random;
0140
0141
0142 GammaFunctionGenerator* myGammaGenerator;
0143
0144 bool bFixedLength_;
0145 };
0146
0147 #endif