ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_CalDbTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRT_CALDBTOOL_H
6#define TRT_CALDBTOOL_H
11
13// STL
14#include <mutex>
15//Gaudi includes
16#include "GaudiKernel/IInterface.h"
17#include "GaudiKernel/ToolHandle.h"
18#include "GaudiKernel/EventContext.h"
19#include "GaudiKernel/ContextSpecificPtr.h"
20#include "GaudiKernel/ICondSvc.h"
21// Storegate
23//Athena
25// TRT
27
28
29
33class TRT_CalDbTool: public extends<AthAlgTool, ITRT_CalDbTool>
34{
35 public:
37
38
40 TRT_CalDbTool( const std::string& type, const std::string& name, const IInterface* parent);
41
43 virtual ~TRT_CalDbTool() = default;
44
46 virtual StatusCode initialize() override;
47
49 virtual StatusCode finalize() override;
50
51
52 // methods to access calibration data
53
55 virtual float getT0( const Identifier& id, int level = TRTCond::ExpandedIdentifier::STRAW ) const override;
56
58 virtual const TRTCond::RtRelation* getRtRelation( const Identifier& id, int level = TRTCond::ExpandedIdentifier::STRAW ) const override;
59
61 virtual const TRTCond::RtRelation* getErrors( const Identifier& id, int level = TRTCond::ExpandedIdentifier::STRAW ) const override;
62
64 virtual const TRTCond::RtRelation* getSlopes( const Identifier& id, int level = TRTCond::ExpandedIdentifier::STRAW ) const override;
65
67 virtual double driftRadius(const double& time, float& t0, const Identifier& ident, bool& found) const override;
68
70 virtual double driftError(const double& time, const Identifier& ident, bool& found) const override;
71
73 virtual double driftSlope(const double& time, const Identifier& ident, bool& found) const override;
74
76 virtual TRTCond::ExpandedIdentifier trtcondid( const Identifier& id, int level = TRTCond::ExpandedIdentifier::STRAW) const override;
77
78
79
81 virtual const RtRelationContainer* getRtContainer() const override;
82 virtual const RtRelationContainer* getErrContainer() const override;
83 virtual const RtRelationContainer* getSlopeContainer() const override;
84 virtual const StrawT0Container* getT0Container() const override;
85
86 private:
87 const TRT_ID* m_trtId;
88
90 SG::ReadCondHandleKey<RtRelationContainer> m_rtReadKey{this,"RtFolderName","/TRT/Calib/RT","r-t relation in-key"};
91 SG::ReadCondHandleKey<RtRelationContainer> m_errReadKey{this,"ErrorFolderName","/TRT/Calib/errors2d","error on r in-key"};
92 SG::ReadCondHandleKey<RtRelationContainer> m_slopeReadKey{this,"ErrorSlopeFolderName","/TRT/Calib/slopes","slope of error in-key"};
93 SG::ReadCondHandleKey<StrawT0Container> m_t0ReadKey{this,"T0FolderName","/TRT/Calib/T0","t0 in-key"};
94
95};
96
98// inline methods
100
102TRT_CalDbTool::trtcondid( const Identifier& id, int level) const
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}
108
109inline const TRTCond::RtRelation*
110TRT_CalDbTool::getRtRelation( const Identifier& id, int level ) const
111{
112 const RtRelationContainer* rc = getRtContainer();
113 if(!rc) return 0;
114 return rc->get(trtcondid(id,level)) ;
115}
116
117inline const TRTCond::RtRelation*
118TRT_CalDbTool::getErrors( const Identifier& id, int level ) const
119{
120 const RtRelationContainer* rc = getErrContainer();
121 if(!rc) return 0;
122 return rc->get(trtcondid(id,level)) ;
123}
124
125inline const TRTCond::RtRelation*
126TRT_CalDbTool::getSlopes( const Identifier& id, int level ) const
127{
128 const RtRelationContainer* rc = getSlopeContainer();
129 if(!rc) return 0;
130 return rc->get(trtcondid(id,level)) ;
131}
132
133inline float
134TRT_CalDbTool::getT0( const Identifier& id, int level ) const
135{
136 const StrawT0Container* rc = getT0Container();
137 return rc->getT0(trtcondid(id,level)) ;
138}
139
140
141
142#endif // TRT_CALDBTOOL_H
abstract interface to TRT calibration constants
static Double_t rc
static Double_t t0
This is an Identifier helper class for the TRT subdetector.
Base class for rt-relations in the TRT.
Definition RtRelation.h:27
virtual const TRTCond::RtRelation * getErrors(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get errors for an identifier
virtual const StrawT0Container * getT0Container() const override
SG::ReadCondHandleKey< RtRelationContainer > m_slopeReadKey
virtual const RtRelationContainer * getSlopeContainer() const override
virtual const TRTCond::RtRelation * getRtRelation(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get an rtrelation for an identifier
virtual StatusCode initialize() override
tool initialize
virtual ~TRT_CalDbTool()=default
destructor
virtual double driftError(const double &time, const Identifier &ident, bool &found) const override
get a drift radius error for a given drifttime
SG::ReadCondHandleKey< RtRelationContainer > m_errReadKey
virtual double driftSlope(const double &time, const Identifier &ident, bool &found) const override
get a drift radius error for a given drifttime
virtual const RtRelationContainer * getErrContainer() const override
const TRT_ID * m_trtId
id helper
SG::ReadCondHandleKey< RtRelationContainer > m_rtReadKey
ReadHandle keys.
virtual const RtRelationContainer * getRtContainer() const override
access to calibration constant containers
virtual TRTCond::ExpandedIdentifier trtcondid(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
create an TRTCond::ExpandedIdentifier from a TRTID identifier
virtual float getT0(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get T0 for an identifier
SG::ReadCondHandleKey< StrawT0Container > m_t0ReadKey
virtual StatusCode finalize() override
tool finalize
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
TRT_CalDbTool(const std::string &type, const std::string &name, const IInterface *parent)
typedefs, enums etc
virtual const TRTCond::RtRelation * getSlopes(const Identifier &id, int level=TRTCond::ExpandedIdentifier::STRAW) const override
get errors for an identifier
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82