128 int ifirst = mySignalTS[0];
130 double ampl=0;
int maxI = -1;
double maxA = -1e10;
double ta=0;
132 double lowGEnergy=0;
double lowGfc_ampl=0;
double TempLGAmp=0;
144 for(
unsigned int iv = 0; iv<myNoiseTS.size(); ++iv)
146 CurrentTS = myNoiseTS[iv];
147 if ( CurrentTS >= digi.size() )
continue;
148 Allnoise += tool[CurrentTS];
151 if(noiseslices != 0) {
152 noise = (Allnoise)/
double(noiseslices);
156 for(
unsigned int ivs = 0; ivs<mySignalTS.size(); ++ivs)
158 CurrentTS = mySignalTS[ivs];
159 if ( CurrentTS >= digi.size() )
continue;
160 int capid=digi[CurrentTS].capid();
166 ta = tool[CurrentTS]-noise;
176 for(
unsigned int iLGvs = 0; iLGvs<mySignalTS.size(); ++iLGvs)
179 if ( CurrentTS >= digi.size() )
continue;
180 int capid=digi[CurrentTS].capid();
181 TempLGAmp = tool[CurrentTS]-noise;
182 lowGfc_ampl+=TempLGAmp;
185 lowGEnergy+=TempLGAmp;
194 if(maxI==0 || maxI==(tool.
size()-1)) {
195 LogDebug(
"HCAL Pulse") <<
"ZdcSimpleRecAlgo::reco2 :" 196 <<
" Invalid max amplitude position, " 197 <<
" max Amplitude: "<< maxI
198 <<
" first: "<<ifirst
199 <<
" last: "<<(tool.
size()-1)
202 int capid=digi[maxI-1].capid();
203 double Energy0 = ((tool[maxI-1])*calibs.
respcorrgain(capid) );
206 if(Energy0<0){Energy0=0.;}
207 capid=digi[
maxI].capid();
209 if(Energy1<0){Energy1=0.;}
210 capid=digi[maxI+1].capid();
211 double Energy2 = ((tool[maxI+1])*calibs.
respcorrgain(capid) );
212 if(Energy2<0){Energy2=0.;}
214 double TSWeightEnergy = ((maxI-1)*Energy0 + maxI*Energy1 + (maxI+1)*Energy2);
215 double EnergySum=Energy0+Energy1+Energy2;
217 if (EnergySum!=0) AvgTSPos=TSWeightEnergy/ EnergySum;
223 time = (AvgTSPos*25.0);
230 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