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

#include <HGTD_TdcCalibrationTool.h>

Inheritance diagram for HGTD_TdcCalibrationTool:
Collaboration diagram for HGTD_TdcCalibrationTool:

Public Member Functions

 HGTD_TdcCalibrationTool (const std::string &type, const std::string &name, const IInterface *parent)
float activeWindowUpperBound (const InDetDD::SolidStateDetectorElementBase *element) const
 AlgTool initialize.
uint8_t Time2TOA (const InDetDD::SolidStateDetectorElementBase *element, float hit_time) const
 Simulate the TDC digitization.
float TOA2Time (const InDetDD::SolidStateDetectorElementBase *element, uint8_t toa) const
 Retrieve time of flight from 7-bit TOA code applying the TDC calibration parameters.
bool checkTOAoverflow (uint8_t toa) const
 Check for the overflow flag within TOA code, which indicates an out of range measurement.
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

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

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

FloatProperty m_active_window
FloatProperty m_lhc_rise_edge
FloatProperty m_ps_large_step
FloatProperty m_ps_small_step
FloatProperty m_toa_bin_size
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

Detailed Description

Definition at line 48 of file HGTD_TdcCalibrationTool.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

◆ HGTD_TdcCalibrationTool()

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

Definition at line 15 of file HGTD_TdcCalibrationTool.cxx.

18 : AthAlgTool(type, name, parent)
19{}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ activeWindowUpperBound()

float HGTD_TdcCalibrationTool::activeWindowUpperBound ( const InDetDD::SolidStateDetectorElementBase * element) const

AlgTool initialize.

Retrieves the TDC measurment window upper bound based on the sensor placement.

Parameters
[in]elementDetector element (module) of the activated sensor.
Returns
Upper bound (in ns) of the TDC measurment window.

Definition at line 25 of file HGTD_TdcCalibrationTool.cxx.

25 {
26
27 //NB this "expected time" will change once we need to follow the beamspot!!
28 float hit_time_expected = element->center().norm() / Gaudi::Units::c_light;
29
30 //Should never happen, but testing anyway
31 if(hit_time_expected > m_lhc_rise_edge + m_active_window/2){
32 ATH_MSG_DEBUG("expected hit above calibration range");
33 return m_lhc_rise_edge.value() + m_active_window;
34 }
35 else if(hit_time_expected < m_lhc_rise_edge - 1.5*m_active_window){
36 ATH_MSG_DEBUG("expected hit below calibration range");
37 return m_lhc_rise_edge.value() - m_active_window;
38 }
39
40 float window_walk = (hit_time_expected + m_active_window/2) - m_lhc_rise_edge;
41
42 int window_steps;
43 float window_upper_bound;
44
45 if(window_walk > m_ps_large_step){
46 window_steps = (window_walk - m_ps_large_step)/m_ps_small_step;
47 window_upper_bound = m_lhc_rise_edge.value() + m_ps_large_step + window_steps*m_ps_small_step;
48 }
49 else if(window_walk < - m_ps_large_step){
50 window_steps = (window_walk + m_ps_large_step)/m_ps_small_step;
51 window_upper_bound = m_lhc_rise_edge.value() - m_ps_large_step + window_steps*m_ps_small_step;
52 }
53 else{
54 window_steps = window_walk/m_ps_small_step;
55 window_upper_bound = m_lhc_rise_edge.value() + window_steps*m_ps_small_step;
56 }
57
58 return window_upper_bound;
59}
#define ATH_MSG_DEBUG(x)
virtual const Amg::Vector3D & center() const override final
Center in global coordinates.

◆ checkTOAoverflow()

bool HGTD_TdcCalibrationTool::checkTOAoverflow ( uint8_t toa) const
inline

Check for the overflow flag within TOA code, which indicates an out of range measurement.

Parameters
[in]toa8-bit TOA code as produced by ALTIROC
Returns
True if overflow bit is set, false otherwise.

Definition at line 94 of file HGTD_TdcCalibrationTool.h.

94 {
95 return toa & HGTD::TOA_OVERLFLOW_MASK;
96 }
constexpr unsigned int TOA_OVERLFLOW_MASK

◆ 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 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ 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>

◆ 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

◆ 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.

◆ 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.

◆ Time2TOA()

uint8_t HGTD_TdcCalibrationTool::Time2TOA ( const InDetDD::SolidStateDetectorElementBase * element,
float hit_time ) const

Simulate the TDC digitization.

Parameters
[in]elementDetector element (module) of the activated sensor.
[in]hit_timeTime as measured by the LGAD sensor
Returns
8-bit TOA ALTIROC code which is stored in the ALTIROC RDO.

Definition at line 62 of file HGTD_TdcCalibrationTool.cxx.

62 {
63
64 float window_upper_bound = activeWindowUpperBound(element);
65
66 //TOA time will be the distance between hit_time and upper bound of active window
67 float tdc_time = window_upper_bound - hit_time;
68
69 // Check if hit is within the measurement window, if not return overflow flag
70 if( tdc_time < 0 || tdc_time > 2.5){
71 ATH_MSG_DEBUG("charge at " << hit_time
72 << " outside of TOA TDC range ["
73 << window_upper_bound - 2.5 << ", "
74 << window_upper_bound << "]" );
76 }
77
78 //TOOD: Include TOA TDC bin size smearing here, for now only using nominal value
79 uint8_t toa = tdc_time/m_toa_bin_size;
80
81 ATH_MSG_DEBUG("hit time: "<< hit_time <<
82 " hit time digitized: " << TOA2Time(element, toa) <<
83 " TOA: " << static_cast<unsigned int>(toa));
84
85 return toa;
86
87}
float TOA2Time(const InDetDD::SolidStateDetectorElementBase *element, uint8_t toa) const
Retrieve time of flight from 7-bit TOA code applying the TDC calibration parameters.
float activeWindowUpperBound(const InDetDD::SolidStateDetectorElementBase *element) const
AlgTool initialize.

◆ TOA2Time()

float HGTD_TdcCalibrationTool::TOA2Time ( const InDetDD::SolidStateDetectorElementBase * element,
uint8_t toa ) const

Retrieve time of flight from 7-bit TOA code applying the TDC calibration parameters.

Parameters
[in]elementDetector element (module) the RDOs were found on.
[in]toa7-bit TOA code as stored in the RDO
Returns
Absolute time to be used on the HGTD_Clusters.

Definition at line 89 of file HGTD_TdcCalibrationTool.cxx.

89 {
90 // Using middle of bin as estimate to recover the digitized time
91 return activeWindowUpperBound(element) - (toa + 0.5)*m_toa_bin_size;
92}

◆ 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

◆ m_active_window

FloatProperty HGTD_TdcCalibrationTool::m_active_window
private
Initial value:
{this, "PS_ActiveRange", 2.5 * Athena::Units::nanosecond,
"ALTIROC PS active range" }

Definition at line 101 of file HGTD_TdcCalibrationTool.h.

101 {this, "PS_ActiveRange", 2.5 * Athena::Units::nanosecond,
102 "ALTIROC PS active range" };

◆ 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_lhc_rise_edge

FloatProperty HGTD_TdcCalibrationTool::m_lhc_rise_edge
private
Initial value:
{this, "LHC_RiseEdge",12.5 * Athena::Units::nanosecond,
"LHC clock rise edge time" }

Definition at line 104 of file HGTD_TdcCalibrationTool.h.

104 {this, "LHC_RiseEdge",12.5 * Athena::Units::nanosecond,
105 "LHC clock rise edge time" };

◆ m_ps_large_step

FloatProperty HGTD_TdcCalibrationTool::m_ps_large_step
private
Initial value:
{this, "PS_LargeStep", 1.562 * Athena::Units::nanosecond,
"ALTIROC PS large step"}

Definition at line 107 of file HGTD_TdcCalibrationTool.h.

107 {this, "PS_LargeStep", 1.562 * Athena::Units::nanosecond,
108 "ALTIROC PS large step"};

◆ m_ps_small_step

FloatProperty HGTD_TdcCalibrationTool::m_ps_small_step
private
Initial value:
{this, "PS_SmallStep", 9.7 * Athena::Units::picosecond,
"ALTIROC PS small step"}

Definition at line 110 of file HGTD_TdcCalibrationTool.h.

110 {this, "PS_SmallStep", 9.7 * Athena::Units::picosecond,
111 "ALTIROC PS small step"};

◆ m_toa_bin_size

FloatProperty HGTD_TdcCalibrationTool::m_toa_bin_size
private
Initial value:
{this, "TOABinSize", 20 * Athena::Units::picosecond,
"Nominal TDC TOA bin size"}

Definition at line 113 of file HGTD_TdcCalibrationTool.h.

113 {this, "TOABinSize", 20 * Athena::Units::picosecond,
114 "Nominal TDC TOA bin size"};

◆ 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: