ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TRT_CalDbTool Class Reference

#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 More...
 
virtual ~TRT_CalDbTool ()=default
 destructor More...
 
virtual StatusCode initialize () override
 tool initialize More...
 
virtual StatusCode finalize () override
 tool finalize More...
 
virtual float getT0 (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
 get T0 for an identifier More...
 
virtual const TRTCond::RtRelationgetRtRelation (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
 get an rtrelation for an identifier More...
 
virtual const TRTCond::RtRelationgetErrors (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
 get errors for an identifier More...
 
virtual const TRTCond::RtRelationgetSlopes (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
 get errors for an identifier More...
 
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 More...
 
virtual double driftError (const double &time, const Identifier &ident, bool &found) const override
 get a drift radius error for a given drifttime More...
 
virtual double driftSlope (const double &time, const Identifier &ident, bool &found) const override
 get a drift radius error for a given drifttime More...
 
virtual TRTCond::ExpandedIdentifier trtcondid (const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
 create an TRTCond::ExpandedIdentifier from a TRTID identifier More...
 
virtual const RtRelationContainer * getRtContainer () const override
 access to calibration constant containers More...
 
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 More...
 
SG::ReadCondHandleKey< RtRelationContainer > m_rtReadKey {this,"RtFolderName","/TRT/Calib/RT","r-t relation in-key"}
 ReadHandle keys. More...
 
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 {}

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

◆ 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);
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 }

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

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

◆ getErrContainer()

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

Definition at line 67 of file TRT_CalDbTool.cxx.

67  {
68 
70  return *rtc;
71 }

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

◆ 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 
64  return *rtc;
65 }

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

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

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

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

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

◆ 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 
46 
47  ATH_MSG_DEBUG(" TRT_CalDbTool::initialized ");
48 
49  return StatusCode::SUCCESS;
50 }

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

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

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

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

◆ 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:
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
TRT_CalDbTool::getSlopes
virtual const TRTCond::RtRelation * getSlopes(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get errors for an identifier
Definition: TRT_CalDbTool.h:126
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TRT_CalDbTool::getErrors
virtual const TRTCond::RtRelation * getErrors(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get errors for an identifier
Definition: TRT_CalDbTool.h:118
TRT_CalDbTool::getSlopeContainer
virtual const RtRelationContainer * getSlopeContainer() const override
Definition: TRT_CalDbTool.cxx:73
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TRT_CalDbTool::trtcondid
virtual TRTCond::ExpandedIdentifier trtcondid(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
create an TRTCond::ExpandedIdentifier from a TRTID identifier
Definition: TRT_CalDbTool.h:102
TRT_CalDbTool::m_trtId
const TRT_ID * m_trtId
id helper
Definition: TRT_CalDbTool.h:87
TRTCond::RtRelation
Definition: RtRelation.h:27
TRT_CalDbTool::getRtContainer
virtual const RtRelationContainer * getRtContainer() const override
access to calibration constant containers
Definition: TRT_CalDbTool.cxx:61
TRT_ID::straw
int straw(const Identifier &id) const
Definition: TRT_ID.h:902
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:866
TRT_ID::straw_layer
int straw_layer(const Identifier &id) const
Definition: TRT_ID.h:893
TRT_ID::layer_or_wheel
int layer_or_wheel(const Identifier &id) const
Definition: TRT_ID.h:884
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
TRT_CalDbTool::m_t0ReadKey
SG::ReadCondHandleKey< StrawT0Container > m_t0ReadKey
Definition: TRT_CalDbTool.h:93
TRT_CalDbTool::getT0Container
virtual const StrawT0Container * getT0Container() const override
Definition: TRT_CalDbTool.cxx:79
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TRT::Hit::ident
@ ident
Definition: HitInfo.h:77
TRT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: TRT_ID.h:875
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
TRT_CalDbTool::m_rtReadKey
SG::ReadCondHandleKey< RtRelationContainer > m_rtReadKey
ReadHandle keys.
Definition: TRT_CalDbTool.h:90
TRT_CalDbTool::getRtRelation
virtual const TRTCond::RtRelation * getRtRelation(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get an rtrelation for an identifier
Definition: TRT_CalDbTool.h:110
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TRTCond::RtRelation::radius
virtual float radius(float driftime) const =0
radius for given drifttime
TRTCond::RtRelation::drdt
virtual float drdt(float driftime) const =0
driftvelocity for given drifttime
TRT_CalDbTool::getErrContainer
virtual const RtRelationContainer * getErrContainer() const override
Definition: TRT_CalDbTool.cxx:67
TRT_CalDbTool::getT0
virtual float getT0(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get T0 for an identifier
Definition: TRT_CalDbTool.h:134
get_generator_info.error
error
Definition: get_generator_info.py:40
TRTCond::ExpandedIdentifier
Identifier for TRT detector elements in the conditions code.
Definition: InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h:30
error
Definition: IImpactPoint3dEstimator.h:70
TRT_CalDbTool::m_errReadKey
SG::ReadCondHandleKey< RtRelationContainer > m_errReadKey
Definition: TRT_CalDbTool.h:91
TRT_CalDbTool::m_slopeReadKey
SG::ReadCondHandleKey< RtRelationContainer > m_slopeReadKey
Definition: TRT_CalDbTool.h:92
python.trfValidateRootFile.rc
rc
Definition: trfValidateRootFile.py:350