21 for(
int fi=0; fi<9; fi++){
22 fpars[fi] = pars.at(fi);
25 applyTimeSlew_=iApplyTimeSlew;
28 fPedestalSubFxn_=pedSubFxn_;
40 if (
std::abs(tStart-tEnd-tsWidth)<0.1) {
44 sum= landauFrac[
int(ceil(tStart+tsWidth))];
52 if (
std::abs(tStart-tEnd-tsWidth)<0.1) {
56 sum= siPM205Frac[
int(ceil(tStart+tsWidth))];
61 float& reconstructedEnergy,
62 float& reconstructedTime)
const 65 std::vector<double> corrCharge;
66 std::vector<double> inputCharge;
67 std::vector<double> inputPedestal;
71 for(
unsigned int ip=0; ip<channelData.
nSamples(); ip++){
78 inputCharge.push_back(charge);
79 inputPedestal.push_back(ped);
83 fPedestalSubFxn_.calculate(inputCharge, inputPedestal, corrCharge);
87 double fpar0, fpar1, fpar2;
102 if (fTimeSlew==0)respCorr=1.0;
103 else if (fTimeSlew==1) channelData.
hasTimeInfo()?respCorr=rCorrSiPM[0]:respCorr=rCorr[0];
104 else if (fTimeSlew==2) channelData.
hasTimeInfo()?respCorr=rCorrSiPM[1]:respCorr=rCorr[1];
105 else if (fTimeSlew==3)respCorr=frespCorr;
133 get205Frac(-tsShift3,-tsShift3+tsWidth,i3);
134 get205Frac(-tsShift3+tsWidth,-tsShift3+tsWidth*2,n3);
135 get205Frac(-tsShift3+tsWidth*2,-tsShift3+tsWidth*3,nn3);
137 get205Frac(-tsShift4,-tsShift4+tsWidth,i4);
138 get205Frac(-tsShift4+tsWidth,-tsShift4+tsWidth*2,n4);
140 get205Frac(-tsShift5,-tsShift5+tsWidth,i5);
141 get205Frac(-tsShift5+tsWidth,-tsShift5+tsWidth*2,n5);
143 getLandauFrac(-tsShift3,-tsShift3+tsWidth,i3);
144 getLandauFrac(-tsShift3+tsWidth,-tsShift3+tsWidth*2,n3);
145 getLandauFrac(-tsShift3+tsWidth*2,-tsShift3+tsWidth*3,nn3);
147 getLandauFrac(-tsShift4,-tsShift4+tsWidth,i4);
148 getLandauFrac(-tsShift4+tsWidth,-tsShift4+tsWidth*2,n4);
150 getLandauFrac(-tsShift5,-tsShift5+tsWidth,i5);
151 getLandauFrac(-tsShift5+tsWidth,-tsShift5+tsWidth*2,n5);
154 if (i3 != 0 && i4 != 0 && i5 != 0) {
156 ch3=corrCharge[3]/i3;
157 ch4=(i3*corrCharge[4]-n3*corrCharge[3])/(i3*i4);
158 ch5=(n3*n4*corrCharge[3]-i4*nn3*corrCharge[3]-i3*n4*corrCharge[4]+i3*i4*corrCharge[5])/(i3*i4*i5);
160 if (ch3<negThresh[0]) {
162 ch4=corrCharge[4]/i4;
163 ch5=(i4*corrCharge[5]-n4*corrCharge[4])/(i4*i5);
165 if (ch5<negThresh[0] && ch4>negThresh[1]) {
166 double ratio = (corrCharge[4]-ch3*i3)/(corrCharge[5]-negThresh[0]*i5);
167 if (ratio < 5 && ratio > 0.5) {
172 get205Frac(-invG,-invG+tsWidth,iG);
174 getLandauFrac(-invG,-invG+tsWidth,iG);
177 ch4=(corrCharge[4]-ch3*n3)/(iG);
188 reconstructedEnergy=ch4*gainCorr*respCorr;
189 reconstructedTime=tsShift4;
static constexpr float rCorr[2]
double tsGain(const unsigned ts) const
static constexpr float rCorrSiPM[2]
static constexpr int HcalRegion[2]
void phase1Apply(const HBHEChannelInfo &channelData, float &reconstructedEnergy, float &reconstructedTime) const
double tsPedestal(const unsigned ts) const
double tsRawCharge(const unsigned ts) const
void get205Frac(float tStart, float tEnd, float &sum) const
int ieta() const
get the cell ieta
Abs< T >::type abs(const T &t)
static constexpr float siPM205Frac[125]
void getLandauFrac(float tStart, float tEnd, float &sum) const
static constexpr float landauFrac[125]
void init(HcalTimeSlew::ParaSource tsParam, HcalTimeSlew::BiasSetting bias, bool iApplyTimeSlew, PedestalSub pedSubFxn_, std::vector< double > pars, double respCorr)
static constexpr float negThresh[2]
unsigned nSamples() const
static double delay(double fC, BiasSetting bias=Medium)
Returns the amount (ns) by which a pulse of the given number of fC will be delayed by the timeslew ef...
static constexpr float invGpar[3]