14 #include "CLHEP/Random/RandFlat.h" 48 float ts1, ts2, ts3, thpd, tpre, wd1, wd2, wd3;
51 ts1=8. ; ts2=10. ; ts3=29.3; thpd=4.0; tpre=9.0; wd1=2.0; wd2=0.7; wd3=1.0;
57 ts1=8. ; ts2=10. ; ts3=25.0; thpd=4.0; tpre=9.0; wd1=2.0; wd2=0.7; wd3=1.0;
61 ts1=8. ; ts2=10. ; ts3=29.3; thpd=4.0; tpre=7.0; wd1=2.0; wd2=0.7; wd3=1.0;
66 ts1=8. ; ts2=19. ; ts3=29.3; thpd=4.0; tpre=9.0; wd1=2.0; wd2=0.7; wd3=0.32;
70 ts1=8. ; ts2=10. ; ts3=22.3; thpd=4.0; tpre=7.0; wd1=2.0; wd2=0.7; wd3=1.0;
76 ts1=8. ; ts2=12. ; ts3=31.7; thpd=9.0; tpre=9.0; wd1=2.0; wd2=0.7; wd3=1.0;
80 ts1=8. ; ts2=12. ; ts3=31.7; thpd=9.0; tpre=9.0; wd1=2.0; wd2=0.7; wd3=1.0;
139 float wd1,
float wd2,
float wd3,
Shape &tmphpdShape_)
155 unsigned int nbin = 256;
157 std::vector<float> ntmp(nbin,0.0);
158 std::vector<float> nth(nbin,0.0);
159 std::vector<float> ntp(nbin,0.0);
160 std::vector<float> ntd(nbin,0.0);
167 for(j=0;j<thpd && j<nbin;j++){
168 nth[j] = 1.0 + ((
float)j)/thpd;
172 for(j=0;j<thpd && j<nbin;j++){
178 for(j=0;j<6*tpre && j<nbin;j++){
179 ntp[j] = ((
float)j)*
exp(-((
float)(j*j))/(tpre*tpre));
183 for(j=0;j<6*tpre && j<nbin;j++){
191 unsigned int tmax = 6 * (
int)ts3;
194 for(j=0;j<tmax && j<nbin;j++){
195 ntd[j] = wd1 *
exp(-((
float)j)/ts1) +
196 wd2 *
exp(-((
float)j)/ts2) +
197 wd3 *
exp(-((
float)j)/ts3) ;
201 for(j=0;j<tmax && j<nbin;j++){
205 unsigned int t1,
t2,t3,t4;
206 for(i=0;i<tmax && i<nbin;i++){
211 for(j=0;j<thpd && j<nbin;j++){
213 for(k=0;k<4*tpre && k<nbin;k++){
217 ntmp[ntb] += ntd[
i]*nth[j]*ntp[
k];
229 for(i=0; i<nbin; i++){
233 for(i=0; i<nbin; i++){
240 unsigned int nbin = 256;
242 std::vector<float> ntmp(nbin,0.0);
244 const float k0=0.7956;
245 const float p2=1.355;
246 const float p4=2.327;
251 for(
unsigned int j = 0; j < 25 && j < nbin; ++j){
254 float sigma0 = (r0<0) ? p2 : p2*p4;
256 if(r0 < k0) ntmp[j] =
exp(-0.5*r0*r0);
257 else ntmp[j] =
exp(0.5*k0*k0-k0*r0);
261 for(
unsigned int j = 0; j < 25 && j < nbin; ++j){
271 unsigned int nbin = 128;
274 std::vector<float>
nt = {
275 2.782980485851731e-6,
276 4.518134885954626e-5,
277 2.7689305197392056e-4,
343 9.273987838127585e-4,
344 8.315731274976846e-4,
345 7.451662302008696e-4,
346 6.673176219006913e-4,
347 5.972364609644049e-4,
348 5.341971801529036e-4,
349 4.775352065178378e-4,
350 4.266427928961177e-4,
351 3.8096498904225923e-4,
352 3.3999577417327287e-4,
353 3.032743659102713e-4,
354 2.703817158798329e-4,
355 2.4093719775272793e-4,
356 2.145954900503894e-4,
357 1.9104365317752797e-4,
358 1.6999839784346724e-4,
359 1.5120354022478893e-4,
360 1.3442763782650755e-4,
361 1.1946179895521507e-4,
362 1.0611765796993575e-4,
363 9.422550797617687e-5,
364 8.363258233342666e-5,
365 7.420147621931836e-5,
366 6.580869950304933e-5,
367 5.834335229919868e-5,
369 4.5807143072062634e-5,
370 4.0567063461299446e-5,
371 3.591405732740723e-5,
372 3.178402980354131e-5,
373 2.811965539165646e-5,
374 2.4869694240316126e-5,
375 2.1988373166730962e-5,
376 1.9434825899529382e-5,
377 1.717258740121378e-5,
378 1.5169137499243157e-5,
379 1.339548941011129e-5,
380 1.1825819079078403e-5,
381 1.0437131581057595e-5,
382 9.208961130078894e-6,
384 7.163364176588591e-6,
385 6.315360932244386e-6,
386 5.566309502463164e-6,
387 4.904859063429651e-6,
388 4.320934164082596e-6,
389 3.8055950719111903e-6,
390 3.350912911083174e-6,
391 2.9498580949517117e-6,
392 2.596200697612328e-6,
393 2.2844215378879293e-6,
394 2.0096328693141094e-6,
395 1.7675076766686654e-6,
396 1.5542166787225756e-6,
397 1.366372225473431e-6,
398 1.200978365778838e-6,
399 1.0553864128982371e-6,
400 9.272554464808518e-7,
401 8.145171945902259e-7,
408 for (
unsigned int j = 0; j < nbin; ++j) {
409 norm += (nt[j]>0) ? nt[j] : 0.;
412 for (
unsigned int j = 0; j < nbin; ++j) {
427 for (
unsigned int j = 1; j <=
nBinsSiPM_; ++j) {
428 norm += (nt[j]>0) ? nt[j] : 0.;
431 for (
unsigned int j = 1; j <=
nBinsSiPM_; ++j) {
440 ShapeMap::const_iterator shapeMapItr =
theShapes.find(shapeType);
445 return *(shapeMapItr->second);
458 ShapeMap::const_iterator shapeMapItr =
theShapes.find(shapeType);
462 return *(shapeMapItr->second);
474 ShapeMap::const_iterator shapeMapItr =
theShapes.find(shapeType);
478 return *(shapeMapItr->second);
506 inline double gexp(
double t,
double A,
double c,
double t0,
double s) {
507 static double const root2(
sqrt(2));
508 return -A*0.5*
exp(c*t+0.5*c*c*s*s-c*s)*(erf(-0.5*root2/s*(t-t0+c*s*s))-1);
512 return (t<theta) ? 0 : A*TMath::LogNormal(t,sigma,theta,m);
517 double A1(0.08757),
c1(-0.5257), t01(2.4013), s1(0.6721);
518 double A2(0.007598), c2(-0.1501), t02(6.9412),
s2(0.8710);
519 return gexp(t,A1,
c1,t01,s1) +
gexp(t,A2,c2,t02,s2);
524 double A1(5.204/6.94419), sigma1_shape(0.5387), theta1_loc(-0.3976), m1_scale(4.428);
525 double A2(1.855/6.94419), sigma2_shape(0.8132), theta2_loc(7.025), m2_scale(12.29);
527 onePulse(t,A1,sigma1_shape,theta1_loc,m1_scale) +
528 onePulse(t,A2,sigma2_shape,theta2_loc,m2_scale);
541 return exp(-0.0635-0.1518*t)*
pow(t, 2.528)/2485.9;
const Shape & getShape(int shapeType) const
const Shape & heShape() const
HcalSubdetector subdet() const
get the subdetector
void setShapeBin(int i, float f)
const Shape & hoShape(bool sipm=false) const
void beginRun(edm::EventSetup const &es)
Geom::Theta< T > theta() const
static constexpr float Y11MAX_
const Item * getValues(DetId fId, bool throwOnFail=true) const
static const int nBinsSiPM_
const Shape & shapeForReco(const HcalDetId &detId) const
static double analyticPulseShapeSiPMHE(double t)
double onePulse(double t, double A, double sigma, double theta, double m)
const Shape & shape(const HcalDetId &detId) const
automatically figures out which shape to return
uint32_t rawId() const
get the raw id
HcalRecoParams * theRecoParams
static std::vector< double > convolve(unsigned nbin, F1 f1, F2 f2)
auto const T2 &decltype(t1.eta()) t2
static double generatePhotonTime(CLHEP::HepRandomEngine *engine)
static const double tmax[3]
const Shape & defaultShape(const HcalDetId &detId) const
in case of conditions problems
const Shape & hfShape() const
void computeHPDShape(float, float, float, float, float, float, float, float, Shape &)
const HcalTopology * theTopology
HcalMCParams * theMCParams
double gexp(double t, double A, double c, double t0, double s)
unsigned int signalShape() const
void computeSiPMShape2017()
const Shape & hbShape() const
static constexpr float Y11RANGE_
static double Y11TimePDF(double t)
T const * product() const
Power< A, B >::type pow(const A &a, const B &b)
void setTopo(const HcalTopology *topo)
static double analyticPulseShapeSiPMHO(double t)