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))];
49 float& reconstructedEnergy,
50 float& reconstructedTime)
const 53 std::vector<double> corrCharge;
54 std::vector<double> inputCharge;
55 std::vector<double> inputPedestal;
59 for(
unsigned int ip=0; ip<channelData.
nSamples(); ip++){
66 inputCharge.push_back(charge);
67 inputPedestal.push_back(ped);
71 fPedestalSubFxn_.calculate(inputCharge, inputPedestal, corrCharge);
75 double fpar0, fpar1, fpar2;
90 if (fTimeSlew==0)respCorr=1.0;
91 else if (fTimeSlew==1) channelData.
hasTimeInfo()?respCorr=rCorrSiPM[0]:respCorr=rCorr[0];
92 else if (fTimeSlew==2) channelData.
hasTimeInfo()?respCorr=rCorrSiPM[1]:respCorr=rCorr[1];
93 else if (fTimeSlew==3)respCorr=frespCorr;
108 getLandauFrac(-tsShift3,-tsShift3+tsWidth,i3);
110 getLandauFrac(-tsShift3+tsWidth,-tsShift3+tsWidth*2,n3);
112 getLandauFrac(-tsShift3+tsWidth*2,-tsShift3+tsWidth*3,nn3);
115 getLandauFrac(-tsShift4,-tsShift4+tsWidth,i4);
117 getLandauFrac(-tsShift4+tsWidth,-tsShift4+tsWidth*2,n4);
120 getLandauFrac(-tsShift5,-tsShift5+tsWidth,i5);
122 getLandauFrac(-tsShift5+tsWidth,-tsShift5+tsWidth*2,n5);
128 if (i3 != 0 && i4 != 0 && i5 != 0) {
130 ch3=corrCharge[3]/i3;
131 ch4=(i3*corrCharge[4]-n3*corrCharge[3])/(i3*i4);
132 ch5=(n3*n4*corrCharge[3]-i4*nn3*corrCharge[3]-i3*n4*corrCharge[4]+i3*i4*corrCharge[5])/(i3*i4*i5);
134 if (ch3<negThresh[0]) {
136 ch4=corrCharge[4]/i4;
137 ch5=(i4*corrCharge[5]-n4*corrCharge[4])/(i4*i5);
139 if (ch5<negThresh[0] && ch4>negThresh[1]) {
140 double ratio = (corrCharge[4]-ch3*i3)/(corrCharge[5]-negThresh[0]*i5);
141 if (ratio < 5 && ratio > 0.5) {
144 getLandauFrac(-invG,-invG+tsWidth,iG);
146 ch4=(corrCharge[4]-ch3*n3)/(iG);
157 reconstructedEnergy=ch4*gainCorr*respCorr;
158 reconstructedTime=tsShift4;
static constexpr float rCorr[2]
double tsGain(const unsigned ts) const
static constexpr float rCorrSiPM[2]
static constexpr int HcalRegion[2]
static constexpr float landauFrac[]
void phase1Apply(const HBHEChannelInfo &channelData, float &reconstructedEnergy, float &reconstructedTime) const
double tsPedestal(const unsigned ts) const
double tsRawCharge(const unsigned ts) const
int ieta() const
get the cell ieta
Abs< T >::type abs(const T &t)
void getLandauFrac(float tStart, float tEnd, float &sum) const
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]