File indexing completed on 2024-04-06 12:11:13
0001 #ifndef HCALResponse_h
0002 #define HCALResponse_h
0003
0004
0005
0006
0007
0008
0009
0010 #include "FastSimulation/Utilities/interface/DoubleCrystalBallGenerator.h"
0011 #include <vector>
0012 #include <string>
0013
0014
0015 typedef std::vector<double> vec1;
0016 typedef std::vector<vec1> vec2;
0017 typedef std::vector<vec2> vec3;
0018 typedef std::vector<vec3> vec4;
0019 typedef std::vector<vec4> vec5;
0020 enum part { hcbarrel = 0, hcendcap = 1, hcforward = 2 };
0021 enum type { ECAL = 0, HCAL = 1, VFCAL = 2 };
0022
0023 class RandomEngineAndDistribution;
0024
0025 namespace edm {
0026 class ParameterSet;
0027 }
0028
0029 class HCALResponse {
0030 public:
0031 HCALResponse(const edm::ParameterSet& pset);
0032 ~HCALResponse() {}
0033
0034
0035
0036
0037 double responseHCAL(int _mip, double energy, double eta, int partype, RandomEngineAndDistribution const*);
0038
0039
0040 double getMIPfraction(double energy, double eta);
0041
0042
0043 double getHCALEnergyResponse(double e, int hit, RandomEngineAndDistribution const*);
0044
0045
0046 void correctHF(double e, int type);
0047 vec1& getCorrHFem() { return corrHFem; }
0048 vec1& getCorrHFhad() { return corrHFhad; }
0049
0050 private:
0051
0052
0053 double interHD(int mip, double e, int ie, int ieta, int det, RandomEngineAndDistribution const*);
0054 double interEM(double e, int ie, int ieta, RandomEngineAndDistribution const*);
0055 double interMU(double e, int ie, int ieta, RandomEngineAndDistribution const*);
0056
0057
0058 double gaussShootNoNegative(double e, double sigma, RandomEngineAndDistribution const*);
0059 double cballShootNoNegative(
0060 double mu, double sigma, double aL, double nL, double aR, double nR, RandomEngineAndDistribution const*);
0061 double PoissonShootNoNegative(double e, double sigma, RandomEngineAndDistribution const*);
0062
0063
0064 int getDet(int ieta);
0065
0066
0067 bool debug, usemip;
0068
0069
0070
0071
0072
0073 double RespPar[3][2][3];
0074
0075
0076 double eResponseScale[3];
0077 double eResponsePlateau[3];
0078 double eResponseExponent;
0079 double eResponseCoefficient;
0080
0081
0082 int maxMUe, maxMUeta, maxMUbin, maxEMe, maxEMeta;
0083 int maxHDe[4];
0084
0085 double etaStep;
0086
0087 int HDeta[4], maxHDetas[3], barrelMUeta, endcapMUeta;
0088
0089 double muStep;
0090
0091 double respFactorEM;
0092
0093
0094 vec1 eGridHD[4];
0095 vec1 eGridEM;
0096 vec1 eGridMU;
0097 vec1 etaGridMU;
0098
0099
0100
0101 int nPar;
0102 std::vector<std::string> parNames;
0103 vec5 parameters;
0104
0105
0106
0107 vec2 meanEM, sigmaEM;
0108
0109
0110
0111 vec3 responseMU;
0112 vec3 mipfraction;
0113 vec3 PoissonParameters;
0114
0115
0116 DoubleCrystalBallGenerator cball;
0117
0118
0119 int maxEta, maxEne;
0120 vec1 energyHF;
0121 vec2 corrHFgEm, corrHFgHad;
0122 vec2 corrHFhEm, corrHFhHad;
0123 vec1 corrHFem, corrHFhad;
0124 };
0125 #endif