ATLAS Offline Software
Loading...
Searching...
No Matches
LArDeltaRespTool Class Reference

#include <LArDeltaRespTool.h>

Inheritance diagram for LArDeltaRespTool:
Collaboration diagram for LArDeltaRespTool:

Public Member Functions

 LArDeltaRespTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~LArDeltaRespTool ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
LArCaliWave makeLArDeltaResp (const LArWFParams &, const LArCaliWave &)
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void compute_deltaresp ()
LArWave deltaResp (const LArWave &) const
LArWave deltaCorr () const
double deltaCorr (double t) const
LArWave injResp (const LArWave &w) const
LArWave injCorr () const
double injCorr (double t) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

LArCaliWave m_gCali
LArCaliWave m_gDelta
bool m_injPointCorr
bool m_normalizeCali
bool m_timeOriginShift
bool m_subtractBaseline
double m_Tdrift
double m_Fstep
double m_Tcal
double m_Omega0
double m_Taur
unsigned m_Tstart
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static const int DEFAULT =-1

Detailed Description

Definition at line 19 of file LArDeltaRespTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArDeltaRespTool()

LArDeltaRespTool::LArDeltaRespTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 11 of file LArDeltaRespTool.cxx.

12 : AthAlgTool(type,name,parent),
13 m_Tdrift(0),
14 m_Fstep(0),
15 m_Tcal(0),
16 m_Omega0(0),
17 m_Taur(0),
18 m_Tstart(0)
19{
20 declareProperty("InjPointCorr",m_injPointCorr=true) ;
21 declareProperty("NormalizeCali",m_normalizeCali=true) ;
22 declareProperty("TimeOriginShift",m_timeOriginShift=false) ;
23 declareProperty("SubtractBaseline",m_subtractBaseline=true) ;
24}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ ~LArDeltaRespTool()

LArDeltaRespTool::~LArDeltaRespTool ( )
virtualdefault

Member Function Documentation

◆ compute_deltaresp()

void LArDeltaRespTool::compute_deltaresp ( )
private

Definition at line 47 of file LArDeltaRespTool.cxx.

48{
49 LArWaveHelper wHelper;
50
51 // calib. signal at Mother Board :
52 LArWave gCaliMB(m_gCali), gDelta;
53
54 // shift gCaliMB to start point and remove baseline
55 m_Tstart = wHelper.getStart(gCaliMB) ;
56 double baseline = wHelper.getBaseline(gCaliMB,m_Tstart) ;
57 if ( m_subtractBaseline ) gCaliMB = gCaliMB + (-baseline) ;
58 if ( m_timeOriginShift ) gCaliMB = wHelper.translate(gCaliMB,-m_Tstart,baseline) ;
59
60 // normalization of calibration pulse
61 if ( m_normalizeCali ) {
62 ATH_MSG_VERBOSE ( "*** Normalisation \t|-> YES" );
63 double peak = gCaliMB.getSample( wHelper.getMax(gCaliMB) ) ;
64 ATH_MSG_VERBOSE ( "peak = " << peak );
65 if ( peak <=0 ) {
66 ATH_MSG_WARNING ( "Peak value <=0 , cannot normalize!" );
67 } else {
68 gCaliMB = gCaliMB * (1./peak) ;
69 }
70 } else {
71 ATH_MSG_VERBOSE ( "*** Normalisation \t|-> NO" );
72 }
73
74 // delta responde waveform prediction
75 ATH_MSG_VERBOSE ( "*** Delta response \t|-> m_Fstep = " << m_Fstep << " ns " );
76 ATH_MSG_VERBOSE ( "*** Delta response \t|-> m_Tcal = " << m_Tcal << " ns " );
77 ATH_MSG_VERBOSE ( "*** Delta response \t|-> m_Omega0 = " << m_Omega0 << " GHz" );
78 ATH_MSG_VERBOSE ( "*** Delta response \t|-> m_Taur = " << m_Taur << " ns " );
79
80 if ( ! m_injPointCorr ) {
81 // perform only exp->triangle correction
82 ATH_MSG_VERBOSE ( "*** Inj.Point Corr. \t|-> NO" );
83 gDelta = deltaResp ( gCaliMB ) ;
84 } else {
85 // perform exp->triangle and then injection point correction
86 ATH_MSG_VERBOSE ( "*** Inj.Point Corr. \t|-> YES" );
87 //gDelta = deltaResp ( gCaliMB ) ;
88 //gDelta = LArPhysWaveTool::injResp( gDelta ); // HOW TO MAKE THIS WORKING???
89 gDelta = injResp( deltaResp ( gCaliMB ) ) ;
90 }
91
92 //int deltaRespDAC = m_gCali.getDAC() ;
93 int deltaRespDAC = -3 ;
94
95 m_gDelta = LArCaliWave( gDelta.getWave() ,
96 m_gCali.getDt() ,
97 deltaRespDAC ,
98 m_gCali.getIsPulsedInt(),
99 m_gCali.getFlag() );
100
101}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
@ baseline
LArWave injResp(const LArWave &w) const
LArWave deltaResp(const LArWave &) const
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
const std::vector< double > & getWave() const
Wave parameters.
Definition LArWave.h:167

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ deltaCorr() [1/2]

LArWave LArDeltaRespTool::deltaCorr ( ) const
private

Definition at line 112 of file LArDeltaRespTool.cxx.

113{
114 unsigned N = m_gCali.getSize() ;
115 double dt = m_gCali.getDt() ;
116 LArWave w(N,dt) ;
117 for ( unsigned i=0 ; i<N ; i++ ) w.setSample(i,deltaCorr(i*dt)) ;
118 return w ;
119}
LArWave deltaCorr() const

◆ deltaCorr() [2/2]

double LArDeltaRespTool::deltaCorr ( double t) const
private

Definition at line 121 of file LArDeltaRespTool.cxx.

122{
123 double fstep = m_Fstep ;
124 double Tc = m_Tcal ;
125 return ((fstep*fstep-fstep)/(Tc*Tc)) * exp( -fstep*t/Tc );
126}
static Double_t Tc(Double_t t)

◆ deltaResp()

LArWave LArDeltaRespTool::deltaResp ( const LArWave & w) const
private

Definition at line 104 of file LArDeltaRespTool.cxx.

105{
106 double fstep = m_Fstep;
107 double Tc = m_Tcal;
108 LArWaveHelper wHelper;
109 return ( w % deltaCorr() ) + w*((1.-fstep)/Tc) + wHelper.derive_smooth(w);
110}
LArWave derive_smooth(const LArWave &theWave) const
smoothed derivative

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

virtual StatusCode LArDeltaRespTool::finalize ( )
inlinevirtual

Definition at line 33 of file LArDeltaRespTool.h.

33{return StatusCode::SUCCESS;}

◆ initialize()

virtual StatusCode LArDeltaRespTool::initialize ( )
inlinevirtual

Definition at line 32 of file LArDeltaRespTool.h.

32{return StatusCode::SUCCESS;}

◆ injCorr() [1/2]

LArWave LArDeltaRespTool::injCorr ( ) const
private

Definition at line 132 of file LArDeltaRespTool.cxx.

132 {
133 unsigned N = m_gCali.getSize() ;
134 double dt = m_gCali.getDt() ;
135 LArWave w(N,dt) ;
136 for ( unsigned i=0 ; i<N ; i++ ) w.setSample(i,injCorr(i*dt)) ;
137 return w ;
138}
LArWave injCorr() const

◆ injCorr() [2/2]

double LArDeltaRespTool::injCorr ( double t) const
private

Definition at line 140 of file LArDeltaRespTool.cxx.

140 {
141 double tau0 = 1./m_Omega0;
142 double taur = m_Taur;
143 double Delta = pow(taur,2.) - pow(2*tau0,2.) ;
144 if ( Delta > 0 ) {
145 double sqrtDelta = sqrt(Delta) ;
146 double taup = 0.5*( taur + sqrtDelta ) ;
147 double taum = 0.5*( taur - sqrtDelta ) ;
148 return ( exp(-t/taup) - exp(-t/taum) ) / ( taup - taum ) ;
149 } else if ( Delta < 0 ) {
150 double T = sqrt(-Delta) ;
151 double A = 2 * taur / ( pow(taur,2.) - Delta ) ;
152 double B = 2 * T / ( pow(taur,2.) - Delta ) ;
153 return 2 * exp(-A*t) * sin(B*t) / T ;
154 } else {
155 double tau = 0.5 * taur ;
156 return exp(-t/tau) * t / pow(tau,2.) ;
157 }
158#if 0
159 double taur2 = taur*taur, tau02 = tau0*tau0 ;
160 double taua = sqrt( 4.*tau02 - taur2 );
161 return (2./taua)*exp(-t*taur/(2.*tau02))*sin(t*taua/(2.*tau02));
162#endif
163}
static Double_t taup
static Double_t tau0
constexpr int pow(int base, int exp) noexcept
unsigned long long T

◆ injResp()

LArWave LArDeltaRespTool::injResp ( const LArWave & w) const
private

Definition at line 128 of file LArDeltaRespTool.cxx.

128 {
129 return w % injCorr() ;
130}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & LArDeltaRespTool::interfaceID ( )
inlinestatic

Definition at line 24 of file LArDeltaRespTool.h.

24{ return IID_LArDeltaRespTool; }
static const InterfaceID IID_LArDeltaRespTool("LArDeltaRespTool", 1, 0)

◆ makeLArDeltaResp()

LArCaliWave LArDeltaRespTool::makeLArDeltaResp ( const LArWFParams & larWFParam,
const LArCaliWave & larCaliWave )

Definition at line 29 of file LArDeltaRespTool.cxx.

31{
32
33 m_gCali = larCaliWave;
34
35 m_Tdrift = larWFParam.tdrift();
36 m_Tcal = larWFParam.tcal();
37 m_Fstep = larWFParam.fstep();
38 m_Taur = larWFParam.taur();
39 m_Omega0 = larWFParam.omega0();
40
42
43 return m_gDelta;
44}
double omega0() const
double tdrift() const
double fstep() const
double tcal() const
double taur() const

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ DEFAULT

const int LArDeltaRespTool::DEFAULT =-1
staticprivate

Definition at line 39 of file LArDeltaRespTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_Fstep

double LArDeltaRespTool::m_Fstep
private

Definition at line 45 of file LArDeltaRespTool.h.

◆ m_gCali

LArCaliWave LArDeltaRespTool::m_gCali
private

Definition at line 41 of file LArDeltaRespTool.h.

◆ m_gDelta

LArCaliWave LArDeltaRespTool::m_gDelta
private

Definition at line 41 of file LArDeltaRespTool.h.

◆ m_injPointCorr

bool LArDeltaRespTool::m_injPointCorr
private

Definition at line 43 of file LArDeltaRespTool.h.

◆ m_normalizeCali

bool LArDeltaRespTool::m_normalizeCali
private

Definition at line 43 of file LArDeltaRespTool.h.

◆ m_Omega0

double LArDeltaRespTool::m_Omega0
private

Definition at line 45 of file LArDeltaRespTool.h.

◆ m_subtractBaseline

bool LArDeltaRespTool::m_subtractBaseline
private

Definition at line 43 of file LArDeltaRespTool.h.

◆ m_Taur

double LArDeltaRespTool::m_Taur
private

Definition at line 45 of file LArDeltaRespTool.h.

◆ m_Tcal

double LArDeltaRespTool::m_Tcal
private

Definition at line 45 of file LArDeltaRespTool.h.

◆ m_Tdrift

double LArDeltaRespTool::m_Tdrift
private

Definition at line 45 of file LArDeltaRespTool.h.

◆ m_timeOriginShift

bool LArDeltaRespTool::m_timeOriginShift
private

Definition at line 43 of file LArDeltaRespTool.h.

◆ m_Tstart

unsigned LArDeltaRespTool::m_Tstart
private

Definition at line 46 of file LArDeltaRespTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: