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

#include <EventInfoBSErrDecorator.h>

Inheritance diagram for DerivationFramework::EventInfoBSErrDecorator:
Collaboration diagram for DerivationFramework::EventInfoBSErrDecorator:

Public Member Functions

 EventInfoBSErrDecorator (const std::string &type, const std::string &name, const IInterface *parent)
 
StatusCode initialize ()
 
StatusCode finalize ()
 
virtual StatusCode addBranches () const
 

Private Types

enum  EIntDecor {
  kSCT_BSErr_Ntot, kSCT_BSErr_bec, kSCT_BSErr_layer, kSCT_BSErr_eta,
  kSCT_BSErr_phi, kSCT_BSErr_side, kSCT_BSErr_rodid, kSCT_BSErr_channel,
  kSCT_BSErr_type, kNIntDecor
}
 

Private Attributes

Gaudi::Property< std::string > m_prefix { this,"DecorationPrefix", "", "" }
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey { this, "ContainerName", "EventInfo", ""}
 
const SCT_IDm_sctId = nullptr
 
ToolHandle< ISCT_ByteStreamErrorsToolm_byteStreamErrTool {this, "ByteStreamErrTool", "SCT_ByteStreamErrorsTool", "Tool to retrieve SCT ByteStream Errors"}
 
ToolHandle< ISCT_CablingToolm_cabling {this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"}
 
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_intDecorKeys
 

Detailed Description

Definition at line 33 of file EventInfoBSErrDecorator.h.

Member Enumeration Documentation

◆ EIntDecor

Enumerator
kSCT_BSErr_Ntot 
kSCT_BSErr_bec 
kSCT_BSErr_layer 
kSCT_BSErr_eta 
kSCT_BSErr_phi 
kSCT_BSErr_side 
kSCT_BSErr_rodid 
kSCT_BSErr_channel 
kSCT_BSErr_type 
kNIntDecor 

Definition at line 53 of file EventInfoBSErrDecorator.h.

Constructor & Destructor Documentation

◆ EventInfoBSErrDecorator()

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

Definition at line 22 of file EventInfoBSErrDecorator.cxx.

24  :
25  base_class(type,name,parent)
26  {
27  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::EventInfoBSErrDecorator::addBranches ( ) const
virtual

Definition at line 70 of file EventInfoBSErrDecorator.cxx.

71  {
72  ATH_MSG_DEBUG("Adding ByteStream errors to EventInfo");
73 
74  const EventContext& ctx = Gaudi::Hive::currentContext();
76  CHECK( eventInfo.isValid() ? StatusCode::SUCCESS : StatusCode::FAILURE );
77 
78  std::array<std::vector<int>,kNIntDecor> scterr;
79  int totalNumErrors=0;
80 
81  // fill BS error information
82  for (int n_type=0; n_type < SCT_ByteStreamErrors::NUM_ERROR_TYPES; ++n_type) {
83  const std::set<IdentifierHash> errorSet = m_byteStreamErrTool->getErrorSet(n_type);
84  int eta=0,phi=0,bec=0,layer=0,side=0;
85  // add totalNumErrors to vector
86  totalNumErrors += errorSet.size();
87  scterr[kSCT_BSErr_Ntot].push_back(totalNumErrors);
88 
89  // loop in errorSet
90  for(const auto& error : errorSet) {
91  ATH_MSG_DEBUG("debugging information");
94  ATH_MSG_DEBUG(n_type);
95  layer = m_sctId->layer_disk(itId);
96  side = m_sctId->side(itId);
97  eta = m_sctId->eta_module(itId);
98  phi = m_sctId->phi_module(itId);
99  bec = m_sctId->barrel_ec(itId);
100 
101  // add variables to vector
102  scterr[kSCT_BSErr_bec].push_back(bec);
103  scterr[kSCT_BSErr_layer].push_back(layer);
104  scterr[kSCT_BSErr_eta].push_back(eta);
105  scterr[kSCT_BSErr_phi].push_back(phi);
106  scterr[kSCT_BSErr_side].push_back(side);
107  scterr[kSCT_BSErr_type].push_back(n_type);
108 
109  uint32_t onlineID = m_cabling->getOnlineIdFromHash(error);
110  SCT_OnlineId online(onlineID);
111  uint32_t rod = online.rod();
112  uint32_t fibre = online.fibre();
113  scterr[kSCT_BSErr_rodid].push_back((int)rod);
114  scterr[kSCT_BSErr_channel].push_back((int)fibre);
115  }
116  }
117  std::vector<SG::WriteDecorHandle<xAOD::EventInfo,std::vector<int> > > int_decor_handles(createDecorators<xAOD::EventInfo,std::vector<int> >(m_intDecorKeys,ctx));
118 
119  assert(int_decor_handles.size() == kNIntDecor);
120  // decorate SCT BS error
121  for(unsigned int decorate_i=0; decorate_i<int_decor_handles.size(); ++decorate_i) {
122  int_decor_handles[decorate_i](*eventInfo) = std::move(scterr[decorate_i]);
123  }
124  return StatusCode::SUCCESS;
125  }

◆ finalize()

StatusCode DerivationFramework::EventInfoBSErrDecorator::finalize ( )

Definition at line 65 of file EventInfoBSErrDecorator.cxx.

66  {
67  return StatusCode::SUCCESS;
68  }

◆ initialize()

StatusCode DerivationFramework::EventInfoBSErrDecorator::initialize ( )

Definition at line 29 of file EventInfoBSErrDecorator.cxx.

30  {
31 
32  if (m_prefix.empty()) {
33  ATH_MSG_WARNING("No decoration prefix name provided for the output of EventInfoBSErrDecorator!");
34  }
35 
37 
38  // need Atlas id-helpers to identify sub-detectors, take them from detStore
39  if( detStore()->retrieve(m_sctId,"SCT_ID").isFailure() ){
40  ATH_MSG_ERROR("Could not retrieve SCT helper");
41  return StatusCode::FAILURE;
42  }
43 
44  CHECK ( m_byteStreamErrTool.retrieve() );
45  CHECK ( m_cabling.retrieve() );
46 
47  {
48  std::vector<std::string> names;
49  names.resize(kNIntDecor);
50  names[kSCT_BSErr_Ntot] ="SCT_BSErr_Ntot";
51  names[kSCT_BSErr_bec] ="SCT_BSErr_bec";
52  names[kSCT_BSErr_layer] ="SCT_BSErr_layer";
53  names[kSCT_BSErr_eta] ="SCT_BSErr_eta";
54  names[kSCT_BSErr_phi] ="SCT_BSErr_phi";
55  names[kSCT_BSErr_side] ="SCT_BSErr_side";
56  names[kSCT_BSErr_rodid] ="SCT_BSErr_rodid";
57  names[kSCT_BSErr_channel] ="SCT_BSErr_channel";
58  names[kSCT_BSErr_type] ="SCT_BSErr_type";
60  }
61 
62  return StatusCode::SUCCESS;
63  }

Member Data Documentation

◆ m_byteStreamErrTool

ToolHandle<ISCT_ByteStreamErrorsTool> DerivationFramework::EventInfoBSErrDecorator::m_byteStreamErrTool {this, "ByteStreamErrTool", "SCT_ByteStreamErrorsTool", "Tool to retrieve SCT ByteStream Errors"}
private

Definition at line 50 of file EventInfoBSErrDecorator.h.

◆ m_cabling

ToolHandle<ISCT_CablingTool> DerivationFramework::EventInfoBSErrDecorator::m_cabling {this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"}
private

Definition at line 51 of file EventInfoBSErrDecorator.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> DerivationFramework::EventInfoBSErrDecorator::m_eventInfoKey { this, "ContainerName", "EventInfo", ""}
private

Definition at line 45 of file EventInfoBSErrDecorator.h.

◆ m_intDecorKeys

std::vector<SG::WriteDecorHandleKey<xAOD::EventInfo> > DerivationFramework::EventInfoBSErrDecorator::m_intDecorKeys
private

Definition at line 64 of file EventInfoBSErrDecorator.h.

◆ m_prefix

Gaudi::Property<std::string> DerivationFramework::EventInfoBSErrDecorator::m_prefix { this,"DecorationPrefix", "", "" }
private

Definition at line 43 of file EventInfoBSErrDecorator.h.

◆ m_sctId

const SCT_ID* DerivationFramework::EventInfoBSErrDecorator::m_sctId = nullptr
private

Definition at line 48 of file EventInfoBSErrDecorator.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
DerivationFramework::EventInfoBSErrDecorator::kNIntDecor
@ kNIntDecor
Definition: EventInfoBSErrDecorator.h:62
DerivationFramework::EventInfoBSErrDecorator::kSCT_BSErr_side
@ kSCT_BSErr_side
Definition: EventInfoBSErrDecorator.h:58
DerivationFramework::createDecoratorKeys
void createDecoratorKeys(T_Parent &parent, const SG::ReadHandleKey< T_Cont > &container_key, const std::string &prefix, const std::vector< std::string > &decor_names, std::vector< SG::WriteDecorHandleKey< T_Cont > > &decor_out)
Definition: DecoratorUtils.h:20
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
DerivationFramework::EventInfoBSErrDecorator::m_byteStreamErrTool
ToolHandle< ISCT_ByteStreamErrorsTool > m_byteStreamErrTool
Definition: EventInfoBSErrDecorator.h:50
DerivationFramework::EventInfoBSErrDecorator::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: EventInfoBSErrDecorator.h:46
SCT_OnlineId
Definition: SCT_OnlineId.h:22
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
DerivationFramework::EventInfoBSErrDecorator::kSCT_BSErr_Ntot
@ kSCT_BSErr_Ntot
Definition: EventInfoBSErrDecorator.h:53
SCT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: SCT_ID.h:740
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TileSynchronizeBch.online
online
Definition: TileSynchronizeBch.py:88
DerivationFramework::EventInfoBSErrDecorator::kSCT_BSErr_phi
@ kSCT_BSErr_phi
Definition: EventInfoBSErrDecorator.h:57
DerivationFramework::EventInfoBSErrDecorator::m_sctId
const SCT_ID * m_sctId
Definition: EventInfoBSErrDecorator.h:48
DerivationFramework::EventInfoBSErrDecorator::kSCT_BSErr_rodid
@ kSCT_BSErr_rodid
Definition: EventInfoBSErrDecorator.h:59
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
python.subdetectors.mmg.names
names
Definition: mmg.py:8
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DerivationFramework::EventInfoBSErrDecorator::kSCT_BSErr_layer
@ kSCT_BSErr_layer
Definition: EventInfoBSErrDecorator.h:55
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DerivationFramework::EventInfoBSErrDecorator::kSCT_BSErr_bec
@ kSCT_BSErr_bec
Definition: EventInfoBSErrDecorator.h:54
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
DerivationFramework::EventInfoBSErrDecorator::m_cabling
ToolHandle< ISCT_CablingTool > m_cabling
Definition: EventInfoBSErrDecorator.h:51
DerivationFramework::EventInfoBSErrDecorator::m_intDecorKeys
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_intDecorKeys
Definition: EventInfoBSErrDecorator.h:64
columnar::ContainerId::eventInfo
@ eventInfo
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
DerivationFramework::EventInfoBSErrDecorator::kSCT_BSErr_type
@ kSCT_BSErr_type
Definition: EventInfoBSErrDecorator.h:61
DerivationFramework::EventInfoBSErrDecorator::kSCT_BSErr_channel
@ kSCT_BSErr_channel
Definition: EventInfoBSErrDecorator.h:60
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SCT_FlaggedCondEnum::NUM_ERROR_TYPES
@ NUM_ERROR_TYPES
Definition: SCT_FlaggedCondEnum.h:28
SCT_ID::eta_module
int eta_module(const Identifier &id) const
Definition: SCT_ID.h:746
DerivationFramework::createDecorators
std::vector< SG::WriteDecorHandle< T_Cont, T > > createDecorators(const std::vector< SG::WriteDecorHandleKey< T_Cont > > &keys, const EventContext &ctx)
Definition: DecoratorUtils.h:51
SCT_ID::side
int side(const Identifier &id) const
Definition: SCT_ID.h:752
SCT_ID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition: SCT_ID.h:464
DerivationFramework::EventInfoBSErrDecorator::kSCT_BSErr_eta
@ kSCT_BSErr_eta
Definition: EventInfoBSErrDecorator.h:56
error
Definition: IImpactPoint3dEstimator.h:70
DerivationFramework::EventInfoBSErrDecorator::m_prefix
Gaudi::Property< std::string > m_prefix
Definition: EventInfoBSErrDecorator.h:44
Identifier
Definition: IdentifierFieldParser.cxx:14