ATLAS Offline Software
Loading...
Searching...
No Matches
EventInfoPixelModuleStatusMonitoring.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
36namespace DerivationFramework {
37
38 class EventInfoPixelModuleStatusMonitoring : public extends<AthAlgTool, IAugmentationTool> {
39 public:
40
41 using base_class::base_class;
42
43 virtual StatusCode initialize() override final;
44 virtual StatusCode addBranches(const EventContext& ctx) const override final;
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};
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
111namespace 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
Store pixel HV data in PixelDCSHVData.
Store pixel DCS module state in PixelDCSStateData.
Store pixel DCS module status in PixelDCSStatusData.
Store pixel temperature data in PixelDCSTempData.
This is an Identifier helper class for the Pixel subdetector.
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::ReadHandle< InDet::SiDetectorElementStatus > getPixelDetElStatus(const SG::ReadHandleKey< InDet::SiDetectorElementStatus > &key, const EventContext &ctx) const
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_moduleBSErrKeys
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_moduleFEmaskKeys
virtual StatusCode addBranches(const EventContext &ctx) const override final
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusActiveOnly
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_moduleConditionKeys
T retrieve(size_t i) const
Retrieve the value of the hash, if accessible according to the mask.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
THE reconstruction tool.
Primary Vertex Finder.
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...
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...
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.
MsgStream & msg
Definition testRead.cxx:32