00001 #ifndef HDShower_H
00002 #define HDShower_H
00003
00004
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
00022 class HDShower
00023 {
00024
00025 public:
00026
00027 typedef math::XYZVector XYZPoint;
00028
00029 typedef std::pair<XYZPoint,double> Spot;
00030 typedef std::pair<unsigned int, double> Step;
00031 typedef std::vector<Step> Steps;
00032 typedef Steps::const_iterator step_iterator;
00033
00034 HDShower(const RandomEngine* engine,
00035 HDShowerParametrization* myParam,
00036 EcalHitMaker* myGrid,
00037 HcalHitMaker* myHcalHitMaker,
00038 int onECAL,
00039 double epart);
00040
00041 int getmip() {return mip;}
00042
00043 virtual ~HDShower() {;}
00044
00046 bool compute();
00047
00048 private:
00049
00050
00051 double gam(double x, double a) const { return pow(x,a-1.)*exp(-x); }
00052
00053
00054
00055
00056 double transProb(double factor, double R, double r) {
00057 double fsq = factor * factor;
00058 return ((fsq + 1.)/fsq) * r * r / (r*r + R*R) ;
00059 }
00060
00061 void makeSteps(int nsteps);
00062
00063 int indexFinder(double x, const std::vector<double> & Fhist);
00064
00065
00066 HDShowerParametrization* theParam;
00067
00068
00069 const ECALProperties* theECALproperties;
00070 const HCALProperties* theHCALproperties;
00071
00072
00073 double theR1, theR2, theR3;
00074 double alpEM, betEM, alpHD, betHD, part, tgamEM, tgamHD;
00075
00076
00077 double lambdaEM, lambdaHD, x0EM, x0HD;
00078 double depthStart;
00079 double aloge;
00080
00081 std::vector<int> detector, nspots;
00082 std::vector<double> eStep, rlamStep;
00083 std::vector<double> x0curr, x0depth;
00084 std::vector<double> lamstep, lamcurr, lamdepth, lamtotal;
00085
00086 int infinity;
00087
00088
00089 EcalHitMaker * theGrid;
00090
00091
00092 HcalHitMaker * theHcalHitMaker;
00093
00094
00095 int onEcal;
00096
00097
00098 int mip;
00099
00100
00101 double e;
00102
00103
00104 int lossesOpt;
00105
00106 int nDepthSteps;
00107
00108 int nTRsteps;
00109
00110 double transParam;
00111
00112 double transFactor;
00113
00114 double eSpotSize;
00115
00116 double depthStep;
00117
00118 double criticalEnergy;
00119
00120 double maxTRfactor;
00121
00122 double balanceEH;
00123
00124 double hcalDepthFactor;
00125
00126
00127 const RandomEngine* random;
00128
00129 };
00130
00131 #endif