14 #include "CLHEP/Random/RandFlat.h" 49 float ts1, ts2, ts3, thpd, tpre, wd1, wd2, wd3;
52 ts1=8. ; ts2=10. ; ts3=29.3; thpd=4.0; tpre=9.0; wd1=2.0; wd2=0.7; wd3=1.0;
58 ts1=8. ; ts2=10. ; ts3=25.0; thpd=4.0; tpre=9.0; wd1=2.0; wd2=0.7; wd3=1.0;
62 ts1=8. ; ts2=10. ; ts3=29.3; thpd=4.0; tpre=7.0; wd1=2.0; wd2=0.7; wd3=1.0;
67 ts1=8. ; ts2=19. ; ts3=29.3; thpd=4.0; tpre=9.0; wd1=2.0; wd2=0.7; wd3=0.32;
71 ts1=8. ; ts2=10. ; ts3=22.3; thpd=4.0; tpre=7.0; wd1=2.0; wd2=0.7; wd3=1.0;
77 ts1=8. ; ts2=12. ; ts3=31.7; thpd=9.0; tpre=9.0; wd1=2.0; wd2=0.7; wd3=1.0;
81 ts1=8. ; ts2=12. ; ts3=31.7; thpd=9.0; tpre=9.0; wd1=2.0; wd2=0.7; wd3=1.0;
142 float wd1,
float wd2,
float wd3,
Shape &tmphpdShape_)
158 unsigned int nbin = 256;
160 std::vector<float> ntmp(nbin,0.0);
161 std::vector<float> nth(nbin,0.0);
162 std::vector<float> ntp(nbin,0.0);
163 std::vector<float> ntd(nbin,0.0);
170 for(j=0;j<thpd && j<nbin;j++){
171 nth[j] = 1.0 + ((
float)j)/thpd;
175 for(j=0;j<thpd && j<nbin;j++){
181 for(j=0;j<6*tpre && j<nbin;j++){
182 ntp[j] = ((
float)j)*
exp(-((
float)(j*j))/(tpre*tpre));
186 for(j=0;j<6*tpre && j<nbin;j++){
194 unsigned int tmax = 6 * (
int)ts3;
197 for(j=0;j<tmax && j<nbin;j++){
198 ntd[j] = wd1 *
exp(-((
float)j)/ts1) +
199 wd2 *
exp(-((
float)j)/ts2) +
200 wd3 *
exp(-((
float)j)/ts3) ;
204 for(j=0;j<tmax && j<nbin;j++){
208 unsigned int t1,
t2,t3,t4;
209 for(i=0;i<tmax && i<nbin;i++){
214 for(j=0;j<thpd && j<nbin;j++){
216 for(k=0;k<4*tpre && k<nbin;k++){
220 ntmp[ntb] += ntd[
i]*nth[j]*ntp[
k];
232 for(i=0; i<nbin; i++){
236 for(i=0; i<nbin; i++){
243 unsigned int nbin = 256;
245 std::vector<float> ntmp(nbin,0.0);
247 const float k0=0.7956;
248 const float p2=1.355;
249 const float p4=2.327;
254 for(
unsigned int j = 0; j < 25 && j < nbin; ++j){
257 float sigma0 = (r0<0) ? p2 : p2*p4;
259 if(r0 < k0) ntmp[j] =
exp(-0.5*r0*r0);
260 else ntmp[j] =
exp(0.5*k0*k0-k0*r0);
264 for(
unsigned int j = 0; j < 25 && j < nbin; ++j){
277 unsigned int nbin = 250;
279 std::vector<float>
nt = {
536 for (
unsigned int j = 0; j < nbin; ++j) {
537 norm += (nt[j]>0) ? nt[j] : 0.;
540 for (
unsigned int j = 0; j < nbin; ++j) {
549 unsigned int nbin = 128;
552 std::vector<float>
nt = {
553 2.782980485851731e-6,
554 4.518134885954626e-5,
555 2.7689305197392056e-4,
621 9.273987838127585e-4,
622 8.315731274976846e-4,
623 7.451662302008696e-4,
624 6.673176219006913e-4,
625 5.972364609644049e-4,
626 5.341971801529036e-4,
627 4.775352065178378e-4,
628 4.266427928961177e-4,
629 3.8096498904225923e-4,
630 3.3999577417327287e-4,
631 3.032743659102713e-4,
632 2.703817158798329e-4,
633 2.4093719775272793e-4,
634 2.145954900503894e-4,
635 1.9104365317752797e-4,
636 1.6999839784346724e-4,
637 1.5120354022478893e-4,
638 1.3442763782650755e-4,
639 1.1946179895521507e-4,
640 1.0611765796993575e-4,
641 9.422550797617687e-5,
642 8.363258233342666e-5,
643 7.420147621931836e-5,
644 6.580869950304933e-5,
645 5.834335229919868e-5,
647 4.5807143072062634e-5,
648 4.0567063461299446e-5,
649 3.591405732740723e-5,
650 3.178402980354131e-5,
651 2.811965539165646e-5,
652 2.4869694240316126e-5,
653 2.1988373166730962e-5,
654 1.9434825899529382e-5,
655 1.717258740121378e-5,
656 1.5169137499243157e-5,
657 1.339548941011129e-5,
658 1.1825819079078403e-5,
659 1.0437131581057595e-5,
660 9.208961130078894e-6,
662 7.163364176588591e-6,
663 6.315360932244386e-6,
664 5.566309502463164e-6,
665 4.904859063429651e-6,
666 4.320934164082596e-6,
667 3.8055950719111903e-6,
668 3.350912911083174e-6,
669 2.9498580949517117e-6,
670 2.596200697612328e-6,
671 2.2844215378879293e-6,
672 2.0096328693141094e-6,
673 1.7675076766686654e-6,
674 1.5542166787225756e-6,
675 1.366372225473431e-6,
676 1.200978365778838e-6,
677 1.0553864128982371e-6,
678 9.272554464808518e-7,
679 8.145171945902259e-7,
686 for (
unsigned int j = 0; j < nbin; ++j) {
687 norm += (nt[j]>0) ? nt[j] : 0.;
690 for (
unsigned int j = 0; j < nbin; ++j) {
705 for (
unsigned int j = 1; j <=
nBinsSiPM_; ++j) {
706 norm += (nt[j]>0) ? nt[j] : 0.;
709 for (
unsigned int j = 1; j <=
nBinsSiPM_; ++j) {
718 ShapeMap::const_iterator shapeMapItr =
theShapes.find(shapeType);
723 return *(shapeMapItr->second);
736 ShapeMap::const_iterator shapeMapItr =
theShapes.find(shapeType);
740 return *(shapeMapItr->second);
752 ShapeMap::const_iterator shapeMapItr =
theShapes.find(shapeType);
756 return *(shapeMapItr->second);
784 inline double gexp(
double t,
double A,
double c,
double t0,
double s) {
785 static double const root2(
sqrt(2));
786 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);
790 return (t<theta) ? 0 : A*TMath::LogNormal(t,sigma,theta,m);
795 double A1(0.08757),
c1(-0.5257), t01(2.4013), s1(0.6721);
796 double A2(0.007598), c2(-0.1501), t02(6.9412),
s2(0.8710);
797 return gexp(t,A1,
c1,t01,s1) +
gexp(t,A2,c2,t02,s2);
802 double A1(5.204/6.94419), sigma1_shape(0.5387), theta1_loc(-0.3976), m1_scale(4.428);
803 double A2(1.855/6.94419), sigma2_shape(0.8132), theta2_loc(7.025), m2_scale(12.29);
805 onePulse(t,A1,sigma1_shape,theta1_loc,m1_scale) +
806 onePulse(t,A2,sigma2_shape,theta2_loc,m2_scale);
819 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
void computeSiPMShapeData2017()
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)