ATLAS Offline Software
EventInfoPixelModuleStatusMonitoring.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DERIVATIONFRAMEWORK_EVENTINFOPIXELMODULESTATUSMONITORING_H
6 #define DERIVATIONFRAMEWORK_EVENTINFOPIXELMODULESTATUSMONITORING_H
7 
8 #include <string>
9 #include <vector>
10 
13 #include "GaudiKernel/ToolHandle.h"
14 #include "AthLinks/ElementLink.h"
15 
19 
20 #include "Identifier/Identifier.h"
23 
30 
35 
36 namespace DerivationFramework {
37 
39  public:
40  EventInfoPixelModuleStatusMonitoring(const std::string& type, const std::string& name, const IInterface* parent);
41 
44  virtual StatusCode addBranches() const;
45 
46  private:
47 
48  Gaudi::Property<std::string> m_prefix
49  { this,"DecorationPrefix", "", "" };
50 
52  { this, "ContainerName", "EventInfo", ""};
53 
55  {this, "ReadKeyeTemp", "PixelDCSTempCondData", "Key of input sensor temperature conditions folder"};
56 
58  {this, "ReadKeyHV", "PixelDCSHVCondData", "Key of input bias voltage conditions folder"};
59 
61  {this, "PixelDCSStateCondData", "PixelDCSStateCondData", "Pixel FSM state key"};
62 
64  {this, "PixelDCSStatusCondData", "PixelDCSStatusCondData", "Pixel FSM status key"};
65 
67  {this, "PixelDeadMapCondData", "PixelDeadMapCondData", "Pixel deadmap conditions key"};
68 
69  ToolHandle<IInDetConditionsTool> m_pixelSummary
70  {this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool for PixelConditionsSummaryTool"};
71 
73  {this, "PixelByteStreamErrs", "PixelByteStreamErrs", "PixelByteStreamErrs container key"};
74 
75  Gaudi::Property<bool> m_useByteStreamFEI4
76  {this, "UseByteStreamFEI4", true, "Switch of the ByteStream error for FEI4"};
77  Gaudi::Property<bool> m_useByteStreamFEI3
78  {this, "UseByteStreamFEI3", true, "Switch of the ByteStream error for FEI3"};
79  Gaudi::Property<bool> m_useByteStreamRD53
80  {this, "UseByteStreamRD53", false, "Switch of the ByteStream error for RD53"};
81 
83  mutable std::atomic_uint m_lbCounter{0};
84  unsigned int m_readoutTechnologyMask{};
85 
86  std::vector<SG::WriteDecorHandleKey<xAOD::EventInfo> > m_moduleConditionKeys;
87  std::vector<SG::WriteDecorHandleKey<xAOD::EventInfo> > m_moduleFEmaskKeys;
88  std::vector<SG::WriteDecorHandleKey<xAOD::EventInfo> > m_moduleBSErrKeys;
89 
90  protected:
91 
93  {this, "PixelDetElStatusActiveOnly", "", "Key of SiDetectorElementStatus for Pixel which reflects only whether modules or chips are active rather than delivering good data"};
94 
97  if (!key.empty()) {
98  pixelDetElStatus = SG::ReadHandle<InDet::SiDetectorElementStatus>(key, ctx);
99  if (!pixelDetElStatus.isValid()) {
100  std::stringstream msg;
101  msg << "Failed to get " << key.key() << " from StoreGate in " << name();
102  throw std::runtime_error(msg.str());
103  }
104  }
105  return pixelDetElStatus;
106  };
107 
108  };
109 }
110 
111 namespace InDet {
119  inline unsigned int getBSErrorWord(const InDet::SiDetectorElementStatus &elementStatus,
120  const IDCInDetBSErrContainer &bsErrorContainer,
121  const IdentifierHash &moduleIdHash,
122  unsigned int index,
123  unsigned int readOutTechnologyMask = ( Pixel::makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology::FEI4)
125  {
126  if ( Pixel::matchingReadoutTechnology(elementStatus, moduleIdHash, readOutTechnologyMask )) {
127  constexpr uint64_t missingErrorInfo{std::numeric_limits<uint64_t>::max()-3000000000};
128  uint64_t word = static_cast<uint64_t>(bsErrorContainer.retrieve(index));
129  return word < missingErrorInfo ? word : 0;
130  }
131  else {
132  return 0;
133  }
134  }
135 }
136 
137 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_pixelSummary
ToolHandle< IInDetConditionsTool > m_pixelSummary
Definition: EventInfoPixelModuleStatusMonitoring.h:70
PixelFEUtils.h
DerivationFramework::EventInfoPixelModuleStatusMonitoring
Definition: EventInfoPixelModuleStatusMonitoring.h:38
Pixel::matchingReadoutTechnology
bool matchingReadoutTechnology(const InDet::SiDetectorElementStatus &elementStatus, const IdentifierHash &moduleIdHash, unsigned int readOutTechnologyMask=(Pixel::makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology::FEI4)|(Pixel::makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology::FEI3))))
Check whether the readout technology of the specified module is contained in the given readout techno...
Definition: PixelFEUtils.h:70
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_condDCSStateKey
SG::ReadCondHandleKey< PixelDCSStateData > m_condDCSStateKey
Definition: EventInfoPixelModuleStatusMonitoring.h:61
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_useByteStreamFEI4
Gaudi::Property< bool > m_useByteStreamFEI4
Definition: EventInfoPixelModuleStatusMonitoring.h:76
IInDetConditionsTool.h
PixelDeadMapCondData.h
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_pixelDetElStatusActiveOnly
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusActiveOnly
Definition: EventInfoPixelModuleStatusMonitoring.h:93
SiDetectorElementStatus.h
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_condDCSStatusKey
SG::ReadCondHandleKey< PixelDCSStatusData > m_condDCSStatusKey
Definition: EventInfoPixelModuleStatusMonitoring.h:64
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
IAugmentationTool.h
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
IDCInDetBSErrContainer
IDC like storage for BS errors, TODO, customise implementation further so that we store int rather th...
Definition: IDCInDetBSErrContainer.h:19
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_pixelID
const PixelID * m_pixelID
Definition: EventInfoPixelModuleStatusMonitoring.h:82
Pixel::makeReadoutTechnologyBit
unsigned int makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology technology, unsigned int bit_val=1)
Create a word with a bit representing the given readout technology to the given value.
Definition: PixelFEUtils.h:60
PixelDCSStateData.h
Store pixel DCS module state in PixelDCSStateData.
InDetDD::PixelReadoutTechnology::FEI3
@ FEI3
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_useByteStreamFEI3
Gaudi::Property< bool > m_useByteStreamFEI3
Definition: EventInfoPixelModuleStatusMonitoring.h:78
DerivationFramework::EventInfoPixelModuleStatusMonitoring::EventInfoPixelModuleStatusMonitoring
EventInfoPixelModuleStatusMonitoring(const std::string &type, const std::string &name, const IInterface *parent)
Definition: EventInfoPixelModuleStatusMonitoring.cxx:13
DerivationFramework::EventInfoPixelModuleStatusMonitoring::initialize
StatusCode initialize()
Definition: EventInfoPixelModuleStatusMonitoring.cxx:19
SG::ReadHandleKey< xAOD::EventInfo >
DerivationFramework::EventInfoPixelModuleStatusMonitoring::getPixelDetElStatus
SG::ReadHandle< InDet::SiDetectorElementStatus > getPixelDetElStatus(const SG::ReadHandleKey< InDet::SiDetectorElementStatus > &key, const EventContext &ctx) const
Definition: EventInfoPixelModuleStatusMonitoring.h:95
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_condDeadMapKey
SG::ReadCondHandleKey< PixelDeadMapCondData > m_condDeadMapKey
Definition: EventInfoPixelModuleStatusMonitoring.h:67
InDet::getBSErrorWord
unsigned int getBSErrorWord(const InDet::SiDetectorElementStatus &elementStatus, const IDCInDetBSErrContainer &bsErrorContainer, const IdentifierHash &moduleIdHash, unsigned int index, unsigned int readOutTechnologyMask=(Pixel::makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology::FEI4)|(Pixel::makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology::FEI3))))
Retrieve the bytestream error word for the given module if the readout technology of the module is co...
Definition: PixelBSUtils.h:16
DerivationFramework::IAugmentationTool
Definition: IAugmentationTool.h:24
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_moduleConditionKeys
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_moduleConditionKeys
Definition: EventInfoPixelModuleStatusMonitoring.h:86
DerivationFramework::EventInfoPixelModuleStatusMonitoring::finalize
StatusCode finalize()
Definition: EventInfoPixelModuleStatusMonitoring.cxx:67
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_moduleBSErrKeys
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_moduleBSErrKeys
Definition: EventInfoPixelModuleStatusMonitoring.h:88
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_prefix
Gaudi::Property< std::string > m_prefix
Definition: EventInfoPixelModuleStatusMonitoring.h:49
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
PixelDCSTempData.h
Store pixel temperature data in PixelDCSTempData.
IPixelReadoutManager.h
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
PixelDCSStatusData.h
Store pixel DCS module status in PixelDCSStatusData.
EventAuxInfo.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
IdentifierHash.h
DerivationFramework::EventInfoPixelModuleStatusMonitoring::addBranches
virtual StatusCode addBranches() const
Pass the thinning service
Definition: EventInfoPixelModuleStatusMonitoring.cxx:71
InDetDD::PixelReadoutTechnology::FEI4
@ FEI4
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_readoutTechnologyMask
unsigned int m_readoutTechnologyMask
Definition: EventInfoPixelModuleStatusMonitoring.h:84
IdentifiableValueContainer::retrieve
T retrieve(size_t i) const
Retrieve the value of the hash, if accessible according to the mask.
Definition: IdentifiableValueContainer.h:104
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_moduleFEmaskKeys
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_moduleFEmaskKeys
Definition: EventInfoPixelModuleStatusMonitoring.h:87
EventInfo.h
SG::ReadCondHandleKey< PixelDCSTempData >
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_lbCounter
std::atomic_uint m_lbCounter
Definition: EventInfoPixelModuleStatusMonitoring.h:83
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_useByteStreamRD53
Gaudi::Property< bool > m_useByteStreamRD53
Definition: EventInfoPixelModuleStatusMonitoring.h:80
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_readKeyHV
SG::ReadCondHandleKey< PixelDCSHVData > m_readKeyHV
Definition: EventInfoPixelModuleStatusMonitoring.h:58
IDCInDetBSErrContainer.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: EventInfoPixelModuleStatusMonitoring.h:52
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_readKeyTemp
SG::ReadCondHandleKey< PixelDCSTempData > m_readKeyTemp
Definition: EventInfoPixelModuleStatusMonitoring.h:55
AthAlgTool
Definition: AthAlgTool.h:26
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
PixelID
Definition: PixelID.h:67
PixelDCSHVData.h
Store pixel HV data in PixelDCSHVData.
DerivationFramework::EventInfoPixelModuleStatusMonitoring::m_idcErrContKey
SG::ReadHandleKey< IDCInDetBSErrContainer > m_idcErrContKey
Definition: EventInfoPixelModuleStatusMonitoring.h:73
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37