diff --git a/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h b/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h index 4a6784bdf91ba..29524cf6610f2 100644 --- a/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h +++ b/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h @@ -70,7 +70,8 @@ class HcalPulseShapes { void computeHFShape(); void computeSiPMShape(); void computeSiPMShape2017(); - Shape hpdShape_, hfShape_, siPMShape_, siPMShape2017_; + void computeSiPMShapeData2017(); + Shape hpdShape_, hfShape_, siPMShape_, siPMShape2017_, siPMShapeData2017_; Shape hpdShape_v2, hpdShapeMC_v2; Shape hpdShape_v3, hpdShapeMC_v3; Shape hpdBV30Shape_v2, hpdBV30ShapeMC_v2; diff --git a/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc b/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc index b140ab639ae8a..1eb3fa5e8ff48 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc @@ -38,6 +38,7 @@ Reco MC 201 201 siPMShape_ SiPMs Zecotec shape (HO) 202 202 =201, SiPMs Hamamatsu shape (HO) 203 203 siPMShape2017_ SiPMs Hamamatsu shape (HE 2017) +205 205 siPMShapeData2017_ SiPMs from Data (HE data 2017) 301 301 hfShape_ regular HF PMT shape 401 401 regular ZDC shape -------------------------------------------------------------------------------------- @@ -86,10 +87,12 @@ Reco MC computeHFShape(); computeSiPMShape(); computeSiPMShape2017(); + computeSiPMShapeData2017(); theShapes[201] = &siPMShape_; theShapes[202] = theShapes[201]; theShapes[203] = &siPMShape2017_; + theShapes[205] = &siPMShapeData2017_; theShapes[301] = &hfShape_; //theShapes[401] = new CaloCachedShapeIntegrator(&theZDCShape); @@ -265,6 +268,281 @@ void HcalPulseShapes::computeHFShape() { } +void HcalPulseShapes::computeSiPMShapeData2017() +{ + //From Jay Lawhorn: derived from data Edward Laird phase scan may2017 + //https://indico.cern.ch/event/641978/contributions/2604491/attachments/1468666/2271582/17-05-31-hcal-hep17-pulse-shape.pdf + //Run numbers are 294736-294740 and 294929-294950 + + unsigned int nbin = 250; + + std::vector nt = { + 3.97958e-29, + 1.11634e-22, + 9.96106e-18, + 6.25334e-14, + 5.08863e-11, + 8.59141e-09, + 4.32285e-07, + 8.56617e-06, + 8.28549e-05, + 0.000461447, + 0.00168052, + 0.00441395, + 0.00901637, + 0.0151806, + 0.0220314, + 0.028528, + 0.0338471, + 0.0375578, + 0.0395985, + 0.0401567, + 0.0395398, + 0.0380776, + 0.0360669, + 0.0337474, + 0.0312984, + 0.0288457, + 0.0264721, + 0.0242276, + 0.0221393, + 0.0202181, + 0.0184647, + 0.0168731, + 0.0154335, + 0.0141346, + 0.0129639, + 0.0119094, + 0.0109594, + 0.0101031, + 0.0093305, + 0.00863267, + 0.0080015, + 0.00742977, + 0.00691107, + 0.00643969, + 0.00601059, + 0.00561931, + 0.00526188, + 0.00493483, + 0.00463505, + 0.00435981, + 0.00410667, + 0.00387348, + 0.00365832, + 0.00345949, + 0.00327547, + 0.0031049, + 0.00294656, + 0.00279938, + 0.00266237, + 0.00253467, + 0.00241548, + 0.0023041, + 0.00219989, + 0.00210227, + 0.00201072, + 0.00192476, + 0.00184397, + 0.00176795, + 0.00169634, + 0.00162884, + 0.00156512, + 0.00150494, + 0.00144803, + 0.00139418, + 0.00134317, + 0.00129481, + 0.00124894, + 0.00120537, + 0.00116398, + 0.00112461, + 0.00108715, + 0.00105147, + 0.00101747, + 0.000985042, + 0.000954096, + 0.000924545, + 0.000896308, + 0.000869311, + 0.000843482, + 0.000818758, + 0.000795077, + 0.000772383, + 0.000750623, + 0.000729747, + 0.00070971, + 0.000690466, + 0.000671977, + 0.000654204, + 0.00063711, + 0.000620663, + 0.000604831, + 0.000589584, + 0.000574894, + 0.000560735, + 0.000547081, + 0.00053391, + 0.0005212, + 0.000508929, + 0.000497078, + 0.000485628, + 0.000474561, + 0.000463862, + 0.000453514, + 0.000443501, + 0.000433811, + 0.000424429, + 0.000415343, + 0.00040654, + 0.00039801, + 0.000389741, + 0.000381722, + 0.000373944, + 0.000366398, + 0.000359074, + 0.000351964, + 0.00034506, + 0.000338353, + 0.000331838, + 0.000325505, + 0.00031935, + 0.000313365, + 0.000307544, + 0.000301881, + 0.000296371, + 0.000291009, + 0.000285788, + 0.000280705, + 0.000275755, + 0.000270932, + 0.000266233, + 0.000261653, + 0.00025719, + 0.000252837, + 0.000248593, + 0.000244454, + 0.000240416, + 0.000236475, + 0.00023263, + 0.000228876, + 0.000225212, + 0.000221633, + 0.000218138, + 0.000214724, + 0.000211389, + 0.00020813, + 0.000204945, + 0.000201831, + 0.000198787, + 0.000195811, + 0.0001929, + 0.000190053, + 0.000187268, + 0.000184543, + 0.000181876, + 0.000179266, + 0.000176711, + 0.00017421, + 0.000171761, + 0.000169363, + 0.000167014, + 0.000164713, + 0.000162459, + 0.00016025, + 0.000158086, + 0.000155964, + 0.000153885, + 0.000151847, + 0.000149848, + 0.000147888, + 0.000145966, + 0.000144081, + 0.000142232, + 0.000140418, + 0.000138638, + 0.000136891, + 0.000135177, + 0.000133494, + 0.000131843, + 0.000130221, + 0.00012863, + 0.000127066, + 0.000125531, + 0.000124023, + 0.000122543, + 0.000121088, + 0.000119658, + 0.000118254, + 0.000116874, + 0.000115518, + 0.000114185, + 0.000112875, + 0.000111587, + 0.000110321, + 0.000109076, + 0.000107851, + 0.000106648, + 0.000105464, + 0.000104299, + 0.000103154, + 0.000102027, + 0.000100918, + 9.98271e-05, + 9.87537e-05, + 9.76974e-05, + 9.66578e-05, + 9.56346e-05, + 9.46274e-05, + 9.3636e-05, + 9.26599e-05, + 9.16989e-05, + 9.07526e-05, + 8.98208e-05, + 8.89032e-05, + 8.79995e-05, + 8.71093e-05, + 8.62325e-05, + 8.53688e-05, + 8.45179e-05, + 8.36796e-05, + 8.28536e-05, + 8.20397e-05, + 8.12376e-05, + 8.04471e-05, + 7.96681e-05, + 7.89002e-05, + 7.81433e-05, + 7.73972e-05, + 7.66616e-05, + 7.59364e-05, + 7.52213e-05, + 7.45163e-05, + 7.3821e-05, + 7.31354e-05, + 7.24592e-05, + 7.17923e-05, + 7.11345e-05, + 7.04856e-05, + 6.98455e-05, + 6.9214e-05, + 6.8591e-05 + }; + + + siPMShapeData2017_.setNBin(nbin); + + double norm = 0.; + for (unsigned int j = 0; j < nbin; ++j) { + norm += (nt[j]>0) ? nt[j] : 0.; + } + + for (unsigned int j = 0; j < nbin; ++j) { + nt[j] /= norm; + siPMShapeData2017_.setShapeBin(j,nt[j]); + } +} + void HcalPulseShapes::computeSiPMShape() { diff --git a/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h b/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h index cfb6a55f867d1..a0501af996b00 100644 --- a/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h +++ b/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h @@ -28,6 +28,7 @@ class HcalDeterministicFit { template void apply(const CaloSamples & cs, const std::vector & capidvec, const HcalCalibrations & calibs, const Digi & digi, double& ampl, float &time) const; void getLandauFrac(float tStart, float tEnd, float &sum) const; + void get205Frac(float tStart, float tEnd, float &sum) const; private: HcalTimeSlew::ParaSource fTimeSlew; @@ -44,20 +45,37 @@ class HcalDeterministicFit { static constexpr float invGpar[3] = {-13.11, 11.29, 5.133}; static constexpr float rCorr[2] = {0.95, 0.95}; static constexpr float rCorrSiPM[2] = {1., 1.}; - static constexpr float landauFrac[] = {0, 7.6377e-05, 0.000418655, 0.00153692, 0.00436844, 0.0102076, - 0.0204177, 0.0360559, 0.057596, 0.0848493, 0.117069, 0.153152, 0.191858, 0.23198, 0.272461, 0.312438, - 0.351262, 0.388476, 0.423788, 0.457036, 0.488159, 0.517167, 0.54412, 0.569112, 0.592254, 0.613668, - 0.633402, 0.651391, 0.667242, 0.680131, 0.688868, 0.692188, 0.689122, 0.67928, 0.662924, 0.64087, - 0.614282, 0.584457, 0.552651, 0.51997, 0.487317, 0.455378, 0.424647, 0.395445, 0.367963, 0.342288, - 0.318433, 0.29636, 0.275994, 0.257243, 0.24, 0.224155, 0.2096, 0.196227, 0.183937, 0.172635, - 0.162232, 0.15265, 0.143813, 0.135656, 0.128117, 0.12114, 0.114677, 0.108681, 0.103113, 0.0979354, - 0.0931145, 0.0886206, 0.0844264, 0.0805074, 0.0768411, 0.0734075, 0.0701881, 0.0671664, 0.0643271, - 0.0616564, 0.0591418, 0.0567718, 0.054536, 0.0524247, 0.0504292, 0.0485414, 0.046754, 0.0450602, - 0.0434538, 0.041929, 0.0404806, 0.0391037, 0.0377937, 0.0365465, 0.0353583, 0.0342255, 0.0331447, - 0.032113, 0.0311274, 0.0301854, 0.0292843, 0.0284221, 0.0275964, 0.0268053, 0.0253052, 0.0238536, - 0.0224483, 0.0210872, 0.0197684, 0.0184899, 0.01725, 0.0160471, 0.0148795, 0.0137457, 0.0126445, - 0.0115743, 0.0105341, 0.00952249, 0.00853844, 0.00758086, 0.00664871,0.00574103, 0.00485689, 0.00399541, - 0.00315576, 0.00233713, 0.00153878, 0.000759962, 0 }; + + static constexpr float landauFrac[125] = { 0, 7.6377e-05, 0.000418655, 0.00153692, 0.00436844, 0.0102076, + 0.0204177, 0.0360559, 0.057596, 0.0848493, 0.117069, 0.153152, 0.191858, 0.23198, 0.272461, 0.312438, + 0.351262, 0.388476, 0.423788, 0.457036, 0.488159, 0.517167, 0.54412, 0.569112, 0.592254, 0.613668, + 0.633402, 0.651391, 0.667242, 0.680131, 0.688868, 0.692188, 0.689122, 0.67928, 0.662924, 0.64087, + 0.614282, 0.584457, 0.552651, 0.51997, 0.487317, 0.455378, 0.424647, 0.395445, 0.367963, 0.342288, + 0.318433, 0.29636, 0.275994, 0.257243, 0.24, 0.224155, 0.2096, 0.196227, 0.183937, 0.172635, + 0.162232, 0.15265, 0.143813, 0.135656, 0.128117, 0.12114, 0.114677, 0.108681, 0.103113, 0.0979354, + 0.0931145, 0.0886206, 0.0844264, 0.0805074, 0.0768411, 0.0734075, 0.0701881, 0.0671664, 0.0643271, + 0.0616564, 0.0591418, 0.0567718, 0.054536, 0.0524247, 0.0504292, 0.0485414, 0.046754, 0.0450602, + 0.0434538, 0.041929, 0.0404806, 0.0391037, 0.0377937, 0.0365465, 0.0353583, 0.0342255, 0.0331447, + 0.032113, 0.0311274, 0.0301854, 0.0292843, 0.0284221, 0.0275964, 0.0268053, 0.0253052, 0.0238536, + 0.0224483, 0.0210872, 0.0197684, 0.0184899, 0.01725, 0.0160471, 0.0148795, 0.0137457, 0.0126445, + 0.0115743, 0.0105341, 0.00952249, 0.00853844, 0.00758086, 0.00664871,0.00574103, 0.00485689, 0.00399541, + 0.00315576, 0.00233713, 0.00153878, 0.000759962, 0 }; + + static constexpr float siPM205Frac[125] = { + 0, 0, 0, 0, 0.00133129, 0.00444633, 0.0115, 0.0243992, 0.0443875, 0.0716386, 0.105298, 0.143832, + 0.185449, 0.228439, 0.271367, 0.31315, 0.353041, 0.390587, 0.425555, 0.45788, 0.487604, 0.514843, + 0.539752, 0.562504, 0.583282, 0.602263, 0.619612, 0.635457, 0.649765, 0.66208, 0.671249, 0.675509, + 0.673048, 0.662709, 0.644394, 0.619024, 0.588194, 0.55375, 0.517448, 0.480768, 0.444831, 0.410418, + 0.378015, 0.347879, 0.320103, 0.294667, 0.271474, 0.250391, 0.231257, 0.213907, 0.198178, 0.183914, + 0.170967, 0.159205, 0.148505, 0.138758, 0.129864, 0.121737, 0.114299, 0.107478, 0.101214, 0.0954507, + 0.0901402, 0.0852385, 0.0807069, 0.0765108, 0.0726194, 0.0690052, 0.0656435, 0.0625123, 0.0595916, 0.0568637, + 0.0543125, 0.0519236, 0.0496838, 0.0475815, 0.0456058, 0.0437472, 0.0419966, 0.0403463, 0.0387887, 0.0373173, + 0.0359259, 0.034609, 0.0333615, 0.0321786, 0.0310561, 0.02999, 0.0289767, 0.0280127, 0.0270951, 0.0262209, + 0.0253875, 0.0245923, 0.0238333, 0.0231082, 0.022415, 0.021752, 0.0211174, 0.0205097, 0.0199274, 0.0193692, + 0.0188336, 0.0183196, 0.017826, 0.0173518, 0.0168959, 0.0164575, 0.0160356, 0.0156296, 0.0152385, 0.0148617, + 0.0144984, 0.0141482, 0.0138103, 0.0134842, 0.0131693, 0.0128652, 0.0125714, 0.0122873, 0.0120127, 0.011747, + 0.01149, 0.0112412, 0.0110002 }; + }; template diff --git a/RecoLocalCalo/HcalRecAlgos/src/HcalDeterministicFit.cc b/RecoLocalCalo/HcalRecAlgos/src/HcalDeterministicFit.cc index 12a926e9ad5e9..3d4298184f7d8 100644 --- a/RecoLocalCalo/HcalRecAlgos/src/HcalDeterministicFit.cc +++ b/RecoLocalCalo/HcalRecAlgos/src/HcalDeterministicFit.cc @@ -45,6 +45,18 @@ void HcalDeterministicFit::getLandauFrac(float tStart, float tEnd, float &sum) c return; } + +constexpr float HcalDeterministicFit::siPM205Frac[]; +void HcalDeterministicFit::get205Frac(float tStart, float tEnd, float &sum) const{ + + if (std::abs(tStart-tEnd-tsWidth)<0.1) { + sum=0; + return; + } + sum= siPM205Frac[int(ceil(tStart+tsWidth))]; + return; +} + void HcalDeterministicFit::phase1Apply(const HBHEChannelInfo& channelData, float& reconstructedEnergy, float& reconstructedTime) const @@ -104,26 +116,40 @@ void HcalDeterministicFit::phase1Apply(const HBHEChannelInfo& channelData, } + float ch3=0; + float ch4=0; + float ch5=0; + float i3=0; - getLandauFrac(-tsShift3,-tsShift3+tsWidth,i3); float n3=0; - getLandauFrac(-tsShift3+tsWidth,-tsShift3+tsWidth*2,n3); float nn3=0; - getLandauFrac(-tsShift3+tsWidth*2,-tsShift3+tsWidth*3,nn3); float i4=0; - getLandauFrac(-tsShift4,-tsShift4+tsWidth,i4); float n4=0; - getLandauFrac(-tsShift4+tsWidth,-tsShift4+tsWidth*2,n4); - float i5=0; - getLandauFrac(-tsShift5,-tsShift5+tsWidth,i5); float n5=0; - getLandauFrac(-tsShift5+tsWidth,-tsShift5+tsWidth*2,n5); - float ch3=0; - float ch4=0; - float ch5=0; + if(channelData.hasTimeInfo() && channelData.recoShape()==205) { + get205Frac(-tsShift3,-tsShift3+tsWidth,i3); + get205Frac(-tsShift3+tsWidth,-tsShift3+tsWidth*2,n3); + get205Frac(-tsShift3+tsWidth*2,-tsShift3+tsWidth*3,nn3); + + get205Frac(-tsShift4,-tsShift4+tsWidth,i4); + get205Frac(-tsShift4+tsWidth,-tsShift4+tsWidth*2,n4); + + get205Frac(-tsShift5,-tsShift5+tsWidth,i5); + get205Frac(-tsShift5+tsWidth,-tsShift5+tsWidth*2,n5); + } else { + getLandauFrac(-tsShift3,-tsShift3+tsWidth,i3); + getLandauFrac(-tsShift3+tsWidth,-tsShift3+tsWidth*2,n3); + getLandauFrac(-tsShift3+tsWidth*2,-tsShift3+tsWidth*3,nn3); + + getLandauFrac(-tsShift4,-tsShift4+tsWidth,i4); + getLandauFrac(-tsShift4+tsWidth,-tsShift4+tsWidth*2,n4); + + getLandauFrac(-tsShift5,-tsShift5+tsWidth,i5); + getLandauFrac(-tsShift5+tsWidth,-tsShift5+tsWidth*2,n5); + } if (i3 != 0 && i4 != 0 && i5 != 0) { @@ -141,7 +167,12 @@ void HcalDeterministicFit::phase1Apply(const HBHEChannelInfo& channelData, if (ratio < 5 && ratio > 0.5) { double invG = invGpar[0]+invGpar[1]*std::sqrt(2*std::log(invGpar[2]/ratio)); float iG=0; - getLandauFrac(-invG,-invG+tsWidth,iG); + + if(channelData.hasTimeInfo() && channelData.recoShape()==205) { + get205Frac(-invG,-invG+tsWidth,iG); + } else { + getLandauFrac(-invG,-invG+tsWidth,iG); + } if (iG != 0 ) { ch4=(corrCharge[4]-ch3*n3)/(iG); tsShift4=invG; diff --git a/SimCalorimetry/HcalSimAlgos/interface/HcalShapes.h b/SimCalorimetry/HcalSimAlgos/interface/HcalShapes.h index 28fa5177ddfcd..f43189fdf50d2 100644 --- a/SimCalorimetry/HcalSimAlgos/interface/HcalShapes.h +++ b/SimCalorimetry/HcalSimAlgos/interface/HcalShapes.h @@ -47,6 +47,7 @@ class HcalShapes : public CaloShapes HcalShape theHcalShape201; HcalShape theHcalShape202; HcalShape theHcalShape203; + HcalShape theHcalShape205; HcalShape theHcalShape301; HcalShape theHcalShape401; diff --git a/SimCalorimetry/HcalSimAlgos/src/HcalShapes.cc b/SimCalorimetry/HcalSimAlgos/src/HcalShapes.cc index c61c8552ed515..8c4c45a72d00b 100644 --- a/SimCalorimetry/HcalSimAlgos/src/HcalShapes.cc +++ b/SimCalorimetry/HcalSimAlgos/src/HcalShapes.cc @@ -24,6 +24,7 @@ HcalShapes::HcalShapes() theHcalShape201(), theHcalShape202(), theHcalShape203(), + theHcalShape205(), theHcalShape301(), theHcalShape401() { @@ -47,7 +48,7 @@ HcalShapes::HcalShapes() theHcalShape104.setShape(104); theShapes[104] = new CaloCachedShapeIntegrator(&theHcalShape104); theHcalShape104.setShape(105); - theShapes[105] = new CaloCachedShapeIntegrator(&theHcalShape105); // HPD new + theShapes[105] = new CaloCachedShapeIntegrator(&theHcalShape105); // HPD reco theHcalShape123.setShape(123); theShapes[123] = new CaloCachedShapeIntegrator(&theHcalShape123); theHcalShape124.setShape(124); @@ -60,6 +61,8 @@ HcalShapes::HcalShapes() theShapes[202] = new CaloCachedShapeIntegrator(&theHcalShape202); theHcalShape203.setShape(203); theShapes[203] = new CaloCachedShapeIntegrator(&theHcalShape203); + theHcalShape205.setShape(205); + theShapes[205] = new CaloCachedShapeIntegrator(&theHcalShape205); theHcalShape301.setShape(301); theShapes[301] = new CaloCachedShapeIntegrator(&theHcalShape301); // ZDC not yet defined in CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc