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

#include <TRT_StrawStatusSummaryTool.h>

Inheritance diagram for TRT_StrawStatusSummaryTool:
Collaboration diagram for TRT_StrawStatusSummaryTool:

Public Types

typedef TRTCond::StrawStatusMultChanContainer StrawStatusContainer
 

Public Member Functions

 TRT_StrawStatusSummaryTool (const std::string &type, const std::string &name, const IInterface *parent)
 constructor More...
 
virtual ~TRT_StrawStatusSummaryTool ()=default
 destructor More...
 
virtual StatusCode initialize () override
 tool initialize More...
 
virtual StatusCode finalize () override
 tool finalize More...
 
virtual const StrawStatusContainergetStrawStatusHTContainer () const override
 
virtual int getStatus (Identifier offlineId, const EventContext &) const override
 
virtual int getStatusPermanent (Identifier offlineId, const EventContext &) const override
 
virtual int getStatusHT (Identifier offlineId, const EventContext &) const override
 
virtual bool get_status (Identifier offlineId, const EventContext &) const override
 
virtual bool get_statusHT (Identifier offlineId, const EventContext &) const override
 

Private Attributes

const TRT_IDm_trtId =nullptr
 
ServiceHandle< ICondSvc > m_condSvc
 
SG::ReadCondHandleKey< StrawStatusContainerm_statReadKey {this,"StatReadKeyName","/TRT/Cond/Status","StrawStatus in-key"}
 
SG::ReadCondHandleKey< StrawStatusContainerm_permReadKey {this,"PermReadKeyName","/TRT/Cond/StatusPermanent","StrawStatusPermanent in-key"}
 
SG::ReadCondHandleKey< StrawStatusContainerm_statHTReadKey {this,"StatHTReadKeyName","/TRT/Cond/StatusHT","StrawStatusHT in-key"}
 
Gaudi::Property< bool > m_isGEANT4 {this,"isGEANT4",true}
 
Gaudi::Property< std::string > m_par_strawstatusHTcontainerkey {this, "SimStatusHTKey","/TRT/Cond/StatusHT"}
 

Detailed Description

Definition at line 29 of file TRT_StrawStatusSummaryTool.h.

Member Typedef Documentation

◆ StrawStatusContainer

Definition at line 33 of file TRT_StrawStatusSummaryTool.h.

Constructor & Destructor Documentation

◆ TRT_StrawStatusSummaryTool()

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

constructor

Definition at line 15 of file TRT_StrawStatusSummaryTool.cxx.

16  : base_class(type, name, parent),
17  m_condSvc("CondSvc",name) {}

◆ ~TRT_StrawStatusSummaryTool()

virtual TRT_StrawStatusSummaryTool::~TRT_StrawStatusSummaryTool ( )
virtualdefault

destructor

Member Function Documentation

◆ finalize()

StatusCode TRT_StrawStatusSummaryTool::finalize ( )
overridevirtual

tool finalize

Definition at line 44 of file TRT_StrawStatusSummaryTool.cxx.

45 {
46  return StatusCode::SUCCESS;
47 }

◆ get_status()

bool TRT_StrawStatusSummaryTool::get_status ( Identifier  offlineId,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 121 of file TRT_StrawStatusSummaryTool.cxx.

121  {
122  constexpr unsigned int statusbitmask = 1 << 8;// 0000001 00000000
123  const int status=getStatus(offlineID,ctx);
124  const int statusperm=getStatusPermanent(offlineID,ctx);
125  ATH_MSG_VERBOSE("offlineID "<<offlineID<<" "<<status <<" "<< statusperm);
126 
127  bool st = false, stperm=false;
128 
129  if (status==1) st = true;
130  else if (status==0) st = false;
131  else {st = bool( (status & statusbitmask) >> 8);};
132 
133  if (statusperm==1) stperm = true;
134  else if (statusperm==0) stperm = false;
135  else {stperm = bool( (statusperm & statusbitmask) >> 8);};
136 
137  return (st||stperm);
138 
139 }

◆ get_statusHT()

bool TRT_StrawStatusSummaryTool::get_statusHT ( Identifier  offlineId,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 143 of file TRT_StrawStatusSummaryTool.cxx.

143  {
144  constexpr unsigned int statusbitmask = 1 << 8;// 0000001 00000000
145  bool stHT=false;
146  const int statusHT=getStatusHT(offlineID,ctx);
147 
148  if (statusHT==1) stHT = true;
149  else if (statusHT==0) stHT = false;
150  else {stHT = bool( (statusHT & statusbitmask) >> 8);};
151 
152  return ( stHT );
153 
154 }

◆ getStatus()

int TRT_StrawStatusSummaryTool::getStatus ( Identifier  offlineId,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 50 of file TRT_StrawStatusSummaryTool.cxx.

50  {
53  m_trtId->phi_module(offlineID),m_trtId->straw_layer(offlineID),
54  m_trtId->straw(offlineID),level );
55 
57  const StrawStatusContainer* strawstatuscontainer(*rst);
58 
59  return int((*strawstatuscontainer).get(id).getstatus());
60 }

◆ getStatusHT()

int TRT_StrawStatusSummaryTool::getStatusHT ( Identifier  offlineId,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 78 of file TRT_StrawStatusSummaryTool.cxx.

78  {
79 
82  m_trtId->phi_module(offlineID),m_trtId->straw_layer(offlineID),
83  m_trtId->straw(offlineID),level );
84 
85  const StrawStatusContainer* strawstatusHTcontainer = nullptr;
86  if(m_isGEANT4) {
87  if ( StatusCode::SUCCESS!=detStore()->retrieve( strawstatusHTcontainer, m_par_strawstatusHTcontainerkey ) ) {
88  ATH_MSG_FATAL( "Could not retrieve folder " << m_par_strawstatusHTcontainerkey );
89  return 0;
90  }
91  }
92  else {
94  strawstatusHTcontainer=(*rht);
95  }
96 
97  return int((*strawstatusHTcontainer).get(id).getstatus());
98 }

◆ getStatusPermanent()

int TRT_StrawStatusSummaryTool::getStatusPermanent ( Identifier  offlineId,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 64 of file TRT_StrawStatusSummaryTool.cxx.

64  {
67  m_trtId->phi_module(offlineID),m_trtId->straw_layer(offlineID),
68  m_trtId->straw(offlineID),level );
69 
71  const StrawStatusContainer* strawstatuspermanentcontainer=(*rp);
72 
73  return int((*strawstatuspermanentcontainer).get(id).getstatus());
74 }

◆ getStrawStatusHTContainer()

const TRTCond::StrawStatusMultChanContainer * TRT_StrawStatusSummaryTool::getStrawStatusHTContainer ( ) const
overridevirtual

Definition at line 100 of file TRT_StrawStatusSummaryTool.cxx.

100  {
101 
102  const StrawStatusContainer* strawstatusHTcontainer = nullptr;
103  if(m_isGEANT4) {
104  // processing GEANT4 simulation - revert to old non-MT style cond access
105  if ( StatusCode::SUCCESS!=detStore()->retrieve( strawstatusHTcontainer, m_par_strawstatusHTcontainerkey ) ) {
106  ATH_MSG_WARNING( "Could not retrieve folder " << m_par_strawstatusHTcontainerkey );
107  }
108  }
109  else {
110  SG::ReadCondHandle<StrawStatusContainer> rht(m_statHTReadKey,Gaudi::Hive::currentContext());
111  strawstatusHTcontainer=(*rht);
112  }
113 
114  return strawstatusHTcontainer;
115 }

◆ initialize()

StatusCode TRT_StrawStatusSummaryTool::initialize ( )
overridevirtual

tool initialize

Definition at line 20 of file TRT_StrawStatusSummaryTool.cxx.

21 {
22  ATH_MSG_DEBUG("TRT_StrawStatusSummaryTool initialize method called");
23 
24  // Get the TRT ID helper
25  if (StatusCode::SUCCESS!=detStore()->retrieve(m_trtId,"TRT_ID")) {
26  ATH_MSG_FATAL("Problem retrieving TRTID helper");
27  return StatusCode::FAILURE;
28  }
29 
30  // Read keys in case of normal reconstruction/digitization
31  ATH_CHECK( m_statReadKey.initialize() );
32  ATH_CHECK( m_permReadKey.initialize() );
33 
34  // Only require this input if not using G4 sim
35  ATH_CHECK( m_statHTReadKey.initialize( !m_isGEANT4 ) );
36 
37  ATH_MSG_DEBUG("TRT_StrawStatusSummaryTool initialized successfully ");
38  return StatusCode::SUCCESS;
39 }

Member Data Documentation

◆ m_condSvc

ServiceHandle<ICondSvc> TRT_StrawStatusSummaryTool::m_condSvc
private

Definition at line 60 of file TRT_StrawStatusSummaryTool.h.

◆ m_isGEANT4

Gaudi::Property<bool> TRT_StrawStatusSummaryTool::m_isGEANT4 {this,"isGEANT4",true}
private

Definition at line 67 of file TRT_StrawStatusSummaryTool.h.

◆ m_par_strawstatusHTcontainerkey

Gaudi::Property<std::string> TRT_StrawStatusSummaryTool::m_par_strawstatusHTcontainerkey {this, "SimStatusHTKey","/TRT/Cond/StatusHT"}
private

Definition at line 68 of file TRT_StrawStatusSummaryTool.h.

◆ m_permReadKey

SG::ReadCondHandleKey<StrawStatusContainer> TRT_StrawStatusSummaryTool::m_permReadKey {this,"PermReadKeyName","/TRT/Cond/StatusPermanent","StrawStatusPermanent in-key"}
private

Definition at line 63 of file TRT_StrawStatusSummaryTool.h.

◆ m_statHTReadKey

SG::ReadCondHandleKey<StrawStatusContainer> TRT_StrawStatusSummaryTool::m_statHTReadKey {this,"StatHTReadKeyName","/TRT/Cond/StatusHT","StrawStatusHT in-key"}
private

Definition at line 64 of file TRT_StrawStatusSummaryTool.h.

◆ m_statReadKey

SG::ReadCondHandleKey<StrawStatusContainer> TRT_StrawStatusSummaryTool::m_statReadKey {this,"StatReadKeyName","/TRT/Cond/Status","StrawStatus in-key"}
private

Definition at line 62 of file TRT_StrawStatusSummaryTool.h.

◆ m_trtId

const TRT_ID* TRT_StrawStatusSummaryTool::m_trtId =nullptr
private

Definition at line 58 of file TRT_StrawStatusSummaryTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TRT_StrawStatusSummaryTool::getStatus
virtual int getStatus(Identifier offlineId, const EventContext &) const override
Definition: TRT_StrawStatusSummaryTool.cxx:50
TRT_StrawStatusSummaryTool::m_condSvc
ServiceHandle< ICondSvc > m_condSvc
Definition: TRT_StrawStatusSummaryTool.h:60
TRT_ID::straw
int straw(const Identifier &id) const
Definition: TRT_ID.h:902
TRT_StrawStatusSummaryTool::getStatusPermanent
virtual int getStatusPermanent(Identifier offlineId, const EventContext &) const override
Definition: TRT_StrawStatusSummaryTool.cxx:64
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT_StrawStatusSummaryTool::m_permReadKey
SG::ReadCondHandleKey< StrawStatusContainer > m_permReadKey
Definition: TRT_StrawStatusSummaryTool.h:63
TRT_StrawStatusSummaryTool::m_statHTReadKey
SG::ReadCondHandleKey< StrawStatusContainer > m_statHTReadKey
Definition: TRT_StrawStatusSummaryTool.h:64
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
TRT_StrawStatusSummaryTool::m_statReadKey
SG::ReadCondHandleKey< StrawStatusContainer > m_statReadKey
Definition: TRT_StrawStatusSummaryTool.h:62
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TRT_StrawStatusSummaryTool::m_isGEANT4
Gaudi::Property< bool > m_isGEANT4
Definition: TRT_StrawStatusSummaryTool.h:67
TRTCond::ExpandedIdentifier::STRAW
@ STRAW
Definition: InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h:37
TRT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: TRT_ID.h:875
TRT_StrawStatusSummaryTool::m_par_strawstatusHTcontainerkey
Gaudi::Property< std::string > m_par_strawstatusHTcontainerkey
Definition: TRT_StrawStatusSummaryTool.h:68
TRT_StrawStatusSummaryTool::StrawStatusContainer
TRTCond::StrawStatusMultChanContainer StrawStatusContainer
Definition: TRT_StrawStatusSummaryTool.h:33
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TRT_StrawStatusSummaryTool::getStatusHT
virtual int getStatusHT(Identifier offlineId, const EventContext &) const override
Definition: TRT_StrawStatusSummaryTool.cxx:78
merge.status
status
Definition: merge.py:17
TRT_StrawStatusSummaryTool::m_trtId
const TRT_ID * m_trtId
Definition: TRT_StrawStatusSummaryTool.h:58
rp
ReadCards * rp
Definition: IReadCards.cxx:26
TRTCond::ExpandedIdentifier
Identifier for TRT detector elements in the conditions code.
Definition: InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h:30
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60