ATLAS Offline Software
Loading...
Searching...
No Matches
PixelConditionsSummaryTool Class Reference

#include <PixelConditionsSummaryTool.h>

Inheritance diagram for PixelConditionsSummaryTool:

Public Member Functions

 PixelConditionsSummaryTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~PixelConditionsSummaryTool ()
virtual StatusCode initialize () override
virtual bool isActive (const Identifier &elementId, const InDetConditions::Hierarchy h, const EventContext &ctx) const override final
virtual bool isActive (const IdentifierHash &moduleHash, const EventContext &ctx) const override final
virtual bool isActive (const IdentifierHash &moduleHash, const Identifier &elementId, const EventContext &ctx) const override final
virtual double activeFraction (const IdentifierHash &moduleHash, const Identifier &idStart, const Identifier &idEnd, const EventContext &ctx) const override final
virtual bool isGood (const Identifier &elementId, const InDetConditions::Hierarchy h, const EventContext &ctx) const override final
virtual bool isGood (const IdentifierHash &moduleHash, const EventContext &ctx) const override final
virtual bool isGood (const IdentifierHash &moduleHash, const Identifier &elementId, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const override final
virtual double goodFraction (const IdentifierHash &moduleHash, const Identifier &idStart, const Identifier &idEnd, const EventContext &ctx) const override final
virtual std::unique_ptr< InDet::SiDetectorElementStatusgetDetectorElementStatus (const EventContext &ctx, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const override
 get the module and chip status of Si detector elements
virtual bool hasBSError (const IdentifierHash &moduleHash, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const override final
virtual bool hasBSError (const IdentifierHash &moduleHash, Identifier pixid, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const override final
virtual uint64_t getBSErrorWord (const IdentifierHash &moduleHash, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const override final
virtual uint64_t getBSErrorWord (const IdentifierHash &moduleHash, const int index, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const override final
virtual IDCCacheEntrygetCacheEntryOut (const EventContext &ctx) const override final
bool checkChipStatus (IdentifierHash moduleHash, Identifier pixid, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
 DeclareInterfaceID (IInDetConditionsTool, 1, 0)
 Creates the InterfaceID and interfaceID() method.

Static Public Member Functions

static InterfaceID & interfaceID ()
static EventIDBase getUndefinedEventId ()
static EventIDRange getInvalidRange ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

uint64_t getBSErrorWord (const InDetDD::PixelModuleDesign *p_design, const int index, const EventContext &ctx, const IInDetConditionsTool::IDCCacheEntry *cacheEntry) const
bool hasBSError (const InDetDD::PixelModuleDesign *p_design, const IdentifierHash &moduleHash, const EventContext &ctx, const IInDetConditionsTool::IDCCacheEntry *cacheEntry) const
const InDetDD::SiDetectorElementgetDetectorEelement (const IdentifierHash &moduleHash, const EventContext &ctx) const
const IDCInDetBSErrContainergetContainer (const EventContext &ctx) const
 Obtains container form the SG, if it is missing it will complain (hard-coded 3 times per job) and return nullptr.
IDCCacheEntrygetCacheEntry (const EventContext &ctx) const
 Return cache for the current event If, for current slot, the cache is outdated it is retrieved from the IDC collection.
std::unique_ptr< InDet::SiDetectorElementStatuscreateDetectorElementStatus (const EventContext &ctx, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const
 Create a new detector element status element container.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const PixelIDm_pixelID {}
std::vector< std::string > m_isActiveStatus
std::vector< std::string > m_isActiveStates
std::vector< int > m_activeState
std::vector< int > m_activeStatus
unsigned int m_activeStateMask {}
 mask in which each state is represented by a bit and for states which are cnsidered active the corresponding bit is set;
unsigned int m_activeStatusMask {}
 mask in which each status is represented by a bit and for status values which are cnsidered active the corresponding bit is set;
Gaudi::Property< bool > m_useByteStreamFEI4 {this, "UseByteStreamFEI4", false, "Switch of the ByteStream error for FEI4"}
Gaudi::Property< bool > m_useByteStreamFEI3 {this, "UseByteStreamFEI3", false, "Switch of the ByteStream error for FEI3"}
Gaudi::Property< bool > m_useByteStreamRD53 {this, "UseByteStreamRD53", false, "Switch of the ByteStream error for RD53"}
SG::ReadCondHandleKey< PixelDCSStateDatam_condDCSStateKey {this, "PixelDCSStateCondData", "PixelDCSStateCondData", "Pixel FSM state key"}
SG::ReadCondHandleKey< PixelDCSStatusDatam_condDCSStatusKey {this, "PixelDCSStatusCondData", "PixelDCSStatusCondData", "Pixel FSM status key"}
SG::ReadCondHandleKey< PixelTDAQDatam_condTDAQKey {this, "PixelTDAQCondData", "", "Pixel TDAQ conditions key"}
SG::ReadCondHandleKey< PixelDeadMapCondDatam_condDeadMapKey {this, "PixelDeadMapCondData", "PixelDeadMapCondData", "Pixel deadmap conditions key"}
SG::ReadHandleKey< IDCInDetBSErrContainerm_BSErrContReadKey {this, "PixelByteStreamErrs", "PixelByteStreamErrs", "PixelByteStreamErrs container key"}
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_pixelDetEleCollKey {this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}
SG::ReadHandleKey< InDet::SiDetectorElementStatusm_pixelDetElStatusEventKey {this, "PixelDetElStatusEventDataBaseKey", "", "Optional event data key of an input SiDetectorElementStatus on which the newly created object will be based."}
SG::ReadCondHandleKey< InDet::SiDetectorElementStatusm_pixelDetElStatusCondKey {this, "PixelDetElStatusCondDataBaseKey", "" , "Optional conditions data key of an input SiDetectorElementStatus on which the newly created object will be based."}
Gaudi::Property< bool > m_activeOnly {this, "ActiveOnly", false, "Module and chip status will only reflect whether the modules or chips are active not necessarily whether the signals are good."}
const uint64_t m_missingErrorInfo {std::numeric_limits<uint64_t>::max()-3000000000}
SG::SlotSpecificObj< std::mutex > m_cacheMutex ATLAS_THREAD_SAFE
SG::SlotSpecificObj< IDCCacheEntry > m_eventCache ATLAS_THREAD_SAFE
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 49 of file PixelConditionsSummaryTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ PixelConditionsSummaryTool()

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

Definition at line 9 of file PixelConditionsSummaryTool.cxx.

10 :AthAlgTool(type, name, parent),
11 m_pixelID(nullptr)
12{
13 m_isActiveStatus.emplace_back("OK");
14 m_isActiveStates.emplace_back("READY");
15
16 declareProperty("IsActiveStatus", m_isActiveStatus);
17 declareProperty("IsActiveStates", m_isActiveStates);
18}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< std::string > m_isActiveStates
std::vector< std::string > m_isActiveStatus

◆ ~PixelConditionsSummaryTool()

PixelConditionsSummaryTool::~PixelConditionsSummaryTool ( )
virtualdefault

Member Function Documentation

◆ activeFraction()

double PixelConditionsSummaryTool::activeFraction ( const IdentifierHash & moduleHash,
const Identifier & idStart,
const Identifier & idEnd,
const EventContext & ctx ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 266 of file PixelConditionsSummaryTool.cxx.

266 {
267 return 1.0;
268}

◆ checkChipStatus()

bool PixelConditionsSummaryTool::checkChipStatus ( IdentifierHash moduleHash,
Identifier pixid,
const EventContext & ctx ) const
inline

Definition at line 181 of file PixelConditionsSummaryTool.h.

181 {
182 std::bitset<16> chipStatus(SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey, ctx)->getChipStatus(moduleHash));
183 if (chipStatus.any()) {
184
185 const InDetDD::SiDetectorElement *element = getDetectorEelement(moduleHash,ctx);
186 const InDetDD::PixelModuleDesign *p_design = static_cast<const InDetDD::PixelModuleDesign*>(&element->design());
187
188 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
190 m_pixelID->eta_index(pixid));
191 InDetDD::PixelDiodeTree::DiodeProxy si_param ( p_design->diodeProxyFromIdx(diode_idx));
192 std::uint32_t chFE = p_design->getFE(si_param);
193
194 std::bitset<16> circ;
195 circ.set(chFE);
196 if ((chipStatus&circ).any()) { return false; }
197 }
198 return true;
199}
static constexpr std::array< PixelDiodeTree::CellIndexType, 2 > makeCellIndex(T local_x_idx, T local_y_idx)
Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction.
PixelDiodeTree::DiodeProxy diodeProxyFromIdx(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy)
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
SG::ReadCondHandleKey< PixelDeadMapCondData > m_condDeadMapKey
const InDetDD::SiDetectorElement * getDetectorEelement(const IdentifierHash &moduleHash, const EventContext &ctx) const

◆ createDetectorElementStatus()

std::unique_ptr< InDet::SiDetectorElementStatus > PixelConditionsSummaryTool::createDetectorElementStatus ( const EventContext & ctx,
SG::WriteCondHandle< InDet::SiDetectorElementStatus > * whandle ) const
private

Create a new detector element status element container.

Depending on the properties the container may be a copy of an event data or conditions data element status container.

Definition at line 330 of file PixelConditionsSummaryTool.cxx.

331 {
332 if (!m_pixelDetElStatusCondKey.empty()) {
333 SG::ReadCondHandle<InDet::SiDetectorElementStatus> input_element_status{m_pixelDetElStatusCondKey, ctx};
334 if (whandle) {
335 whandle->addDependency (input_element_status);
336 }
337 return std::make_unique<InDet::PixelDetectorElementStatus>(*castToDerived(input_element_status.cptr()));
338 }
339 else if (!m_pixelDetElStatusEventKey.empty()) {
340 SG::ReadHandle<InDet::SiDetectorElementStatus> input_element_status{m_pixelDetElStatusEventKey, ctx};
341 return std::make_unique<InDet::PixelDetectorElementStatus>(*castToDerived(input_element_status.cptr()));
342 }
343 else {
344 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> pixelDetEleHandle(m_pixelDetEleCollKey, ctx);
345 if (not pixelDetEleHandle.isValid() ) {
346 std::stringstream msg;
347 msg << m_pixelDetEleCollKey.fullKey() << " is not available.";
348 throw std::runtime_error(msg.str());
349 }
350 if (whandle) {
351 whandle->addDependency (pixelDetEleHandle);
352 }
353 const InDetDD::SiDetectorElementCollection* elements(*pixelDetEleHandle);
354 return std::make_unique<InDet::PixelDetectorElementStatus>(*elements);
355 }
356}
MsgStream & msg() const
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusEventKey
SG::ReadCondHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusCondKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
const_pointer_type cptr()
const_pointer_type cptr()
Dereference the pointer.
void addDependency(const EventIDRange &range)

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ DeclareInterfaceID()

IInDetConditionsTool::DeclareInterfaceID ( IInDetConditionsTool ,
1 ,
0  )
inherited

Creates the InterfaceID and interfaceID() method.

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getBSErrorWord() [1/3]

uint64_t PixelConditionsSummaryTool::getBSErrorWord ( const IdentifierHash & moduleHash,
const EventContext & ctx,
const IDCCacheEntry * cacheEntry = nullptr ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 115 of file PixelConditionsSummaryTool.cxx.

115 {
116 return getBSErrorWord(moduleHash, moduleHash, ctx, cacheEntry);
117}
virtual uint64_t getBSErrorWord(const IdentifierHash &moduleHash, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const override final

◆ getBSErrorWord() [2/3]

uint64_t PixelConditionsSummaryTool::getBSErrorWord ( const IdentifierHash & moduleHash,
const int index,
const EventContext & ctx,
const IDCCacheEntry * cacheEntry = nullptr ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 134 of file PixelConditionsSummaryTool.cxx.

137 {
138 const InDetDD::SiDetectorElement *element = getDetectorEelement(moduleHash,ctx);
139 const InDetDD::PixelModuleDesign *p_design = static_cast<const InDetDD::PixelModuleDesign*>(&element->design());
140 return getBSErrorWord(p_design,index,ctx,cacheEntry);
141}

◆ getBSErrorWord() [3/3]

uint64_t PixelConditionsSummaryTool::getBSErrorWord ( const InDetDD::PixelModuleDesign * p_design,
const int index,
const EventContext & ctx,
const IInDetConditionsTool::IDCCacheEntry * cacheEntry ) const
private

Definition at line 143 of file PixelConditionsSummaryTool.cxx.

146 {
147
151
152 if (cacheEntry == nullptr){
153 std::scoped_lock<std::mutex> lock{*m_cacheMutex.get(ctx)};
154 cacheEntry=getCacheEntry(ctx);
155 }
156 const auto *idcCachePtr = cacheEntry->IDCCache;
157 if (idcCachePtr==nullptr) {
158 ATH_MSG_ERROR("PixelConditionsSummaryTool No cache! " );
159 return 0;
160 }
161 uint64_t word = (uint64_t)idcCachePtr->retrieve(index);
162 return word<m_missingErrorInfo ? word : 0;
163}
#define ATH_MSG_ERROR(x)
PixelReadoutTechnology getReadoutTechnology() const
Gaudi::Property< bool > m_useByteStreamFEI3
Gaudi::Property< bool > m_useByteStreamFEI4
IDCCacheEntry * getCacheEntry(const EventContext &ctx) const
Return cache for the current event If, for current slot, the cache is outdated it is retrieved from t...
Gaudi::Property< bool > m_useByteStreamRD53
const IDCInDetBSErrContainer_Cache * IDCCache

◆ getCacheEntry()

IInDetConditionsTool::IDCCacheEntry * PixelConditionsSummaryTool::getCacheEntry ( const EventContext & ctx) const
nodiscardprivate

Return cache for the current event If, for current slot, the cache is outdated it is retrieved from the IDC collection.

If the IDC is missing nullptr is returned.

Definition at line 94 of file PixelConditionsSummaryTool.cxx.

94 {
95 IDCCacheEntry* cacheEntry = m_eventCache.get(ctx);
96 if (cacheEntry->needsUpdate(ctx)) {
97 const auto *idcErrContPtr = getContainer(ctx);
98 if (idcErrContPtr==nullptr) { // missing or not, the cache needs to be reset
99 cacheEntry->reset(ctx.evt(), nullptr);
100 }
101 else {
102 cacheEntry->reset(ctx.evt(), idcErrContPtr->cache());
103 }
104 ATH_MSG_VERBOSE("PixelConditionsSummaryTool Cache for the event reset " << cacheEntry->eventId << " with IDC container" << idcErrContPtr);
105 }
106 return cacheEntry;
107}
#define ATH_MSG_VERBOSE(x)
const IDCInDetBSErrContainer * getContainer(const EventContext &ctx) const
Obtains container form the SG, if it is missing it will complain (hard-coded 3 times per job) and ret...

◆ getCacheEntryOut()

IInDetConditionsTool::IDCCacheEntry * PixelConditionsSummaryTool::getCacheEntryOut ( const EventContext & ctx) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 109 of file PixelConditionsSummaryTool.cxx.

109 {
110 std::scoped_lock<std::mutex> lock{*m_cacheMutex.get(ctx)};
111 IDCCacheEntry* cacheEntry = getCacheEntry(ctx);
112 return cacheEntry;
113}

◆ getContainer()

const IDCInDetBSErrContainer * PixelConditionsSummaryTool::getContainer ( const EventContext & ctx) const
nodiscardprivate

Obtains container form the SG, if it is missing it will complain (hard-coded 3 times per job) and return nullptr.

Definition at line 83 of file PixelConditionsSummaryTool.cxx.

83 {
85 if (!useByteStream || m_BSErrContReadKey.empty() ) {
86 return nullptr;
87 }
88 SG::ReadHandle<IDCInDetBSErrContainer> idcErrCont(m_BSErrContReadKey, ctx);
89 if (not idcErrCont.isValid()) { return nullptr; }
90 ATH_MSG_VERBOSE("PixelConditionsSummaryTool IDC Container fetched " << m_BSErrContReadKey.key());
91 return idcErrCont.cptr();
92}
SG::ReadHandleKey< IDCInDetBSErrContainer > m_BSErrContReadKey

◆ getDetectorEelement()

const InDetDD::SiDetectorElement * PixelConditionsSummaryTool::getDetectorEelement ( const IdentifierHash & moduleHash,
const EventContext & ctx ) const
private

Definition at line 119 of file PixelConditionsSummaryTool.cxx.

119 {
120 if (moduleHash>=m_pixelID->wafer_hash_max()) {
121 ATH_MSG_ERROR("invalid moduleHash : " << moduleHash << " exceed maximum hash id: " << m_pixelID->wafer_hash_max());
122 return nullptr;
123 }
124
125 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> pixelDetEleHandle(m_pixelDetEleCollKey, ctx);
126 const InDetDD::SiDetectorElementCollection* elements(*pixelDetEleHandle);
127 if (not pixelDetEleHandle.isValid() or elements==nullptr) {
128 ATH_MSG_ERROR(m_pixelDetEleCollKey.fullKey() << " is not available.");
129 return nullptr;
130 }
131 return elements->getDetectorElement(moduleHash);
132}

◆ getDetectorElementStatus()

std::unique_ptr< InDet::SiDetectorElementStatus > PixelConditionsSummaryTool::getDetectorElementStatus ( const EventContext & ctx,
SG::WriteCondHandle< InDet::SiDetectorElementStatus > * whandle ) const
overridevirtual

get the module and chip status of Si detector elements

Parameters
ctxthe current event contex
whandlePointer to the write handle for the conditions object being built, for propagation of IOV range and dependency information. Pass nullptr if we're building an object for event data, rather than conditions data.

Implements IDetectorElementStatusTool.

Definition at line 359 of file PixelConditionsSummaryTool.cxx.

360 {
361 std::unique_ptr<InDet::SiDetectorElementStatus> element_status( createDetectorElementStatus(ctx, whandle));
362 std::vector<bool> &status=element_status->getElementStatus();
363 status.resize(m_pixelID->wafer_hash_max(),
364 ((1<<0) & m_activeStateMask) // default value of PixelDCSStateData is 0
365 );
366 std::vector<InDet::ChipFlags_t> &chip_status=element_status->getElementChipStatus();
367 chip_status.resize(status.size(),0);
368
369 // module state
370 {
371 SG::ReadCondHandle<PixelDCSStateData> dcs_state_handle(m_condDCSStateKey, ctx);
372 andStatus(dcs_state_handle->moduleStatusMap(), m_activeStateMask, status);
373 if (whandle) {
374 whandle->addDependency (dcs_state_handle);
375 }
376 }
377 const bool active_only = m_activeOnly;
378 if (!active_only) {
379 SG::ReadCondHandle<PixelDCSStatusData> dcs_status_handle(m_condDCSStatusKey, ctx);
380 andStatus(dcs_status_handle->moduleStatusMap(), m_activeStatusMask, status);
381 if (whandle) {
382 whandle->addDependency (dcs_status_handle);
383 }
384 }
385 if (!m_condTDAQKey.empty()) {
386 SG::ReadCondHandle<PixelTDAQData> tdaq_handle(m_condTDAQKey,ctx);
387 andNotStatus(tdaq_handle->moduleStatusMap(), status);
388 if (whandle) {
389 whandle->addDependency (tdaq_handle);
390 }
391 }
392 {
393 SG::ReadCondHandle<PixelDeadMapCondData> dead_map_handle(m_condDeadMapKey, ctx);
394 andNotStatus(dead_map_handle->moduleStatusMap(), status);
395 if (whandle) {
396 whandle->addDependency (dead_map_handle);
397 }
398
399 const PixelDeadMapCondData *dead_map = dead_map_handle.cptr();
400 unsigned int element_i=0;
401 for (const InDetDD::SiDetectorElement *element : element_status->getDetectorElements()) {
402 if (status[element_i]) {
403 const InDetDD::PixelModuleDesign *p_design = static_cast<const InDetDD::PixelModuleDesign*>(&element->design());
404 InDetDD::PixelReadoutTechnology readout_technology = p_design->getReadoutTechnology();
405 unsigned int number_of_chips = readout_technology == InDetDD::PixelReadoutTechnology::FEI3 ? 2*p_design->numberOfCircuits() : p_design->numberOfCircuits();
406 InDet::ChipFlags_t chip_mask = (1ul<<number_of_chips)-1ul;
407 assert( chip_mask != 0 );
408 std::bitset<16> dead_chip_mask(dead_map->getChipStatus(element_i));
409 chip_status[element_i] = chip_mask & (~static_cast<InDet::ChipFlags_t>(dead_chip_mask.to_ulong()));
410 }
411 ++element_i;
412 }
413 }
414
415
416 static_assert( static_cast<unsigned int>(InDetDD::PixelReadoutTechnology::FEI4) < 32u) ;
417 static_assert( static_cast<unsigned int>(InDetDD::PixelReadoutTechnology::FEI3) < 32u) ;
418 static_assert( static_cast<unsigned int>(InDetDD::PixelReadoutTechnology::RD53) < 32u) ;
422 if (readout_technology_mask) {
423 if (whandle) {
424 ATH_MSG_ERROR("PixelConditionsSummaryTool not configured for use with conditions objects");
426 }
427 std::scoped_lock<std::mutex> lock{*m_cacheMutex.get(ctx)};
428 const IDCInDetBSErrContainer_Cache *idcCachePtr = nullptr;
429 idcCachePtr = getCacheEntry(ctx)->IDCCache;
430 if (idcCachePtr==nullptr) {
431 ATH_MSG_ERROR("PixelConditionsSummaryTool No cache! " );
432 }
433 else {
434
447
458
459 // The index array is defined in PixelRawDataProviderTool::SizeOfIDCInDetBSErrContainer()
460 // Here, 52736 is a separator beween error flags and isActive flags.
461 unsigned int element_offset_i = (active_only ? 52736 : 0);
462
463 unsigned int element_i=0;
464 unsigned int maxHash = m_pixelID->wafer_hash_max();
465 for (const InDetDD::SiDetectorElement *element : element_status->getDetectorElements()) {
466 const InDetDD::PixelModuleDesign *p_design = static_cast<const InDetDD::PixelModuleDesign*>(&element->design());
467 InDetDD::PixelReadoutTechnology readout_technology = p_design->getReadoutTechnology();
468 unsigned int readout_technology_flags = readout_technology_mask & Pixel::makeReadoutTechnologyBit(readout_technology);
469
470 // set to false if has one of the considered errors and the readout technology is considered.
471 status.at(element_i) = status.at(element_i) && not ( readout_technology_flags
472 && ( !active_only
473 ? isBSError(static_cast<uint64_t>(idcCachePtr->retrieve(element_i)), m_missingErrorInfo, error_mask)
474 : idcCachePtr->retrieve(element_i+element_offset_i)!=1 ));
475
476 // compute the status for the individual front-ends
477 if (status[element_i]) {
478 unsigned int number_of_chips = readout_technology == InDetDD::PixelReadoutTechnology::FEI3 ? 2*p_design->numberOfCircuits() : p_design->numberOfCircuits();
479 InDet::ChipFlags_t chip_mask = status[element_i] ? (1ul<<number_of_chips)-1ul : 0;
480 assert( chip_mask != 0 );
481 InDet::ChipFlags_t bs_status_flags = active_only ? chip_mask : 0;
482 if (!active_only) {
483 for (unsigned int chip_i =0; chip_i < number_of_chips; ++chip_i) {
484 // get bytestream error for chip
485 unsigned int indexFE = (1+chip_i)*maxHash + element_i; // (FE_channel+1)*2048 + moduleHash
486 InDet::ChipFlags_t chip_flag =not ( readout_technology_flags
487 && (isBSError(static_cast<uint64_t>(idcCachePtr->retrieve(indexFE)), m_missingErrorInfo, chip_error_mask)));
488 bs_status_flags |= (chip_flag << chip_i);
489 }
490 }
491 chip_status[element_i] &= (bs_status_flags & chip_mask);
492 }
493 else {
494 chip_status[element_i] = 0;
495 }
496 ++element_i;
497 }
498 }
499 }
500 return element_status;
501}
IdentifiableValueCache< IDCInDetBSErrContainer::ErrorCode > IDCInDetBSErrContainer_Cache
T retrieve(size_t i)
Retrieve the Value stored in that hash.
int numberOfCircuits() const
Total number of circuits:
unsigned short ChipFlags_t
SG::ReadCondHandleKey< PixelDCSStatusData > m_condDCSStatusKey
unsigned int m_activeStateMask
mask in which each state is represented by a bit and for states which are cnsidered active the corres...
std::unique_ptr< InDet::SiDetectorElementStatus > createDetectorElementStatus(const EventContext &ctx, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const
Create a new detector element status element container.
SG::ReadCondHandleKey< PixelDCSStateData > m_condDCSStateKey
SG::ReadCondHandleKey< PixelTDAQData > m_condTDAQKey
unsigned int m_activeStatusMask
mask in which each status is represented by a bit and for status values which are cnsidered active th...
int getChipStatus(const int chanNum) const
constexpr IDCInDetBSErrContainer::ErrorCode makeError(PixelErrorsEnum errType)
helper to be used in clients to fetch error information
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.
status
Definition merge.py:16

◆ getInvalidRange()

EventIDRange IDetectorElementStatusTool::getInvalidRange ( )
inlinestaticinherited

Definition at line 33 of file IDetectorElementStatusTool.h.

33{ return EventIDRange (getUndefinedEventId(),getUndefinedEventId()); }

◆ getUndefinedEventId()

EventIDBase IDetectorElementStatusTool::getUndefinedEventId ( )
inlinestaticinherited

Definition at line 32 of file IDetectorElementStatusTool.h.

32{ return EventIDBase (0, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM, 0, 0); }

◆ goodFraction()

double PixelConditionsSummaryTool::goodFraction ( const IdentifierHash & moduleHash,
const Identifier & idStart,
const Identifier & idEnd,
const EventContext & ctx ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 557 of file PixelConditionsSummaryTool.cxx.

557 {
558
559 if (!isGood(moduleHash, ctx)) { return 0.0; }
560
561 Identifier moduleID = m_pixelID->wafer_id(moduleHash);
562
563 int phiStart = m_pixelID->phi_index(idStart);
564 int etaStart = m_pixelID->eta_index(idStart);
565
566 int phiEnd = m_pixelID->phi_index(idEnd);
567 int etaEnd = m_pixelID->eta_index(idEnd);
568
569 double nTotal = (std::abs(phiStart-phiEnd)+1.0)*(std::abs(etaStart-etaEnd)+1.0);
570
571 double nGood = 0.0;
572 IInDetConditionsTool::IDCCacheEntry* cacheEntry = getCacheEntry(ctx);
573 for (int i=std::min(phiStart,phiEnd); i<=std::max(phiStart,phiEnd); i++) {
574 for (int j=std::min(etaStart,etaEnd); j<=std::max(etaStart,etaEnd); j++) {
575 if (checkChipStatus(moduleHash, m_pixelID->pixel_id(moduleID,i,j), ctx)) {
576 if (!hasBSError(moduleHash, m_pixelID->pixel_id(moduleID,i,j), ctx, cacheEntry)) { nGood++; }
577 }
578 }
579 }
580 return nGood/nTotal;
581}
bool checkChipStatus(IdentifierHash moduleHash, Identifier pixid, const EventContext &ctx) const
virtual bool isGood(const Identifier &elementId, const InDetConditions::Hierarchy h, const EventContext &ctx) const override final
virtual bool hasBSError(const IdentifierHash &moduleHash, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const override final

◆ hasBSError() [1/3]

bool PixelConditionsSummaryTool::hasBSError ( const IdentifierHash & moduleHash,
const EventContext & ctx,
const IDCCacheEntry * cacheEntry = nullptr ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 165 of file PixelConditionsSummaryTool.cxx.

165 {
166 const InDetDD::SiDetectorElement *element = getDetectorEelement(moduleHash,ctx);
167 const InDetDD::PixelModuleDesign *p_design = static_cast<const InDetDD::PixelModuleDesign*>(&element->design());
168 return hasBSError(p_design,moduleHash, ctx,cacheEntry);
169}

◆ hasBSError() [2/3]

bool PixelConditionsSummaryTool::hasBSError ( const IdentifierHash & moduleHash,
Identifier pixid,
const EventContext & ctx,
const IDCCacheEntry * cacheEntry = nullptr ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 191 of file PixelConditionsSummaryTool.cxx.

191 {
192 const InDetDD::SiDetectorElement *element = getDetectorEelement(moduleHash,ctx);
193 const InDetDD::PixelModuleDesign *p_design = static_cast<const InDetDD::PixelModuleDesign*>(&element->design());
194
195 if (hasBSError(p_design, moduleHash, ctx, cacheEntry)) { return true; }
196
197 int maxHash = m_pixelID->wafer_hash_max();
198
199 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
201 m_pixelID->eta_index(pixid));
202 InDetDD::PixelDiodeTree::DiodeProxy si_param ( p_design->diodeProxyFromIdx(diode_idx));
203 std::uint32_t chFE = p_design->getFE(si_param);
204
205 int indexFE = (1+chFE)*maxHash+static_cast<int>(moduleHash); // (FE_channel+1)*2048 + moduleHash
206 uint64_t word = getBSErrorWord(p_design,indexFE,ctx,cacheEntry);
207 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Preamble)) { return true; }
208 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TimeOut)) { return true; }
209 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LVL1ID)) { return true; }
210 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::BCID)) { return true; }
211 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Trailer)) { return true; }
212 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCLVL1IDEoECheck)) { return true; }
213 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCBCIDEoECheck)) { return true; }
214 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCLVL1IDCheck)) { return true; }
215 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCEoEOverflow)) { return true; }
216 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCHitOverflow)) { return true; }
217 return false;
218}

◆ hasBSError() [3/3]

bool PixelConditionsSummaryTool::hasBSError ( const InDetDD::PixelModuleDesign * p_design,
const IdentifierHash & moduleHash,
const EventContext & ctx,
const IInDetConditionsTool::IDCCacheEntry * cacheEntry ) const
private

Definition at line 171 of file PixelConditionsSummaryTool.cxx.

174 {
175 uint64_t word = getBSErrorWord(p_design,moduleHash, ctx,cacheEntry);
176 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TruncatedROB)) { return true; }
177 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MaskedROB)) { return true; }
178 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Preamble)) { return true; }
179 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TimeOut)) { return true; }
180 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LVL1ID)) { return true; }
181 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::BCID)) { return true; }
182 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Trailer)) { return true; }
183 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCLVL1IDEoECheck)) { return true; }
184 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCBCIDEoECheck)) { return true; }
185 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCLVL1IDCheck)) { return true; }
186 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCEoEOverflow)) { return true; }
187 if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCHitOverflow)) { return true; }
188 return false;
189}

◆ initialize()

StatusCode PixelConditionsSummaryTool::initialize ( )
overridevirtual

Definition at line 22 of file PixelConditionsSummaryTool.cxx.

22 {
23 ATH_MSG_DEBUG("PixelConditionsSummaryTool::initialize()");
24
25 ATH_CHECK(m_condDCSStateKey.initialize());
26 ATH_CHECK(m_condDCSStatusKey.initialize());
27
29 ATH_CHECK(m_BSErrContReadKey.initialize(useByteStream && !m_BSErrContReadKey.empty()));
30 ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID"));
31 ATH_CHECK(m_condTDAQKey.initialize( !m_condTDAQKey.empty() ));
32 ATH_CHECK(m_condDeadMapKey.initialize());
33 ATH_CHECK(m_pixelDetEleCollKey.initialize());
35 ATH_MSG_FATAL("The event data (PixelDetElStatusEventDataBaseKey) and cond data (PixelDetElStatusCondDataBaseKey) keys cannot be set at the same time.");
36 }
39
41 for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) {
43 else if (m_isActiveStates[istate]=="ON") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::ON); }
44 else if (m_isActiveStates[istate]=="UNKNOWN") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::UNKNOWN); }
45 else if (m_isActiveStates[istate]=="TRANSITION") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::TRANSITION); }
46 else if (m_isActiveStates[istate]=="UNDEFINED") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::UNDEFINED); }
47 else if (m_isActiveStates[istate]=="DISABLED") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::DISABLED); }
48 else if (m_isActiveStates[istate]=="LOCKED_OUT") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::LOCKED_OUT); }
49 else if (m_isActiveStates[istate]=="OFF") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::OFF); }
50 else if (m_isActiveStates[istate]=="NOSTATE") { m_activeState.push_back(PixelDCSStateData::DCSModuleState::NOSTATE); }
51 else {
52 ATH_MSG_ERROR("No matching DCS state " << m_isActiveStates[istate] << " in DCSModuleState");
53 return StatusCode::FAILURE;
54 }
55 if (m_activeState.back()<0 || m_activeState.back()>31) {
56 ATH_MSG_FATAL("Logic error: status id too large. Cannot be represented by a bit");
57 return StatusCode::FAILURE;
58 }
59 m_activeStateMask |= (1u<<m_activeState.back());
60 }
61
63 for (auto & isActiveStatus : m_isActiveStatus) {
64 if (isActiveStatus=="OK") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::OK); }
65 else if (isActiveStatus=="WARNING") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::WARNING); }
66 else if (isActiveStatus=="ERROR") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::ERROR); }
67 else if (isActiveStatus=="FATAL") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::FATAL); }
68 else if (isActiveStatus=="NOSTATUS") { m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::NOSTATUS); }
69 else {
70 ATH_MSG_ERROR("No matching DCS status " << isActiveStatus << " in DCSModuleStatus");
71 return StatusCode::FAILURE;
72 }
73 if (m_activeStatus.back()<0 || m_activeStatus.back()>31) {
74 ATH_MSG_FATAL("Logic error: status id too large. Cannot be represented by a bit");
75 return StatusCode::FAILURE;
76 }
77 m_activeStatusMask |= (1u<<m_activeStatus.back());
78 }
79
80 return StatusCode::SUCCESS;
81}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
const ServiceHandle< StoreGateSvc > & detStore() const
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

InterfaceID & PixelConditionsSummaryTool::interfaceID ( )
inlinestatic

Definition at line 176 of file PixelConditionsSummaryTool.h.

176 {
177 static InterfaceID IID_PixelConditionsSummaryTool("PixelConditionsSummaryTool", 1, 0);
178 return IID_PixelConditionsSummaryTool;
179}

◆ isActive() [1/3]

bool PixelConditionsSummaryTool::isActive ( const Identifier & elementId,
const InDetConditions::Hierarchy h,
const EventContext & ctx ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 220 of file PixelConditionsSummaryTool.cxx.

220 {
221 return true;
222}

◆ isActive() [2/3]

bool PixelConditionsSummaryTool::isActive ( const IdentifierHash & moduleHash,
const EventContext & ctx ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 224 of file PixelConditionsSummaryTool.cxx.

224 {
225
226 // The index array is defined in PixelRawDataProviderTool::SizeOfIDCInDetBSErrContainer()
227 // Here, 52736 is a separator beween error flags and isActive flags.
229 if (useByteStream && getBSErrorWord(moduleHash,moduleHash+52736,ctx)!=1) { return false; }
230
231 SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey,ctx);
232 bool isDCSActive = false;
233 for (int istate : m_activeState) {
234 if (istate==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; }
235 }
236 if (!isDCSActive) { return false; }
237
238 if (!m_condTDAQKey.empty() && SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey,ctx)->getModuleStatus(moduleHash)) { return false; }
239
240 if (SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey,ctx)->getModuleStatus(moduleHash)) { return false; }
241
242 return true;
243}

◆ isActive() [3/3]

bool PixelConditionsSummaryTool::isActive ( const IdentifierHash & moduleHash,
const Identifier & elementId,
const EventContext & ctx ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 245 of file PixelConditionsSummaryTool.cxx.

245 {
246
247 // The index array is defined in PixelRawDataProviderTool::SizeOfIDCInDetBSErrContainer()
248 // Here, 52736 is a separator beween error flags and isActive flags.
250 if (useByteStream && getBSErrorWord(moduleHash,moduleHash+52736,ctx)!=1) { return false; }
251
252 SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey,ctx);
253 bool isDCSActive = false;
254 for (int istate : m_activeState) {
255 if (istate==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; }
256 }
257 if (!isDCSActive) { return false; }
258
259 if (!m_condTDAQKey.empty() && SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey,ctx)->getModuleStatus(moduleHash)) { return false; }
260
261 if (SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey,ctx)->getModuleStatus(moduleHash)) { return false; }
262
263 return checkChipStatus(moduleHash, elementId, ctx);
264}

◆ isGood() [1/3]

bool PixelConditionsSummaryTool::isGood ( const Identifier & elementId,
const InDetConditions::Hierarchy h,
const EventContext & ctx ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 270 of file PixelConditionsSummaryTool.cxx.

270 {
271 Identifier moduleID = m_pixelID->wafer_id(elementId);
272 IdentifierHash moduleHash = m_pixelID->wafer_hash(moduleID);
273
274 if (hasBSError(moduleHash, ctx)) { return false; }
275
276 SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey, ctx);
277 bool isDCSActive = false;
278 for (int istate : m_activeState) {
279 if (istate==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; }
280 }
281 if (!isDCSActive) { return false; }
282
283 SG::ReadCondHandle<PixelDCSStatusData> dcsstatus_data(m_condDCSStatusKey, ctx);
284 bool isDCSGood = false;
285 for (int activeStatus : m_activeStatus) {
286 if (activeStatus==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; }
287 }
288 if (!isDCSGood) { return false; }
289
290 if (!m_condTDAQKey.empty() && SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey,ctx)->getModuleStatus(moduleHash)) { return false; }
291
292 if (SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey, ctx)->getModuleStatus(moduleHash)) { return false; }
293
295 if (!checkChipStatus(moduleHash, elementId,ctx)) { return false; }
296 if (hasBSError(moduleHash, elementId, ctx)) { return false; }
297 }
298
299 return true;
300}

◆ isGood() [2/3]

bool PixelConditionsSummaryTool::isGood ( const IdentifierHash & moduleHash,
const EventContext & ctx ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 503 of file PixelConditionsSummaryTool.cxx.

503 {
504
505 if (hasBSError(moduleHash, ctx)) { return false; }
506
507 SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey, ctx);
508 bool isDCSActive = false;
509 for (int istate : m_activeState) {
510 if (istate==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; }
511 }
512 if (!isDCSActive) { return false; }
513
514 SG::ReadCondHandle<PixelDCSStatusData> dcsstatus_data(m_condDCSStatusKey, ctx);
515 bool isDCSGood = false;
516 for (int activeStatus : m_activeStatus) {
517 if (activeStatus==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; }
518 }
519 if (!isDCSGood) { return false; }
520
521 if (!m_condTDAQKey.empty() && SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey,ctx)->getModuleStatus(moduleHash)) { return false; }
522
523 if (SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey, ctx)->getModuleStatus(moduleHash)) { return false; }
524
525 return true;
526}

◆ isGood() [3/3]

bool PixelConditionsSummaryTool::isGood ( const IdentifierHash & moduleHash,
const Identifier & elementId,
const EventContext & ctx,
const IDCCacheEntry * cacheEntry = nullptr ) const
finaloverridevirtual

Implements IInDetConditionsTool.

Definition at line 528 of file PixelConditionsSummaryTool.cxx.

528 {
529
530 if (hasBSError(moduleHash, ctx, cacheEntry)) { return false; }
531
532 SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey, ctx);
533 bool isDCSActive = false;
534 for (int istate : m_activeState) {
535 if (istate==dcsstate_data->getModuleStatus(moduleHash)) { isDCSActive=true; }
536 }
537 if (!isDCSActive) { return false; }
538
539 SG::ReadCondHandle<PixelDCSStatusData> dcsstatus_data(m_condDCSStatusKey, ctx);
540 bool isDCSGood = false;
541 for (int activeStatus : m_activeStatus) {
542 if (activeStatus==dcsstatus_data->getModuleStatus(moduleHash)) { isDCSGood=true; }
543 }
544 if (!isDCSGood) { return false; }
545
546 if (!m_condTDAQKey.empty() && SG::ReadCondHandle<PixelTDAQData>(m_condTDAQKey,ctx)->getModuleStatus(moduleHash)) { return false; }
547
548 if (SG::ReadCondHandle<PixelDeadMapCondData>(m_condDeadMapKey, ctx)->getModuleStatus(moduleHash)) { return false; }
549
550 if (!checkChipStatus(moduleHash, elementId, ctx)) { return false; }
551
552 if (hasBSError(moduleHash, elementId, ctx, cacheEntry)) { return false; }
553
554 return true;
555}

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/2]

SG::SlotSpecificObj<std::mutex> m_cacheMutex PixelConditionsSummaryTool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 137 of file PixelConditionsSummaryTool.h.

◆ ATLAS_THREAD_SAFE [2/2]

SG::SlotSpecificObj<IDCCacheEntry> m_eventCache PixelConditionsSummaryTool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 153 of file PixelConditionsSummaryTool.h.

◆ m_activeOnly

Gaudi::Property< bool> PixelConditionsSummaryTool::m_activeOnly {this, "ActiveOnly", false, "Module and chip status will only reflect whether the modules or chips are active not necessarily whether the signals are good."}
private

Definition at line 132 of file PixelConditionsSummaryTool.h.

133{this, "ActiveOnly", false, "Module and chip status will only reflect whether the modules or chips are active not necessarily whether the signals are good."};

◆ m_activeState

std::vector<int> PixelConditionsSummaryTool::m_activeState
private

Definition at line 95 of file PixelConditionsSummaryTool.h.

◆ m_activeStateMask

unsigned int PixelConditionsSummaryTool::m_activeStateMask {}
private

mask in which each state is represented by a bit and for states which are cnsidered active the corresponding bit is set;

Definition at line 97 of file PixelConditionsSummaryTool.h.

97{};

◆ m_activeStatus

std::vector<int> PixelConditionsSummaryTool::m_activeStatus
private

Definition at line 96 of file PixelConditionsSummaryTool.h.

◆ m_activeStatusMask

unsigned int PixelConditionsSummaryTool::m_activeStatusMask {}
private

mask in which each status is represented by a bit and for status values which are cnsidered active the corresponding bit is set;

Definition at line 98 of file PixelConditionsSummaryTool.h.

98{};

◆ m_BSErrContReadKey

SG::ReadHandleKey<IDCInDetBSErrContainer> PixelConditionsSummaryTool::m_BSErrContReadKey {this, "PixelByteStreamErrs", "PixelByteStreamErrs", "PixelByteStreamErrs container key"}
private

Definition at line 121 of file PixelConditionsSummaryTool.h.

122{this, "PixelByteStreamErrs", "PixelByteStreamErrs", "PixelByteStreamErrs container key"};

◆ m_condDCSStateKey

SG::ReadCondHandleKey<PixelDCSStateData> PixelConditionsSummaryTool::m_condDCSStateKey {this, "PixelDCSStateCondData", "PixelDCSStateCondData", "Pixel FSM state key"}
private

Definition at line 109 of file PixelConditionsSummaryTool.h.

110{this, "PixelDCSStateCondData", "PixelDCSStateCondData", "Pixel FSM state key"};

◆ m_condDCSStatusKey

SG::ReadCondHandleKey<PixelDCSStatusData> PixelConditionsSummaryTool::m_condDCSStatusKey {this, "PixelDCSStatusCondData", "PixelDCSStatusCondData", "Pixel FSM status key"}
private

Definition at line 112 of file PixelConditionsSummaryTool.h.

113{this, "PixelDCSStatusCondData", "PixelDCSStatusCondData", "Pixel FSM status key"};

◆ m_condDeadMapKey

SG::ReadCondHandleKey<PixelDeadMapCondData> PixelConditionsSummaryTool::m_condDeadMapKey {this, "PixelDeadMapCondData", "PixelDeadMapCondData", "Pixel deadmap conditions key"}
private

Definition at line 118 of file PixelConditionsSummaryTool.h.

119{this, "PixelDeadMapCondData", "PixelDeadMapCondData", "Pixel deadmap conditions key"};

◆ m_condTDAQKey

SG::ReadCondHandleKey<PixelTDAQData> PixelConditionsSummaryTool::m_condTDAQKey {this, "PixelTDAQCondData", "", "Pixel TDAQ conditions key"}
private

Definition at line 115 of file PixelConditionsSummaryTool.h.

116{this, "PixelTDAQCondData", "", "Pixel TDAQ conditions key"}; //Default empty - legacy option

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_isActiveStates

std::vector<std::string> PixelConditionsSummaryTool::m_isActiveStates
private

Definition at line 94 of file PixelConditionsSummaryTool.h.

◆ m_isActiveStatus

std::vector<std::string> PixelConditionsSummaryTool::m_isActiveStatus
private

Definition at line 93 of file PixelConditionsSummaryTool.h.

◆ m_missingErrorInfo

const uint64_t PixelConditionsSummaryTool::m_missingErrorInfo {std::numeric_limits<uint64_t>::max()-3000000000}
private

Definition at line 135 of file PixelConditionsSummaryTool.h.

135{std::numeric_limits<uint64_t>::max()-3000000000};

◆ m_pixelDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> PixelConditionsSummaryTool::m_pixelDetEleCollKey {this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}
private

Definition at line 124 of file PixelConditionsSummaryTool.h.

125{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};

◆ m_pixelDetElStatusCondKey

SG::ReadCondHandleKey<InDet::SiDetectorElementStatus> PixelConditionsSummaryTool::m_pixelDetElStatusCondKey {this, "PixelDetElStatusCondDataBaseKey", "" , "Optional conditions data key of an input SiDetectorElementStatus on which the newly created object will be based."}
private

Definition at line 129 of file PixelConditionsSummaryTool.h.

130{this, "PixelDetElStatusCondDataBaseKey", "" , "Optional conditions data key of an input SiDetectorElementStatus on which the newly created object will be based."};

◆ m_pixelDetElStatusEventKey

SG::ReadHandleKey<InDet::SiDetectorElementStatus> PixelConditionsSummaryTool::m_pixelDetElStatusEventKey {this, "PixelDetElStatusEventDataBaseKey", "", "Optional event data key of an input SiDetectorElementStatus on which the newly created object will be based."}
private

Definition at line 127 of file PixelConditionsSummaryTool.h.

128{this, "PixelDetElStatusEventDataBaseKey", "", "Optional event data key of an input SiDetectorElementStatus on which the newly created object will be based."};

◆ m_pixelID

const PixelID* PixelConditionsSummaryTool::m_pixelID {}
private

Definition at line 91 of file PixelConditionsSummaryTool.h.

91{};

◆ m_useByteStreamFEI3

Gaudi::Property<bool> PixelConditionsSummaryTool::m_useByteStreamFEI3 {this, "UseByteStreamFEI3", false, "Switch of the ByteStream error for FEI3"}
private

Definition at line 103 of file PixelConditionsSummaryTool.h.

104{this, "UseByteStreamFEI3", false, "Switch of the ByteStream error for FEI3"};

◆ m_useByteStreamFEI4

Gaudi::Property<bool> PixelConditionsSummaryTool::m_useByteStreamFEI4 {this, "UseByteStreamFEI4", false, "Switch of the ByteStream error for FEI4"}
private

Definition at line 100 of file PixelConditionsSummaryTool.h.

101{this, "UseByteStreamFEI4", false, "Switch of the ByteStream error for FEI4"};

◆ m_useByteStreamRD53

Gaudi::Property<bool> PixelConditionsSummaryTool::m_useByteStreamRD53 {this, "UseByteStreamRD53", false, "Switch of the ByteStream error for RD53"}
private

Definition at line 106 of file PixelConditionsSummaryTool.h.

107{this, "UseByteStreamRD53", false, "Switch of the ByteStream error for RD53"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: