23 applyTimeSlew_=iApplyTimeSlew;
38 sum= landauFrac[
int(ceil(tStart+tsWidth))];
49 sum= siPM205Frac[
int(ceil(tStart+tsWidth))];
60 sum= siPM206Frac[
int(ceil(tStart+tsWidth))];
72 sum= siPM207Frac[
int(ceil(tStart+tsWidth))];
78 case shape205: get205Frac(tStart,tEnd,sum);
break;
79 case shape206: get206Frac(tStart,tEnd,sum);
break;
80 case shape207: get207Frac(tStart,tEnd,sum);
break;
81 case shapeLandau: getLandauFrac(tStart,tEnd,sum);
break;
86 float& reconstructedEnergy,
87 float& reconstructedTime,
92 unsigned int soi=channelData.
soi();
94 std::vector<double> corrCharge;
95 std::vector<double> inputCharge;
96 std::vector<double> inputPedestal;
97 std::vector<double> inputNoise;
101 for(
unsigned int ip=0; ip<channelData.
nSamples(); ip++){
109 inputCharge.push_back(charge);
110 inputPedestal.push_back(ped);
111 inputNoise.push_back(noise);
115 fPedestalSubFxn_.calculate(inputCharge, inputPedestal, inputNoise, corrCharge, soi, channelData.
nSamples());
117 if (fTimeSlew_==0) respCorr=1.0;
118 else if (fTimeSlew_==1) channelData.
hasTimeInfo()?respCorr=rCorrSiPM[0]:respCorr=rCorr[0];
119 else if (fTimeSlew_==2) channelData.
hasTimeInfo()?respCorr=rCorrSiPM[1]:respCorr=rCorr[1];
120 else if (fTimeSlew_==3) respCorr=frespCorr_;
122 float tsShift3,tsShift4,tsShift5;
123 tsShift3=0.f,tsShift4=0.f,tsShift5=0.f;
126 tsShift3=hcalTimeSlew_delay->
delay(inputCharge[soi-1], fTimeSlew_, fTimeSlewBias_, !channelData.
hasTimeInfo());
127 tsShift4=hcalTimeSlew_delay->
delay(inputCharge[soi], fTimeSlew_, fTimeSlewBias_, !channelData.
hasTimeInfo());
128 tsShift5=hcalTimeSlew_delay->
delay(inputCharge[soi+1], fTimeSlew_, fTimeSlewBias_, !channelData.
hasTimeInfo());
131 float ch3,ch4,ch5, i3,n3,nn3, i4,n4,i5,n5;
132 ch4=0.f,i3=0.f,n3=0.f,nn3=0.f,i4=0.f,n4=0.f,i5=0.f,n5=0.f;
138 else fType = shapeLandau;
140 getFrac(-tsShift3,-tsShift3+tsWidth,i3,fType);
141 getFrac(-tsShift3+tsWidth,-tsShift3+tsWidth*2,n3,fType);
142 getFrac(-tsShift3+tsWidth*2,-tsShift3+tsWidth*3,nn3,fType);
144 getFrac(-tsShift4,-tsShift4+tsWidth,i4,fType);
145 getFrac(-tsShift4+tsWidth,-tsShift4+tsWidth*2,n4,fType);
147 getFrac(-tsShift5,-tsShift5+tsWidth,i5,fType);
148 getFrac(-tsShift5+tsWidth,-tsShift5+tsWidth*2,n5,fType);
150 if (i3 != 0 && i4 != 0 && i5 != 0) {
152 ch3=corrCharge[soi-1]/i3;
153 ch4=(i3*corrCharge[soi]-n3*corrCharge[soi-1])/(i3*i4);
154 ch5=(n3*n4*corrCharge[soi-1]-i4*nn3*corrCharge[soi-1]-i3*n4*corrCharge[soi]+i3*i4*corrCharge[soi+1])/(i3*i4*i5);
156 if (ch3<negThresh[0]) {
158 ch4=corrCharge[soi]/i4;
159 ch5=(i4*corrCharge[soi+1]-n4*corrCharge[soi])/(i4*i5);
161 if (ch5<negThresh[0] && ch4>negThresh[1]) {
162 double ratio = (corrCharge[soi]-ch3*i3)/(corrCharge[soi+1]-negThresh[0]*i5);
163 if (ratio < 5 && ratio > 0.5) {
166 getFrac(-invG,-invG+tsWidth,iG,fType);
168 ch4=(corrCharge[soi]-ch3*n3)/(iG);
179 reconstructedEnergy=ch4*gainCorr*respCorr;
180 reconstructedTime=tsShift4;
void getFrac(float, float, float &, FType) const
static constexpr float rCorr[2]
double tsGain(const unsigned ts) const
static constexpr float rCorrSiPM[2]
void get206Frac(float tStart, float tEnd, float &sum) const
static constexpr int HcalRegion[2]
double delay(double fC, BiasSetting bias=Medium) const
Returns the amount (ns) by which a pulse of the given number of fC will be delayed by the timeslew ef...
double tsPedestal(const unsigned ts) const
double tsRawCharge(const unsigned ts) const
static constexpr float siPM206Frac[125]
void get205Frac(float tStart, float tEnd, float &sum) const
Abs< T >::type abs(const T &t)
static constexpr float siPM205Frac[125]
void getLandauFrac(float tStart, float tEnd, float &sum) const
void get207Frac(float tStart, float tEnd, float &sum) const
void init(HcalTimeSlew::ParaSource tsParam, HcalTimeSlew::BiasSetting bias, bool iApplyTimeSlew, double respCorr)
static constexpr float landauFrac[125]
double tsPedestalWidth(const unsigned ts) const
static constexpr float siPM207Frac[125]
static constexpr float negThresh[2]
unsigned nSamples() const
void phase1Apply(const HBHEChannelInfo &channelData, float &reconstructedEnergy, float &reconstructedTime, const HcalTimeSlew *hcalTimeSlew_delay) const
static constexpr float invGpar[3]