ATLAS Offline Software
SCT_ModuleVetoTool.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
13 #ifndef SCT_ModuleVetoTool_h
14 #define SCT_ModuleVetoTool_h
15 
16 //Athena includes
19 
22 
23 //Gaudi includes
24 #include "GaudiKernel/EventContext.h"
25 
26 //STL includes
27 #include <vector>
28 
29 //forward declarations
30 class SCT_ID;
31 
36 class SCT_ModuleVetoTool: public extends<AthAlgTool, ISCT_ConditionsTool> {
37  public:
38  //@name Tool methods
40  SCT_ModuleVetoTool(const std::string& type, const std::string& name, const IInterface* parent);
41  virtual ~SCT_ModuleVetoTool() = default;
42  virtual StatusCode initialize() override;
43  virtual StatusCode finalize() override;
45 
47  virtual bool canReportAbout(InDetConditions::Hierarchy h) const override;
48 
50  virtual bool isGood(const Identifier& elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override;
51  virtual bool isGood(const Identifier& elementId, const EventContext& ctx, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override;
52 
54  virtual bool isGood(const IdentifierHash& hashId) const override;
55  virtual bool isGood(const IdentifierHash& hashId, const EventContext& ctx) const override;
56  virtual void getDetectorElementStatus(const EventContext& ctx, InDet::SiDetectorElementStatus &element_status,
58 
59  private:
60  StringArrayProperty m_badElements{this, "BadModuleIdentifiers", {}, "list of bad detector elements (= module sides)"};
62  const SCT_ID* m_pHelper{nullptr};
63  bool m_useDatabase{false};
64  StringProperty m_JsonLocation {this, "JsonPath", "", "Path to the JSON file containing list of modules to be masked."};
65  BooleanProperty m_maskLayers{this, "MaskLayers", false, "Mask full layers/disks in overlay"};
66  IntegerProperty m_maskSide{this, "MaskSide", -1, "Mask full modules (-1), inner (0) or outer (1) sides"};
67  IntegerArrayProperty m_layersToMask{this, "LayersToMask", {}, "Which barrel layers to mask out, goes from 0 to N-1"};
68  IntegerArrayProperty m_disksToMask{this, "DisksToMask", {}, "Which endcap disks to mask out, goes from -N+1 to N+1 , skipping zero"};
69 
70  // ReadCondHandleKey
71  SG::ReadCondHandleKey<SCT_ModuleVetoCondData> m_condKey{this, "CondKey", "SCT_ModuleVetoCondData", "SCT modules to be vetoed"};
72  // Fill data from m_badElements
74  // Provides SCT_ModuleVetoCondData pointer
75  const SCT_ModuleVetoCondData* getCondData(const EventContext& ctx) const;
76 
77 };
78 
79 #endif // SCT_ModuleVetoTool_h
SCT_ModuleVetoTool::initialize
virtual StatusCode initialize() override
Definition: SCT_ModuleVetoTool.cxx:39
SCT_ModuleVetoTool::m_JsonLocation
StringProperty m_JsonLocation
Definition: SCT_ModuleVetoTool.h:64
SCT_ModuleVetoTool::isGood
virtual bool isGood(const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override
Is the detector element good?
Definition: SCT_ModuleVetoTool.cxx:117
ISCT_ConditionsTool.h
SCT_ModuleVetoTool::canReportAbout
virtual bool canReportAbout(InDetConditions::Hierarchy h) const override
Can the service report about the given component? (chip, module...)
Definition: SCT_ModuleVetoTool.cxx:93
InDetConditions::Hierarchy
Hierarchy
Definition: InDetHierarchy.h:14
SCT_ModuleVetoCondData.h
header file for data object for SCT_ModuleVetoCondAlg, SCT_LinkMaskingCondAlg, SCT_ModuleVetoTool,...
SCT_ModuleVetoTool::~SCT_ModuleVetoTool
virtual ~SCT_ModuleVetoTool()=default
SCT_ModuleVetoTool::getDetectorElementStatus
virtual void getDetectorElementStatus(const EventContext &ctx, InDet::SiDetectorElementStatus &element_status, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const override
Definition: SCT_ModuleVetoTool.cxx:135
SCT_ModuleVetoTool::m_pHelper
const SCT_ID * m_pHelper
Definition: SCT_ModuleVetoTool.h:62
SCT_ModuleVetoCondData
Class for data object used in SCT_ModuleVetoCondAlg, SCT_LinkMaskingCondAlg, SCT_ModuleVetoTool,...
Definition: SCT_ModuleVetoCondData.h:27
SCT_ModuleVetoTool::SCT_ModuleVetoTool
SCT_ModuleVetoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SCT_ModuleVetoTool.cxx:32
SCT_ModuleVetoTool::m_badElements
StringArrayProperty m_badElements
Definition: SCT_ModuleVetoTool.h:60
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SCT_ModuleVetoTool::fillData
StatusCode fillData()
Definition: SCT_ModuleVetoTool.cxx:164
InDetHierarchy.h
SCT_ModuleVetoTool::m_disksToMask
IntegerArrayProperty m_disksToMask
Definition: SCT_ModuleVetoTool.h:68
SCT_ModuleVetoTool
Definition: SCT_ModuleVetoTool.h:36
SCT_ModuleVetoTool::finalize
virtual StatusCode finalize() override
Definition: SCT_ModuleVetoTool.cxx:88
SCT_ModuleVetoTool::m_maskLayers
BooleanProperty m_maskLayers
Definition: SCT_ModuleVetoTool.h:65
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::ReadCondHandleKey< SCT_ModuleVetoCondData >
SCT_ModuleVetoTool::m_maskSide
IntegerProperty m_maskSide
Definition: SCT_ModuleVetoTool.h:66
h
SCT_ID
Definition: SCT_ID.h:68
SCT_ModuleVetoTool::getCondData
const SCT_ModuleVetoCondData * getCondData(const EventContext &ctx) const
Definition: SCT_ModuleVetoTool.cxx:236
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SCT_ModuleVetoTool::m_layersToMask
IntegerArrayProperty m_layersToMask
Definition: SCT_ModuleVetoTool.h:67
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
InDetConditions::DEFAULT
@ DEFAULT
Definition: InDetHierarchy.h:14
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
SCT_ModuleVetoTool::m_condKey
SG::ReadCondHandleKey< SCT_ModuleVetoCondData > m_condKey
Definition: SCT_ModuleVetoTool.h:71
SCT_ModuleVetoTool::m_useDatabase
bool m_useDatabase
Definition: SCT_ModuleVetoTool.h:63
SCT_ModuleVetoTool::m_localCondData
SCT_ModuleVetoCondData m_localCondData
Definition: SCT_ModuleVetoTool.h:61
Identifier
Definition: IdentifierFieldParser.cxx:14