8 const std::string& name,
9 const IInterface* parent )
13 declareInterface<LArPhysWaveTool>(
this);
16 bool injPcorr[4] = { false , true , true ,
false } ;
20 bool injPtaur[4] = { false , false , true ,
false } ;
41 float& MphysMcali)
const {
51 unsigned tstart = wHelper.
getStart(gCaliMB) ;
60 ATH_MSG_VERBOSE (
"*** Normalisation \t|-> YES (CaliWave peak = " << peak <<
")" );
64 gCaliMB = gCaliMB * (1./peak) ;
79 && larWFParam.
omega0() != 0. ) ;
81 const unsigned N = gCaliMB.
getSize();
82 const double dt = gCaliMB.
getDt() ;
85 if ( ! doInjPointCorr ) {
88 gPhys =
exp2Tri ( gCaliMB,N,dt, larWFParam) ;
97 gPhys =
injResp (
exp2Tri ( gCaliMB,N,dt,paramsNoTaur),N,dt,paramsNoTaur);
100 gPhys =
injResp (
exp2Tri ( gCaliMB,N,dt,larWFParam),N,dt,larWFParam);
112 ATH_MSG_VERBOSE (
"*** Physics waveform\t|-> m_MphysMcali = " << MphysMcali );
116 return StatusCode::SUCCESS;
126 for (
unsigned i=0 ; i<N ; i++ ) {
136 const double fstep = params.fstep() ;
137 const double Tc = params.tcal() ;
138 const double Td = params.tdrift() ;
140 if ( fstep==0. )
return ((1.-
Tc/Td)-t/Td)/
Tc ;
141 return (1.-fstep)/
Tc * exp (-fstep*t/
Tc)
142 +1./(fstep*Td) * ((1.-fstep)*exp(-fstep*t/
Tc)-1.);
145 if ( fstep==0. )
return ((1.-
Tc/Td)-t/Td)/
Tc
146 + ((t-Td)/Td+
Tc/Td)/
Tc ;
147 return (1.-fstep)/
Tc * exp (-fstep*t/
Tc)
148 +1./(fstep*Td) * ( (1.-fstep)*exp(-fstep*t/
Tc) - 1. )
149 -1./(fstep*Td) * ( (1.-fstep)*exp(-fstep*(t-Td)/
Tc) - 1. ) ;
173 return w %
injCorr(N,dt,params);
177 const unsigned N=gCali.
getSize();
178 const double dt=gCali.
getDt();
180 return gCali + gCali %
stepCorr(N,dt,params) ;
189 if ( t<0. || t>=Td )
return 0. ;
194 for (
unsigned i=0 ; i<N ; i++ ) w.setSample(i,
stepPhysCorr(i*dt,Td)) ;
201 for (
unsigned i=0 ; i<N ; i++ ) w.setSample(i,
stepCorr(i*dt,params)) ;
205 const double fstep = params.fstep();
206 const double Tc = params.tcal();
207 return (1.-fstep)/
Tc * exp( -fstep*t/
Tc );
213 for (
unsigned i=0 ; i<N ; i++ ) w.setSample(i,
injCorr(i*dt,params)) ;
220 const double tau0 = 1./params.omega0();
221 const double taur = params.taur();
222 const double Delta = std::pow(taur,2) - std::pow(2*
tau0,2) ;
224 double sqrtDelta = std::sqrt(Delta) ;
225 double taup = 0.5*( taur + sqrtDelta ) ;
226 double taum = 0.5*( taur - sqrtDelta ) ;
227 return ( exp(-t/
taup) - exp(-t/taum) ) / (
taup - taum ) ;
228 }
else if ( Delta < 0 ) {
229 double T = std::sqrt(-Delta) ;
230 double A = 2 * taur / ( std::pow(taur,2) - Delta ) ;
231 double B = 2 * T / ( std::pow(taur,2) - Delta ) ;
232 return 2 * exp(-
A*t) * sin(B*t) / T ;
234 double tau = 0.5 * taur ;
235 return exp(-t/tau) * t / std::pow(tau,2) ;
238 double taur2 = taur*taur, tau02 =
tau0*
tau0 ;
239 double taua = sqrt( 4.*tau02 - taur2 );
240 return (2./taua)*exp(-t*taur/(2.*tau02))*sin(t*taua/(2.*tau02));
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
void setTaur(double taur)
LArWave translate(const LArWave &theWave, int nShift, double baseline=0.) const
double getBaseline(const LArWave &theWave, unsigned nBase) const
unsigned int getMax(const LArWave &theWave) const
return index of maximum sample
unsigned getStart(const LArWave &theWave) const
size_t getSize() const
number of time samples
const double & getSample(const unsigned int i) const
Amplitude per time bin.
const std::vector< double > & getWave() const
Wave parameters.
const double & getDt() const
delta time
hold the test vectors and ease the comparison