CMS 3D CMS Logo

EMECALShowerParametrization.h
Go to the documentation of this file.
1 #ifndef EMECALShowerParametrization_H
2 #define EMECALShowerParametrization_H
3 
8 
16 #include <vector>
17 #include <cmath>
18 
20 public:
22  const HCALProperties* hcal,
23  const PreshowerLayer1Properties* layer1,
24  const PreshowerLayer2Properties* layer2,
25  const std::vector<double>& coreIntervals,
26  const std::vector<double>& tailIntervals,
27  double RCFact = 1.,
28  double RTFact = 1.)
29  : theECAL(ecal),
30  theHCAL(hcal),
31  theLayer1(layer1),
32  theLayer2(layer2),
33  theCore(coreIntervals),
34  theTail(tailIntervals),
35  theRcfactor(RCFact),
36  theRtfactor(RTFact) {}
37 
39 
40  //====== Longitudinal profiles =======
41 
42  // -------- Average -------
43 
44  inline double meanT(double lny) const {
45  if (theECAL->isHom())
46  return meanTHom(lny);
47  return meanTSam(lny);
48  }
49 
50  inline double meanAlpha(double lny) const {
51  if (theECAL->isHom())
52  return meanAlphaHom(lny);
53  return meanAlphaSam(lny);
54  }
55 
56  // Average Homogeneous
57 
58  inline double meanTHom(double lny) const { return lny - 0.858; }
59  //return lny-1.23; }
60 
61  inline double meanAlphaHom(double lny) const { return 0.21 + (0.492 + 2.38 / theECAL->theZeff()) * lny; }
62 
63  // Average sampling
64 
65  inline double meanTSam(double lny) const {
66  return meanTHom(lny) - 0.59 / theECAL->theFs() - 0.53 * (1. - theECAL->ehat());
67  }
68 
69  inline double meanAlphaSam(double lny) const { return meanAlphaHom(lny) - 0.444 / theECAL->theFs(); }
70 
71  // ---- Fluctuated longitudinal profiles ----
72 
73  inline double meanLnT(double lny) const {
74  if (theECAL->isHom())
75  return meanLnTHom(lny);
76  return meanLnTSam(lny);
77  }
78 
79  inline double sigmaLnT(double lny) const {
80  if (theECAL->isHom())
81  return sigmaLnTHom(lny);
82  return sigmaLnTSam(lny);
83  }
84 
85  inline double meanLnAlpha(double lny) const {
86  if (theECAL->isHom())
87  return meanLnAlphaHom(lny);
88  return meanLnAlphaSam(lny);
89  }
90 
91  inline double sigmaLnAlpha(double lny) const {
92  if (theECAL->isHom())
93  return sigmaLnAlphaHom(lny);
94  return sigmaLnAlphaSam(lny);
95  }
96 
97  inline double correlationAlphaT(double lny) const {
98  if (theECAL->isHom())
99  return correlationAlphaTHom(lny);
100  return correlationAlphaTSam(lny);
101  }
102 
103  // Fluctuated longitudinal profiles homogeneous
104 
105  inline double meanLnTHom(double lny) const { return std::log(lny - 0.812); }
106 
107  inline double sigmaLnTHom(double lny) const { return 1. / (-1.4 + 1.26 * lny); }
108 
109  inline double meanLnAlphaHom(double lny) const { return std::log(0.81 + (0.458 + 2.26 / theECAL->theZeff()) * lny); }
110 
111  inline double sigmaLnAlphaHom(double lny) const { return 1. / (-0.58 + 0.86 * lny); }
112 
113  inline double correlationAlphaTHom(double lny) const { return 0.705 - 0.023 * lny; }
114 
115  // Fluctuated longitudinal profiles sampling
116 
117  inline double meanLnTSam(double lny) const {
118  return log(std::exp(meanLnTHom(lny)) - 0.55 / theECAL->theFs() - 0.69 * (1 - theECAL->ehat()));
119  }
120 
121  inline double sigmaLnTSam(double lny) const { return 1. / (-2.5 + 1.25 * lny); }
122 
123  inline double meanLnAlphaSam(double lny) const {
124  return log(std::exp(meanLnAlphaHom(lny)) - 0.476 / theECAL->theFs());
125  }
126 
127  inline double sigmaLnAlphaSam(double lny) const { return 1. / (-0.82 + 0.79 * lny); }
128 
129  inline double correlationAlphaTSam(double lny) const { return 0.784 - 0.023 * lny; }
130 
131  //====== Radial profiles =======
132 
133  // ---- Radial Profiles ----
134 
135  inline double rC(double tau, double E) const {
136  if (theECAL->isHom())
137  return rCHom(tau, E);
138  return rCSam(tau, E);
139  }
140 
141  inline double rT(double tau, double E) const {
142  if (theECAL->isHom())
143  return rTHom(tau, E);
144  return rTSam(tau, E);
145  }
146 
147  inline double p(double tau, double E) const {
148  if (theECAL->isHom())
149  return pHom(tau, E);
150  return pSam(tau, E);
151  }
152 
153  // Radial Profiles
154 
155  inline double rCHom(double tau, double E) const { return theRcfactor * (z1(E) + z2() * tau); }
156 
157  inline double rTHom(double tau, double E) const {
158  return theRtfactor * k1() * (std::exp(k3() * (tau - k2())) + std::exp(k4(E) * (tau - k2())));
159  }
160 
161  inline double pHom(double tau, double E) const {
162  double arg = (p2() - tau) / p3(E);
163  return p1() * std::exp(arg - std::exp(arg));
164  }
165 
166  // Radial Profiles Sampling
167 
168  inline double rCSam(double tau, double E) const {
169  return rCHom(tau, E) - 0.0203 * (1 - theECAL->ehat()) + 0.0397 / theECAL->theFs() * std::exp(-1. * tau);
170  }
171 
172  inline double rTSam(double tau, double E) const {
173  return rTHom(tau, E) - 0.14 * (1 - theECAL->ehat()) - 0.495 / theECAL->theFs() * std::exp(-1. * tau);
174  }
175 
176  inline double pSam(double tau, double E) const {
177  return pHom(tau, E) +
178  (1 - theECAL->ehat()) * (0.348 - 0.642 / theECAL->theFs() * std::exp(-1. * std::pow((tau - 1), 2)));
179  }
180 
181  // ---- Fluctuations of the radial profiles ----
182 
183  inline double nSpots(double E) const {
184  if (theECAL->isHom())
185  return nSpotsHom(E);
186  return nSpotsSam(E);
187  }
188 
189  inline double meanTSpot(double T) const {
190  if (theECAL->isHom())
191  return meanTSpotHom(T);
192  return meanTSpotSam(T);
193  }
194 
195  inline double meanAlphaSpot(double alpha) const {
196  if (theECAL->isHom())
197  return meanAlphaSpotHom(alpha);
198  return meanAlphaSpotSam(alpha);
199  }
200 
201  // Fluctuations of the radial profiles
202 
203  inline double nSpotsHom(double E) const { return 93. * std::log(theECAL->theZeff()) * std::pow(E, 0.876); }
204 
205  inline double meanTSpotHom(double T) const { return T * (0.698 + 0.00212 * theECAL->theZeff()); }
206 
207  inline double meanAlphaSpotHom(double alpha) const { return alpha * (0.639 + 0.00334 * theECAL->theZeff()); }
208 
209  // Fluctuations of the radial profiles Sampling
210 
211  inline double nSpotsSam(double E) const { return 10.3 / theECAL->resE() * std::pow(E, 0.959); }
212 
213  inline double meanTSpotSam(double T) const { return meanTSpotHom(T) * (0.813 + 0.0019 * theECAL->theZeff()); }
214 
215  inline double meanAlphaSpotSam(double alpha) const {
216  return meanAlphaSpotHom(alpha) * (0.844 + 0.0026 * theECAL->theZeff());
217  }
218 
219  inline const ECALProperties* ecalProperties() const { return theECAL; }
220 
221  inline const HCALProperties* hcalProperties() const { return theHCAL; }
222 
223  inline const PreshowerLayer1Properties* layer1Properties() const { return theLayer1; }
224 
225  inline const PreshowerLayer2Properties* layer2Properties() const { return theLayer2; }
226 
227  inline const std::vector<double>& getCoreIntervals() const { return theCore; }
228 
229  inline const std::vector<double>& getTailIntervals() const { return theTail; }
230 
231 private:
236 
237  const std::vector<double>& theCore;
238  const std::vector<double>& theTail;
239 
240  double theRcfactor;
241  double theRtfactor;
242 
243  double p1() const { return 2.632 - 0.00094 * theECAL->theZeff(); }
244  double p2() const { return 0.401 + 0.00187 * theECAL->theZeff(); }
245  double p3(double E) const { return 1.313 - 0.0686 * std::log(E); }
246 
247  double z1(double E) const { return 0.0251 + 0.00319 * std::log(E); }
248  double z2() const { return 0.1162 - 0.000381 * theECAL->theZeff(); }
249 
250  double k1() const { return 0.6590 - 0.00309 * theECAL->theZeff(); }
251  double k2() const { return 0.6450; }
252  double k3() const { return -2.59; }
253  double k4(double E) const { return 0.3585 + 0.0421 * std::log(E); }
254 };
255 
256 #endif
EMECALShowerParametrization::~EMECALShowerParametrization
virtual ~EMECALShowerParametrization()
Definition: EMECALShowerParametrization.h:38
EMECALShowerParametrization::rT
double rT(double tau, double E) const
Definition: EMECALShowerParametrization.h:141
EMECALShowerParametrization::k3
double k3() const
Definition: EMECALShowerParametrization.h:252
EMECALShowerParametrization::pHom
double pHom(double tau, double E) const
Definition: EMECALShowerParametrization.h:161
EMECALShowerParametrization::meanLnAlphaHom
double meanLnAlphaHom(double lny) const
Definition: EMECALShowerParametrization.h:109
EMECALShowerParametrization::theCore
const std::vector< double > & theCore
Definition: EMECALShowerParametrization.h:237
metsig::tau
Definition: SignAlgoResolutions.h:49
PreshowerLayer1Properties.h
EMECALShowerParametrization::theLayer1
const PreshowerLayer1Properties * theLayer1
Definition: EMECALShowerParametrization.h:234
EMECALShowerParametrization::p
double p(double tau, double E) const
Definition: EMECALShowerParametrization.h:147
EMECALShowerParametrization::k4
double k4(double E) const
Definition: EMECALShowerParametrization.h:253
EMECALShowerParametrization::meanLnTHom
double meanLnTHom(double lny) const
Definition: EMECALShowerParametrization.h:105
ECALProperties::ehat
double ehat() const
ehat = e/mip of the calorimeter. 0 for homogeneous one
Definition: ECALProperties.h:55
hcal
Definition: ConfigurationDatabase.cc:13
EMECALShowerParametrization::sigmaLnAlpha
double sigmaLnAlpha(double lny) const
Definition: EMECALShowerParametrization.h:91
EMECALShowerParametrization::meanTHom
double meanTHom(double lny) const
Definition: EMECALShowerParametrization.h:58
EMECALShowerParametrization::p2
double p2() const
Definition: EMECALShowerParametrization.h:244
EMECALShowerParametrization::pSam
double pSam(double tau, double E) const
Definition: EMECALShowerParametrization.h:176
EMECALShowerParametrization::theTail
const std::vector< double > & theTail
Definition: EMECALShowerParametrization.h:238
EMECALShowerParametrization::rTHom
double rTHom(double tau, double E) const
Definition: EMECALShowerParametrization.h:157
PreshowerLayer2Properties
Definition: PreshowerLayer2Properties.h:19
EMECALShowerParametrization::meanAlphaHom
double meanAlphaHom(double lny) const
Definition: EMECALShowerParametrization.h:61
EMECALShowerParametrization::meanAlphaSpotHom
double meanAlphaSpotHom(double alpha) const
Definition: EMECALShowerParametrization.h:207
alpha
float alpha
Definition: AMPTWrapper.h:105
EMECALShowerParametrization::nSpots
double nSpots(double E) const
Definition: EMECALShowerParametrization.h:183
ECALProperties::theFs
double theFs() const
Sampling fraction Fs of the calorimeter. 0 for homogeneous one.
Definition: ECALProperties.h:52
EMECALShowerParametrization::sigmaLnAlphaHom
double sigmaLnAlphaHom(double lny) const
Definition: EMECALShowerParametrization.h:111
EMECALShowerParametrization::meanTSpotSam
double meanTSpotSam(double T) const
Definition: EMECALShowerParametrization.h:213
EMECALShowerParametrization::p1
double p1() const
Definition: EMECALShowerParametrization.h:243
EMECALShowerParametrization::meanTSam
double meanTSam(double lny) const
Definition: EMECALShowerParametrization.h:65
EMECALShowerParametrization::layer1Properties
const PreshowerLayer1Properties * layer1Properties() const
Definition: EMECALShowerParametrization.h:223
ecal
Definition: ElectronicsMappingGPU.h:13
EMECALShowerParametrization::meanLnT
double meanLnT(double lny) const
Definition: EMECALShowerParametrization.h:73
EMECALShowerParametrization::theHCAL
const HCALProperties * theHCAL
Definition: EMECALShowerParametrization.h:233
EMECALShowerParametrization::z1
double z1(double E) const
Definition: EMECALShowerParametrization.h:247
EMECALShowerParametrization::z2
double z2() const
Definition: EMECALShowerParametrization.h:248
EMECALShowerParametrization::sigmaLnTSam
double sigmaLnTSam(double lny) const
Definition: EMECALShowerParametrization.h:121
EMECALShowerParametrization::k2
double k2() const
Definition: EMECALShowerParametrization.h:251
ECALProperties::resE
double resE() const
a rough estimate of ECAL resolution sigma/E = resE/sqrt(E)
Definition: ECALProperties.h:58
ECALProperties
Definition: ECALProperties.h:15
EMECALShowerParametrization::correlationAlphaTHom
double correlationAlphaTHom(double lny) const
Definition: EMECALShowerParametrization.h:113
EMECALShowerParametrization::rTSam
double rTSam(double tau, double E) const
Definition: EMECALShowerParametrization.h:172
EMECALShowerParametrization::rCSam
double rCSam(double tau, double E) const
Definition: EMECALShowerParametrization.h:168
EMECALShowerParametrization::p3
double p3(double E) const
Definition: EMECALShowerParametrization.h:245
EMECALShowerParametrization::meanTSpotHom
double meanTSpotHom(double T) const
Definition: EMECALShowerParametrization.h:205
EMECALShowerParametrization::meanT
double meanT(double lny) const
Definition: EMECALShowerParametrization.h:44
EMECALShowerParametrization::ecalProperties
const ECALProperties * ecalProperties() const
Definition: EMECALShowerParametrization.h:219
EMECALShowerParametrization::rC
double rC(double tau, double E) const
Definition: EMECALShowerParametrization.h:135
EMECALShowerParametrization::k1
double k1() const
Definition: EMECALShowerParametrization.h:250
EMECALShowerParametrization::nSpotsHom
double nSpotsHom(double E) const
Definition: EMECALShowerParametrization.h:203
EMECALShowerParametrization::rCHom
double rCHom(double tau, double E) const
Definition: EMECALShowerParametrization.h:155
EMECALShowerParametrization::sigmaLnAlphaSam
double sigmaLnAlphaSam(double lny) const
Definition: EMECALShowerParametrization.h:127
EMECALShowerParametrization::meanAlpha
double meanAlpha(double lny) const
Definition: EMECALShowerParametrization.h:50
PreshowerLayer1Properties
Definition: PreshowerLayer1Properties.h:19
EMECALShowerParametrization::meanAlphaSpot
double meanAlphaSpot(double alpha) const
Definition: EMECALShowerParametrization.h:195
EMECALShowerParametrization::meanAlphaSam
double meanAlphaSam(double lny) const
Definition: EMECALShowerParametrization.h:69
EMECALShowerParametrization::getTailIntervals
const std::vector< double > & getTailIntervals() const
Definition: EMECALShowerParametrization.h:229
EMECALShowerParametrization::layer2Properties
const PreshowerLayer2Properties * layer2Properties() const
Definition: EMECALShowerParametrization.h:225
EMECALShowerParametrization::meanLnAlphaSam
double meanLnAlphaSam(double lny) const
Definition: EMECALShowerParametrization.h:123
EMECALShowerParametrization::theRtfactor
double theRtfactor
Definition: EMECALShowerParametrization.h:241
PreshowerLayer2Properties.h
EMECALShowerParametrization::hcalProperties
const HCALProperties * hcalProperties() const
Definition: EMECALShowerParametrization.h:221
EMECALShowerParametrization::correlationAlphaTSam
double correlationAlphaTSam(double lny) const
Definition: EMECALShowerParametrization.h:129
EMECALShowerParametrization::meanTSpot
double meanTSpot(double T) const
Definition: EMECALShowerParametrization.h:189
HCALProperties.h
EMECALShowerParametrization
Definition: EMECALShowerParametrization.h:19
ECALProperties::isHom
bool isHom() const
a rough estimate of ECAL resolution sigma/E = resE/sqrt(E)
Definition: ECALProperties.h:67
EMECALShowerParametrization::theLayer2
const PreshowerLayer2Properties * theLayer2
Definition: EMECALShowerParametrization.h:235
EMECALShowerParametrization::sigmaLnTHom
double sigmaLnTHom(double lny) const
Definition: EMECALShowerParametrization.h:107
HCALProperties
Definition: HCALProperties.h:21
EMECALShowerParametrization::EMECALShowerParametrization
EMECALShowerParametrization(const ECALProperties *ecal, const HCALProperties *hcal, const PreshowerLayer1Properties *layer1, const PreshowerLayer2Properties *layer2, const std::vector< double > &coreIntervals, const std::vector< double > &tailIntervals, double RCFact=1., double RTFact=1.)
Definition: EMECALShowerParametrization.h:21
T
long double T
Definition: Basic3DVectorLD.h:48
EMECALShowerParametrization::getCoreIntervals
const std::vector< double > & getCoreIntervals() const
Definition: EMECALShowerParametrization.h:227
EMECALShowerParametrization::sigmaLnT
double sigmaLnT(double lny) const
Definition: EMECALShowerParametrization.h:79
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
EMECALShowerParametrization::meanAlphaSpotSam
double meanAlphaSpotSam(double alpha) const
Definition: EMECALShowerParametrization.h:215
EMECALShowerParametrization::theRcfactor
double theRcfactor
Definition: EMECALShowerParametrization.h:240
funct::arg
A arg
Definition: Factorize.h:31
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
EMECALShowerParametrization::meanLnTSam
double meanLnTSam(double lny) const
Definition: EMECALShowerParametrization.h:117
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
ECALProperties::theZeff
double theZeff() const override
Effective Z: 68.36 for Standard ECAL.
Definition: ECALProperties.h:25
EMECALShowerParametrization::nSpotsSam
double nSpotsSam(double E) const
Definition: EMECALShowerParametrization.h:211
ECALProperties.h
EMECALShowerParametrization::theECAL
const ECALProperties * theECAL
Definition: EMECALShowerParametrization.h:232
EMECALShowerParametrization::meanLnAlpha
double meanLnAlpha(double lny) const
Definition: EMECALShowerParametrization.h:85
EMECALShowerParametrization::correlationAlphaT
double correlationAlphaT(double lny) const
Definition: EMECALShowerParametrization.h:97