ATLAS Offline Software
IInDetConditionsTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 #ifndef SIMULATIONBASE
10 #ifndef IInDetConditionsTool_h
11 #define IInDetConditionsTool_h
12 //Gaudi Includes
13 #include "GaudiKernel/IInterface.h"
14 #include "Identifier/IdContext.h"
15 
16 //Local includes
19 
20 //forward declarations
21 class Identifier;
22 class IdentifierHash;
27 class IInDetConditionsTool: virtual public IInterface, virtual public IAlgTool{
28 public:
29  virtual ~IInDetConditionsTool() = default;
32 
33  struct IDCCacheEntry {
34  EventContext::ContextEvt_t eventId = EventContext::INVALID_CONTEXT_EVT; // invalid event ID for the start
36 
37  void reset( EventContext::ContextEvt_t evtId, const IDCInDetBSErrContainer_Cache* cache) {
38  eventId = evtId;
39  IDCCache = cache;
40  }
41 
42  bool needsUpdate( const EventContext& ctx) const {
43  return eventId != ctx.evt() or eventId == EventContext::INVALID_CONTEXT_EVT;
44  }
45 
46  };
47 
48  virtual bool isActive(const Identifier& elementId, const InDetConditions::Hierarchy h, const EventContext& ctx) const =0;
49  virtual bool isActive(const IdentifierHash& elementHash, const EventContext& ctx) const =0;
50  virtual bool isActive(const IdentifierHash& elementHash, const Identifier& elementId, const EventContext& ctx) const =0;
51  virtual double activeFraction(const IdentifierHash& elementHash, const Identifier& idStart, const Identifier& idEnd, const EventContext& ctx) const =0;
52 
53  virtual bool isGood(const Identifier& elementId, const InDetConditions::Hierarchy h, const EventContext& ctx) const =0;
54  virtual bool isGood(const IdentifierHash& elementHash, const EventContext& ctx) const =0;
55  virtual bool isGood(const IdentifierHash& elementHash, const Identifier& elementId, const EventContext& ctx, const IDCCacheEntry* cacheEntry=nullptr) const =0;
56  virtual double goodFraction(const IdentifierHash& elementHash, const Identifier& idStart, const Identifier& idEnd, const EventContext& ctx) const =0;
57 
58  virtual bool hasBSError(const IdentifierHash& elementHash, const EventContext& ctx, const IDCCacheEntry* cacheEntry=nullptr) const =0;
59  virtual bool hasBSError(const IdentifierHash& elementHash, Identifier elementId, const EventContext& ctx, const IDCCacheEntry* cacheEntry=nullptr) const =0;
60  virtual uint64_t getBSErrorWord(const IdentifierHash& elementHash, const EventContext& ctx, const IDCCacheEntry* cacheEntry=nullptr) const =0;
61  virtual uint64_t getBSErrorWord(const IdentifierHash& elementHash, const int index, const EventContext& ctx, const IDCCacheEntry* cacheEntry=nullptr) const =0;
62 
63  virtual IDCCacheEntry* getCacheEntryOut(const EventContext& ctx) const = 0;
64 };
65 
66 #endif
67 #endif
IInDetConditionsTool::getBSErrorWord
virtual uint64_t getBSErrorWord(const IdentifierHash &elementHash, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const =0
IInDetConditionsTool::isGood
virtual bool isGood(const Identifier &elementId, const InDetConditions::Hierarchy h, const EventContext &ctx) const =0
IInDetConditionsTool::isGood
virtual bool isGood(const IdentifierHash &elementHash, const EventContext &ctx) const =0
IInDetConditionsTool::getBSErrorWord
virtual uint64_t getBSErrorWord(const IdentifierHash &elementHash, const int index, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const =0
index
Definition: index.py:1
IInDetConditionsTool::IDCCacheEntry::needsUpdate
bool needsUpdate(const EventContext &ctx) const
Definition: IInDetConditionsTool.h:42
IInDetConditionsTool::hasBSError
virtual bool hasBSError(const IdentifierHash &elementHash, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const =0
IInDetConditionsTool::activeFraction
virtual double activeFraction(const IdentifierHash &elementHash, const Identifier &idStart, const Identifier &idEnd, const EventContext &ctx) const =0
IInDetConditionsTool::IDCCacheEntry::reset
void reset(EventContext::ContextEvt_t evtId, const IDCInDetBSErrContainer_Cache *cache)
Definition: IInDetConditionsTool.h:37
InDetConditions::Hierarchy
Hierarchy
Definition: InDetHierarchy.h:14
IInDetConditionsTool::hasBSError
virtual bool hasBSError(const IdentifierHash &elementHash, Identifier elementId, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const =0
IInDetConditionsTool::isGood
virtual bool isGood(const IdentifierHash &elementHash, const Identifier &elementId, const EventContext &ctx, const IDCCacheEntry *cacheEntry=nullptr) const =0
IInDetConditionsTool::IDCCacheEntry::eventId
EventContext::ContextEvt_t eventId
Definition: IInDetConditionsTool.h:34
IdContext.h
IInDetConditionsTool::~IInDetConditionsTool
virtual ~IInDetConditionsTool()=default
IInDetConditionsTool::isActive
virtual bool isActive(const IdentifierHash &elementHash, const EventContext &ctx) const =0
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
InDetHierarchy.h
IInDetConditionsTool::goodFraction
virtual double goodFraction(const IdentifierHash &elementHash, const Identifier &idStart, const Identifier &idEnd, const EventContext &ctx) const =0
IInDetConditionsTool::getCacheEntryOut
virtual IDCCacheEntry * getCacheEntryOut(const EventContext &ctx) const =0
IInDetConditionsTool
Definition: IInDetConditionsTool.h:27
h
IInDetConditionsTool::isActive
virtual bool isActive(const Identifier &elementId, const InDetConditions::Hierarchy h, const EventContext &ctx) const =0
IDCInDetBSErrContainer.h
IInDetConditionsTool::isActive
virtual bool isActive(const IdentifierHash &elementHash, const Identifier &elementId, const EventContext &ctx) const =0
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
IdentifiableValueCache
This class is to provide an event wide MT container for concurrent storing of basic types,...
Definition: IdentifiableValueCache.h:19
IInDetConditionsTool::IDCCacheEntry::IDCCache
const IDCInDetBSErrContainer_Cache * IDCCache
Definition: IInDetConditionsTool.h:35
IInDetConditionsTool::IDCCacheEntry
Definition: IInDetConditionsTool.h:33
IInDetConditionsTool::DeclareInterfaceID
DeclareInterfaceID(IInDetConditionsTool, 1, 0)
Creates the InterfaceID and interfaceID() method.
Identifier
Definition: IdentifierFieldParser.cxx:14