Skip to content

Commit

Permalink
Merge pull request #19070 from mariadalfonso/siPMdataM2Shape_92X
Browse files Browse the repository at this point in the history
HEP17: pulse shape update (M2,M3,M0)
  • Loading branch information
davidlange6 committed Jun 8, 2017
2 parents cfe1504 + 948eeb3 commit e64b162
Show file tree
Hide file tree
Showing 6 changed files with 360 additions and 28 deletions.
3 changes: 2 additions & 1 deletion CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h
Expand Up @@ -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;
Expand Down
278 changes: 278 additions & 0 deletions CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc
Expand Up @@ -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
--------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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<float> 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()
{

Expand Down
46 changes: 32 additions & 14 deletions RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h
Expand Up @@ -28,6 +28,7 @@ class HcalDeterministicFit {
template<class Digi>
void apply(const CaloSamples & cs, const std::vector<int> & 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;
Expand All @@ -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<class Digi>
Expand Down

0 comments on commit e64b162

Please sign in to comment.