127 int ifirst = mySignalTS[0];
129 double ampl=0;
int maxI = -1;
double maxA = -1e10;
double ta=0;
131 double lowGEnergy=0;
double lowGfc_ampl=0;
double TempLGAmp=0;
143 for(
unsigned int iv = 0; iv<myNoiseTS.size(); ++iv)
145 CurrentTS = myNoiseTS[iv];
146 Allnoise += tool[CurrentTS];
149 if(noiseslices != 0) {
150 noise = (Allnoise)/
double(noiseslices);
154 for(
unsigned int ivs = 0; ivs<mySignalTS.size(); ++ivs)
156 CurrentTS = mySignalTS[ivs];
157 int capid=digi[CurrentTS].capid();
163 ta = tool[CurrentTS]-noise;
173 for(
unsigned int iLGvs = 0; iLGvs<mySignalTS.size(); ++iLGvs)
176 int capid=digi[CurrentTS].capid();
177 TempLGAmp = tool[CurrentTS]-noise;
178 lowGfc_ampl+=TempLGAmp;
181 lowGEnergy+=TempLGAmp;
190 if(maxI==0 || maxI==(tool.
size()-1)) {
191 LogDebug(
"HCAL Pulse") <<
"ZdcSimpleRecAlgo::reco2 :" 192 <<
" Invalid max amplitude position, " 193 <<
" max Amplitude: "<< maxI
194 <<
" first: "<<ifirst
195 <<
" last: "<<(tool.
size()-1)
198 int capid=digi[maxI-1].capid();
199 double Energy0 = ((tool[maxI-1])*calibs.
respcorrgain(capid) );
202 if(Energy0<0){Energy0=0.;}
203 capid=digi[
maxI].capid();
205 if(Energy1<0){Energy1=0.;}
206 capid=digi[maxI+1].capid();
207 double Energy2 = ((tool[maxI+1])*calibs.
respcorrgain(capid) );
208 if(Energy2<0){Energy2=0.;}
210 double TSWeightEnergy = ((maxI-1)*Energy0 + maxI*Energy1 + (maxI+1)*Energy2);
211 double EnergySum=Energy0+Energy1+Energy2;
213 if (EnergySum!=0) AvgTSPos=TSWeightEnergy/ EnergySum;
219 time = (AvgTSPos*25.0);
226 return RecHit(digi.id(),ampl,
time,lowGEnergy);
double respcorrgain(int fCapId) const
get response corrected gain for capid=0..3
double getCorrection(double fc_ampl) const
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const =0
int size() const
get the size