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

interface to TRT calibration constants More...

#include <TRT_CalDbTool.h>

Inheritance diagram for TRT_CalDbTool:
Collaboration diagram for TRT_CalDbTool:

Public Member Functions

 TRT_CalDbTool (const std::string &type, const std::string &name, const IInterface *parent)
 typedefs, enums etc
virtual ~TRT_CalDbTool ()=default
 destructor
virtual StatusCode initialize () override
 tool initialize
virtual StatusCode finalize () override
 tool finalize
virtual float getT0 (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
 get T0 for an identifier
virtual const TRTCond::RtRelationgetRtRelation (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
 get an rtrelation for an identifier
virtual const TRTCond::RtRelationgetErrors (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
 get errors for an identifier
virtual const TRTCond::RtRelationgetSlopes (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
 get errors for an identifier
virtual double driftRadius (const double &time, float &t0, const Identifier &ident, bool &found) const override
 get a drift radius for a given leading edge time
virtual double driftError (const double &time, const Identifier &ident, bool &found) const override
 get a drift radius error for a given drifttime
virtual double driftSlope (const double &time, const Identifier &ident, bool &found) const override
 get a drift radius error for a given drifttime
virtual TRTCond::ExpandedIdentifier trtcondid (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
 create an TRTCond::ExpandedIdentifier from a TRTID identifier
virtual const RtRelationContainer * getRtContainer () const override
 access to calibration constant containers
virtual const RtRelationContainer * getErrContainer () const override
virtual const RtRelationContainer * getSlopeContainer () const override
virtual const StrawT0Container * getT0Container () const override

Private Attributes

const TRT_IDm_trtId
 id helper
SG::ReadCondHandleKey< RtRelationContainer > m_rtReadKey {this,"RtFolderName","/TRT/Calib/RT","r-t relation in-key"}
 ReadHandle keys.
SG::ReadCondHandleKey< RtRelationContainer > m_errReadKey {this,"ErrorFolderName","/TRT/Calib/errors2d","error on r in-key"}
SG::ReadCondHandleKey< RtRelationContainer > m_slopeReadKey {this,"ErrorSlopeFolderName","/TRT/Calib/slopes","slope of error in-key"}
SG::ReadCondHandleKey< StrawT0Container > m_t0ReadKey {this,"T0FolderName","/TRT/Calib/T0","t0 in-key"}

Detailed Description

interface to TRT calibration constants

Definition at line 33 of file TRT_CalDbTool.h.

Constructor & Destructor Documentation

◆ TRT_CalDbTool()

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

typedefs, enums etc

constructor

Definition at line 22 of file TRT_CalDbTool.cxx.

23 : base_class(type, name, parent),
24 m_trtId(nullptr)
25{}
const TRT_ID * m_trtId
id helper

◆ ~TRT_CalDbTool()

virtual TRT_CalDbTool::~TRT_CalDbTool ( )
virtualdefault

destructor

Member Function Documentation

◆ driftError()

double TRT_CalDbTool::driftError ( const double & time,
const Identifier & ident,
bool & found ) const
overridevirtual

get a drift radius error for a given drifttime

Definition at line 119 of file TRT_CalDbTool.cxx.

120{
121 // Returns an error on drift radius and a success indicator,
122 // given an identifier and a drift-time in ns
123 found=true;
124 const TRTCond::RtRelation* rtr = getErrors(ident) ;
125 double error=0.;
126 if(rtr) {
127 error = rtr->radius( time );
128 } else {
129 found=false;
130 return 0;
131 }
132 ATH_MSG_VERBOSE(" time " << time << " error on radius " << error);
133 return error;
134}
#define ATH_MSG_VERBOSE(x)
virtual float radius(float driftime) const =0
radius for given drifttime
virtual const TRTCond::RtRelation * getErrors(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get errors for an identifier

◆ driftRadius()

double TRT_CalDbTool::driftRadius ( const double & time,
float & t0,
const Identifier & ident,
bool & found ) const
overridevirtual

get a drift radius for a given leading edge time

Definition at line 87 of file TRT_CalDbTool.cxx.

88{
89 // Returns a drift radius, a t0 and a success indicator,
90 // given an identifier and a time given by (leading_edge_bin+0.5)*3.125ns
91 found=true;
92 t0 = this->getT0(ident);
93 const TRTCond::RtRelation* rtr = getRtRelation(ident) ;
94 double radius = 0;
95 if (rtr != nullptr)
96 radius = rtr->radius( time - t0 );
97 else
98 ATH_MSG_FATAL(" cannot find an rt-relation for TRT layer_or_wheel " << m_trtId->layer_or_wheel(ident) << " Please check IOV ranges ");
99
100 ATH_MSG_VERBOSE(" time " << time << " t0 " << t0 << " t " << time-t0 << " radius " << radius);
101 //
102 if( radius<0 ) radius=0 ;
103 else if( radius>2.) radius=2.;
104
105 // add protection for the turnover:
106 if (time - t0 > 55){
107 ATH_MSG_VERBOSE(" time " << time << " t0 " << t0 << " t " << time-t0 << " > 55, check Rt derivative");
108 // Check Second Derivative.
109 if (rtr != nullptr){
110 if (rtr->drdt( time - t0 ) < 0 ){
111 ATH_MSG_VERBOSE(" time " << time << " t0 " << t0 << " t " << time-t0 << " and rt derivative: " << rtr->drdt( time - t0 ));
112 radius=2.;
113 }
114 }
115 }
116 return radius;
117}
#define ATH_MSG_FATAL(x)
static Double_t t0
virtual float drdt(float driftime) const =0
driftvelocity for given drifttime
virtual const TRTCond::RtRelation * getRtRelation(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get an rtrelation for an identifier
virtual float getT0(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get T0 for an identifier

◆ driftSlope()

double TRT_CalDbTool::driftSlope ( const double & time,
const Identifier & ident,
bool & found ) const
overridevirtual

get a drift radius error for a given drifttime

Definition at line 136 of file TRT_CalDbTool.cxx.

137{
138 // Returns an error on drift radius and a success indicator,
139 // given an identifier and a drift-time in ns
140 found=true;
141 const TRTCond::RtRelation* rtr = getSlopes(ident) ;
142 double slope=0.;
143 if(rtr) {
144 slope = rtr->radius( time );
145 } else {
146 found=false;
147 return 0;
148 }
149 ATH_MSG_VERBOSE(" time " << time << " slope on radius " << slope);
150 return slope;
151}
virtual const TRTCond::RtRelation * getSlopes(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get errors for an identifier

◆ finalize()

StatusCode TRT_CalDbTool::finalize ( )
overridevirtual

tool finalize

Definition at line 54 of file TRT_CalDbTool.cxx.

55{
56 ATH_MSG_DEBUG("TRT_CalDbTool finalize method called");
57 return StatusCode::SUCCESS;
58}
#define ATH_MSG_DEBUG(x)

◆ getErrContainer()

const TRT_CalDbTool::RtRelationContainer * TRT_CalDbTool::getErrContainer ( ) const
overridevirtual

Definition at line 67 of file TRT_CalDbTool.cxx.

67 {
68
69 SG::ReadCondHandle<RtRelationContainer> rtc(m_errReadKey);
70 return *rtc;
71}
SG::ReadCondHandleKey< RtRelationContainer > m_errReadKey

◆ getErrors()

const TRTCond::RtRelation * TRT_CalDbTool::getErrors ( const Identifier & id,
int level = TRTCond::ExpandedIdentifier::STRAW ) const
inlineoverridevirtual

get errors for an identifier

Definition at line 118 of file TRT_CalDbTool.h.

119{
120 const RtRelationContainer* rc = getErrContainer();
121 if(!rc) return 0;
122 return rc->get(trtcondid(id,level)) ;
123}
static Double_t rc
virtual const RtRelationContainer * getErrContainer() const override
virtual TRTCond::ExpandedIdentifier trtcondid(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
create an TRTCond::ExpandedIdentifier from a TRTID identifier

◆ getRtContainer()

const TRT_CalDbTool::RtRelationContainer * TRT_CalDbTool::getRtContainer ( ) const
overridevirtual

access to calibration constant containers

Definition at line 61 of file TRT_CalDbTool.cxx.

61 {
62
63 SG::ReadCondHandle<RtRelationContainer> rtc(m_rtReadKey);
64 return *rtc;
65}
SG::ReadCondHandleKey< RtRelationContainer > m_rtReadKey
ReadHandle keys.

◆ getRtRelation()

const TRTCond::RtRelation * TRT_CalDbTool::getRtRelation ( const Identifier & id,
int level = TRTCond::ExpandedIdentifier::STRAW ) const
inlineoverridevirtual

get an rtrelation for an identifier

Definition at line 110 of file TRT_CalDbTool.h.

111{
112 const RtRelationContainer* rc = getRtContainer();
113 if(!rc) return 0;
114 return rc->get(trtcondid(id,level)) ;
115}
virtual const RtRelationContainer * getRtContainer() const override
access to calibration constant containers

◆ getSlopeContainer()

const TRT_CalDbTool::RtRelationContainer * TRT_CalDbTool::getSlopeContainer ( ) const
overridevirtual

Definition at line 73 of file TRT_CalDbTool.cxx.

73 {
74
75 SG::ReadCondHandle<RtRelationContainer> rtc(m_slopeReadKey); // find the right conditions
76 return *rtc;
77}
SG::ReadCondHandleKey< RtRelationContainer > m_slopeReadKey

◆ getSlopes()

const TRTCond::RtRelation * TRT_CalDbTool::getSlopes ( const Identifier & id,
int level = TRTCond::ExpandedIdentifier::STRAW ) const
inlineoverridevirtual

get errors for an identifier

Definition at line 126 of file TRT_CalDbTool.h.

127{
128 const RtRelationContainer* rc = getSlopeContainer();
129 if(!rc) return 0;
130 return rc->get(trtcondid(id,level)) ;
131}
virtual const RtRelationContainer * getSlopeContainer() const override

◆ getT0()

float TRT_CalDbTool::getT0 ( const Identifier & id,
int level = TRTCond::ExpandedIdentifier::STRAW ) const
inlineoverridevirtual

get T0 for an identifier

Definition at line 134 of file TRT_CalDbTool.h.

135{
136 const StrawT0Container* rc = getT0Container();
137 return rc->getT0(trtcondid(id,level)) ;
138}
virtual const StrawT0Container * getT0Container() const override

◆ getT0Container()

const TRT_CalDbTool::StrawT0Container * TRT_CalDbTool::getT0Container ( ) const
overridevirtual

Definition at line 79 of file TRT_CalDbTool.cxx.

79 {
80
81 SG::ReadCondHandle<StrawT0Container> rtc(m_t0ReadKey); // find the right conditions
82 return *rtc;
83}
SG::ReadCondHandleKey< StrawT0Container > m_t0ReadKey

◆ initialize()

StatusCode TRT_CalDbTool::initialize ( )
overridevirtual

tool initialize

Definition at line 28 of file TRT_CalDbTool.cxx.

29{
30 ATH_MSG_DEBUG( " in initialize " );
31
32
33 // Get the TRT ID helper
34 StatusCode sc = detStore()->retrieve(m_trtId,"TRT_ID");
35 if(sc.isFailure()) {
36 ATH_MSG_FATAL("Problem retrieving TRTID helper");
37 return StatusCode::FAILURE;
38 }
39
40 // Read keys
41
42 ATH_CHECK( m_rtReadKey.initialize() );
43 ATH_CHECK( m_errReadKey.initialize() );
44 ATH_CHECK( m_slopeReadKey.initialize() );
45 ATH_CHECK( m_t0ReadKey.initialize() );
46
47 ATH_MSG_DEBUG(" TRT_CalDbTool::initialized ");
48
49 return StatusCode::SUCCESS;
50}
#define ATH_CHECK
Evaluate an expression and check for errors.
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ trtcondid()

TRTCond::ExpandedIdentifier TRT_CalDbTool::trtcondid ( const Identifier & id,
int level = TRTCond::ExpandedIdentifier::STRAW ) const
inlineoverridevirtual

create an TRTCond::ExpandedIdentifier from a TRTID identifier

Definition at line 102 of file TRT_CalDbTool.h.

103{
104 return TRTCond::ExpandedIdentifier( m_trtId->barrel_ec(id),m_trtId->layer_or_wheel(id),
105 m_trtId->phi_module(id),m_trtId->straw_layer(id),
106 m_trtId->straw(id),level ) ;
107}

Member Data Documentation

◆ m_errReadKey

SG::ReadCondHandleKey<RtRelationContainer> TRT_CalDbTool::m_errReadKey {this,"ErrorFolderName","/TRT/Calib/errors2d","error on r in-key"}
private

Definition at line 91 of file TRT_CalDbTool.h.

91{this,"ErrorFolderName","/TRT/Calib/errors2d","error on r in-key"};

◆ m_rtReadKey

SG::ReadCondHandleKey<RtRelationContainer> TRT_CalDbTool::m_rtReadKey {this,"RtFolderName","/TRT/Calib/RT","r-t relation in-key"}
private

ReadHandle keys.

Definition at line 90 of file TRT_CalDbTool.h.

90{this,"RtFolderName","/TRT/Calib/RT","r-t relation in-key"};

◆ m_slopeReadKey

SG::ReadCondHandleKey<RtRelationContainer> TRT_CalDbTool::m_slopeReadKey {this,"ErrorSlopeFolderName","/TRT/Calib/slopes","slope of error in-key"}
private

Definition at line 92 of file TRT_CalDbTool.h.

92{this,"ErrorSlopeFolderName","/TRT/Calib/slopes","slope of error in-key"};

◆ m_t0ReadKey

SG::ReadCondHandleKey<StrawT0Container> TRT_CalDbTool::m_t0ReadKey {this,"T0FolderName","/TRT/Calib/T0","t0 in-key"}
private

Definition at line 93 of file TRT_CalDbTool.h.

93{this,"T0FolderName","/TRT/Calib/T0","t0 in-key"};

◆ m_trtId

const TRT_ID* TRT_CalDbTool::m_trtId
private

id helper

Definition at line 87 of file TRT_CalDbTool.h.


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