|
ATLAS Offline Software
|
Go to the documentation of this file.
21 #ifndef LAR_MAX_DOUBLE
23 #define LAR_MAX_DOUBLE MAXDOUBLE
25 #define LAR_MAX_DOUBLE __DBL_MAX__
39 m_ShiftToStart(false),
40 m_SubtractBaseline(false),
41 m_UseOmegaScanHelper(false)
45 declareInterface<LArWFParamTool>(
this);
53 int default_deltattail[3] = { 100, 50, 0 } ;
54 for (
unsigned i=0;
i<3; ++
i )
60 int default_ttailmin[4] = { 0, 0, 0, 0 };
61 int default_ttailmax[4] = { 0, 0, 0, 0 };
62 for (
unsigned i=0;
i<4; ++
i ) {
71 bool defaults[4] = { false , true , false ,
true } ;
72 for (
unsigned i=0 ;
i<4 ; ++
i )
81 float default_omegamin[4] = { 0.01 , 0.10 , 0.10 , 0.10 };
82 float default_omegamax[4] = { 1.00 , 0.33 , 0.20 , 0.33 };
83 unsigned default_npoints[4] = { 100 , 100 , 100 , 100 };
87 for (
unsigned i=0 ;
i<4 ; ++
i ) {
114 std::string layerName[4] = {
"PS" ,
"Strips" ,
"Middle" ,
"Back" } ;
123 ATH_MSG_INFO(
"Cosine response (Omega0) -> Will use OmegaScanHelper() to dynamically select settings" );
136 ATH_MSG_INFO(
"Will use OmegaScanHelper() to dynamically select settings" ) ;
142 return StatusCode::FAILURE ;
180 return StatusCode::FAILURE;
189 return StatusCode::FAILURE;
193 return StatusCode::SUCCESS;
202 std::optional<LArCaliWave>& omegaScanWave,
203 std::optional<LArCaliWave>& resOscill0,
204 std::optional<LArCaliWave>& resOscill1)
const
216 const double Tcal =
expTail(gCali,waveTiming) ;
219 <<
" gain=" << (
int)
gain ) ;
221 return StatusCode::FAILURE;
232 if (
sc.isFailure() ) {
234 <<
" gain=" << (
int)
gain );
245 if (
sc.isFailure() ) {
247 <<
" gain=" << (
int)
gain );
266 if (
sc.isFailure() ) {
268 <<
" gain=" << (
int)
gain ) ;
282 return( StatusCode::SUCCESS );
305 wt.Amplitude = gCali.
getSample(wt.Tpeak);
323 const unsigned nAfterMin = 150;
324 const unsigned nBeforeEnd = 125;
332 if (fitPars.size() == 2 ) {
339 const double Tcal = -1./
A ;
353 const double fstep1=0.0;
354 const double Tcal=wfParams.
tcal();
357 return StatusCode::SUCCESS ;
365 const double dfstep =
dFstep(gCali,fstep,Tc,Ttail) ;
367 if ( niter > 50 || fstep < 0. ) {
371 if ( fabs( dfstep ) <=
m_TINY )
break;
399 const unsigned N = gCali.
getSize() ;
400 const double dt = gCali.
getDt() ;
403 const double A=(1.-fstep)/Tc;
404 for (
unsigned i=0 ;
i<
N ;
i++ ) {
415 return (-1./Tc)*(1.+((1.-fstep)/Tc)*
t)*
exp(-fstep*
t/Tc);
419 const unsigned N = gCali.
getSize() ;
420 const double dt = gCali.
getDt() ;
438 OSParams.omegamin = 0.01 ;
439 OSParams.omegamax = 1. ;
440 OSParams.Npoint = 100 ;
441 OSParams.DeltaOmega = 0.01 ;
451 OSParams.DeltaOmega = 0.02 ;
464 if ( OSParams.cosRespScan ){
466 const double dOmega = (OSParams.omegamax-OSParams.omegamin)/OSParams.Npoint;
467 const unsigned vectSize = (
unsigned) ceil ( OSParams.omegamax/dOmega );
469 if (omegaScanWave) omegaScanWave->setSize(vectSize);
471 for (
int i=0;
i<OSParams.Npoint;
i++) {
472 const double omega = OSParams.omegamin+dOmega*
i ;
474 if (omegaScanWave) omegaScanWave->setSample(
i+
indexmin,
chi2);
475 if (
chi2 < chi2min ) {
481 OSParams.omegamin = omega0raw - OSParams.DeltaOmega ;
482 OSParams.omegamax = omega0raw + OSParams.DeltaOmega ;
485 if ( OSParams.omegamin == OSParams.omegamax ) {
494 return StatusCode::SUCCESS ;
513 ret.DeltaOmega = 0.02 ;
520 ret.range.min = wt.
Tstart;
521 ret.range.max = wt.
Tcross;
523 ret.omegamin = 0.240;
524 ret.omegamax = 0.330;
529 ret.range.min = wt.
Tstart;
530 ret.range.max = wt.
Tcross;
531 ret.cosRespScan =
true;
537 ret.omegamin = 0.220;
538 ret.omegamax = 0.310;
547 ret.range.min = wt.
Tstart;
549 ret.cosRespScan =
false;
550 ret.omegamin = 0.060;
551 ret.omegamax = 0.215;
556 ret.range.min = wt.
Tstart;
557 ret.range.max = wt.
Tcross;
558 ret.cosRespScan =
false;
559 ret.omegamin = 0.100;
560 ret.omegamax = 0.700;
574 ret.DeltaOmega = 0.001 ;
580 if ( IsEMECInnerWheel ) {
585 ret.omegamin = 0.12 ;
588 ret.omegamin = 0.12 ;
590 ret.omegamax = 0.16 ;
595 ret.omegamin = 0.14 ;
596 ret.omegamax = 0.18 ;
608 ret.cosRespScan =
true;
613 ret.cosRespScan =
false;
623 ret.cosRespScan =
false;
630 ret.cosRespScan =
true;
634 ret.omegamax = 0.140 ;
637 ret.omegamax = 0.135 ;
640 ret.omegamax = 0.15 ;
647 ret.omegamin = 0.12 ;
648 ret.omegamax = 0.20 ;
651 ret.omegamin = 0.12 ;
652 ret.omegamax = 0.22 ;
655 ret.omegamin = 0.12 ;
656 ret.omegamax = 0.24 ;
659 ret.omegamin = 0.12 ;
660 ret.omegamax = 0.245 ;
664 ret.omegamin = 0.24 ;
665 ret.omegamax = 0.32 ;
668 ret.cosRespScan =
false;
690 double taurmax = 100.;
713 return StatusCode::SUCCESS ;
721 return cosResp(gCali,fstep,tcal,
w) * (
pow((1.+
w*
w*tsh*tsh),1.5)/(
w*tsh));
739 const double C1=(fstep*fstep-fstep*fstep*fstep)/Tc;
740 const double C2=(fstep+omega*omega*Tc*Tc);
741 const double C3=(fstep-1.)*omega*Tc;
742 const double C4=( fstep*fstep+omega*omega*Tc*Tc );
743 for (
unsigned i=0 ;
i<
N ;
i++ ) {
746 const double p=(C1*
exp(-fstep*
t/Tc) - omega*(C2*
sin(omega*
t) + C3*
cos(omega*
t))) / C4 ;
762 return w - (
w %
injCorr(
w.getSize(),
w.getDt(),omega0,taur) );
769 const double tau0 = 1./omega0;
770 const double Delta = taur*taur - 4*tau0*tau0;
772 const double sqrtDelta = sqrt(Delta) ;
773 const double taup = 0.5*( taur + sqrtDelta ) ;
774 const double taum = 0.5*( taur - sqrtDelta ) ;
775 for (
unsigned i=0 ;
i<
N ;
i++ ) {
777 w.setSample(
i, (
exp(-
t/taup) -
exp(-
t/taum) ) / (taup - taum));
780 }
else if ( Delta < 0 ) {
781 const double T = sqrt(-Delta) ;
782 const double A = 2 * taur / ( (taur*taur) - Delta ) ;
783 const double B = 2 *
T / ( (taur*taur) - Delta );
784 for (
unsigned i=0 ;
i<
N ;
i++ ) {
790 const double tau = 0.5 * taur ;
792 for (
unsigned i=0 ;
i<
N ;
i++ ) {
794 w.setSample(
i,
exp(-
t/tau) *
t / (tau*tau)) ;
881 const double r = (3.-sqrt(5.0))/2;
883 assert( tol > 0 &&
b >
a );
885 v =
a +
r*(
b-
a); fv = (this->*
f)(v,gCali,wf,waverange);
893 double middle_range = (
a+
b)/2;
895 m_SQRT_EPSILON*fabs(
x) + tol/3;
898 if( fabs(
x-middle_range) +
range/2 <= 2*tol_act )
902 new_step =
r * (
x<middle_range ?
b-
x :
a-
x );
906 if( fabs(
x-
w) >= tol_act )
923 if( fabs(
p) < fabs(new_step*
q) &&
924 p >
q*(
a-
x+2*tol_act) &&
925 p <
q*(
b-
x-2*tol_act) )
933 if( fabs(new_step) < tol_act ) {
934 if( new_step > (
double)0 )
942 double t =
x + new_step;
943 double ft = (this->*
f)(t,gCali,wf,waverange);
966 else if(
ft<=fv ||
v==
x ||
v==
w )
993 const unsigned range = 2 ;
996 double maxSample = -9.E+10 ;
1007 if ( thisSample > maxSample ) maxSample = thisSample ;
1010 double loc_tremble = 0 ;
1012 double delta = thisSample - larCaliWave.
getSample(
k) ;
1013 loc_tremble += delta*delta;
1014 if ( delta < 0 )
max = false ;
1016 if (
max ) nMax ++ ;
1017 tremble += loc_tremble / (2*
range) ;
1020 if ( sqrt(tremble/
length)/maxSample > 0.1 ) {
def retrieve(aClass, aKey=None)
double getSumRegion(const LArWave &theWave, unsigned iFirst, unsigned iLast) const
size_t getSize() const
number of time samples
unsigned getStart(const LArWave &theWave) const
void setTcal(double tcal)
void setFstep(double fstep)
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::vector< double > & getWave() const
Wave parameters.
double getBaseline(const LArWave &theWave, unsigned nBase) const
const LArEM_ID * getEM_ID(void) const
std::vector< ALFA_RawDataCollection_p1 > t1
const double & getDt() const
delta time
LArWave translate(const LArWave &theWave, int nShift, double baseline=0.) const
value_type get_compact() const
Get the compact id.
int getDAC() const
DAC value.
int sampling(const Identifier id) const
return sampling according to :
#define ATH_MSG_VERBOSE(x)
unsigned int getMax(const LArWave &theWave) const
return index of maximum sample
Helper class for LArEM offline identifiers for supercells.
int eta(const Identifier id) const
return eta according to :
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
void setTshaper(double tsh)
const double & getSample(const unsigned int i) const
Amplitude per time bin.
double getSumTail(const LArWave &theWave, unsigned iFirst) const
This class initializes the Calo (LAr and Tile) offline identifiers.
void setFlag(unsigned flag)
::StatusCode StatusCode
StatusCode definition for legacy code.
void setTaur(double taur)
double getSumSquareRegion(const LArWave &theWave, unsigned iFirst, unsigned iLast) const
double chi2(TH1 *h0, TH1 *h1)
Helper for the Liquid Argon Calorimeter cell identifiers.
double getSumSquareTail(const LArWave &theWave, unsigned iFirst) const
unsigned getZeroCross(const LArWave &theWave) const
dictionary defaults
This includes now the top quark, the leptons and the bosons.
bool is_em_endcap_inner(const Identifier id) const
test if the id belongs to the EM Endcap inner wheel
std::vector< ALFA_RawDataContainer_p1 > t2
unsigned int getMin(const LArWave &theWave) const
return index of minimum sample
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
void setOmega0(double omega0)
#define ATH_MSG_WARNING(x)
double getError(unsigned i) const
error per time bin
const LArEM_SuperCell_ID * getEM_SuperCell_ID(void) const
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
std::vector< double > expfit(const LArWave &theWave, unsigned iFirst, unsigned iLast, double &rho) const
int getTrigger(unsigned i) const
trigger per time bin