ATLAS Offline Software
SCT_ReadCalibDataTool.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 
11 // Multiple inclusion protection
12 #ifndef SCT_READ_CALIB_DATA_TOOL
13 #define SCT_READ_CALIB_DATA_TOOL
14 
17 
23 
24 // Include Gaudi classes
25 #include "GaudiKernel/ServiceHandle.h"
26 
27 // Forward declarations
28 class SCT_ID;
29 
34 class SCT_ReadCalibDataTool: public extends<AthAlgTool, ISCT_ReadCalibDataTool> {
35 
36  public:
37  enum {STRIPS_PER_WAFER=768};
38  //----------Public Member Functions----------//
39  // Structors
40  SCT_ReadCalibDataTool(const std::string& type, const std::string& name, const IInterface* parent);
41  virtual ~SCT_ReadCalibDataTool() = default;
42 
43  // Standard Gaudi functions
44  virtual StatusCode initialize() override;
45  virtual StatusCode finalize() override;
46 
49  virtual bool canReportAbout(InDetConditions::Hierarchy h) const override;
51  virtual bool isGood(const Identifier& elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override;
52  virtual bool isGood(const Identifier& elementId, const EventContext& ctx, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override;
54  virtual bool isGood(const IdentifierHash& /*hashId*/) const override { return true; }
55  virtual bool isGood(const IdentifierHash& hashId, const EventContext& /*ctx*/) const override { return isGood(hashId); }
56  virtual void getDetectorElementStatus(const EventContext& ctx, InDet::SiDetectorElementStatus &element_status,
59 
60  // Methods to return calibration defect type and summary
61  virtual ISCT_ReadCalibDataTool::CalibDefectType defectType(const Identifier& stripId, const EventContext& ctx, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override;
63  virtual SCT_CalibDefectData::CalibModuleDefects defectsSummary(const Identifier& moduleId, const std::string& scan, const EventContext& ctx) const override;
64  virtual SCT_CalibDefectData::CalibModuleDefects defectsSummary(const Identifier& moduleId, const std::string& scan) const override;
65  virtual std::list<Identifier> defectList(const std::string& defect, const EventContext& ctx) const override;
66  virtual std::list<Identifier> defectList(const std::string& defect) const override;
67 
68  private:
69  // Read Cond Handles
70  SG::ReadCondHandleKey<SCT_CalibDefectData> m_condKeyGain{this, "CondKeyGain", "SCT_CalibDefectNPtGain", "SCT defects due to NPtGain calibration"};
71  SG::ReadCondHandleKey<SCT_CalibDefectData> m_condKeyNoise{this, "CondKeyNoise", "SCT_CalibDefectNPtNoise", "SCT defects due to NPtNoise calibration"};
72  SG::ReadCondHandleKey<SCT_AllGoodStripInfo> m_condKeyInfo{this, "CondKeyInfo", "SCT_AllGoodStripInfo", "SCT good strips based on calibration defects"};
73  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
74 
75  const SCT_CalibDefectData* getCondDataGain(const EventContext& ctx) const;
76  const SCT_CalibDefectData* getCondDataNoise(const EventContext& ctx) const;
77  const SCT_AllGoodStripInfo* getCondDataInfo(const EventContext& ctx) const;
78  const InDetDD::SiDetectorElement* getDetectorElement(const IdentifierHash& waferHash, const EventContext& ctx) const;
79 
80  //----------Private Attributes----------//
81  ToolHandle<ISCT_CablingTool> m_cabling{this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"};
82  const SCT_ID* m_id_sct{nullptr};
83 };
84 
85 //----------------------------------------------------------------------
86 #endif // SCT_READ_CALIB_DATA_TOOL
SCT_ReadCalibDataTool::getDetectorElementStatus
virtual void getDetectorElementStatus(const EventContext &ctx, InDet::SiDetectorElementStatus &element_status, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const override
Definition: SCT_ReadCalibDataTool.cxx:116
ISCT_ReadCalibDataTool.h
SCT_ReadCalibDataTool::getCondDataInfo
const SCT_AllGoodStripInfo * getCondDataInfo(const EventContext &ctx) const
Definition: SCT_ReadCalibDataTool.cxx:423
SCT_ReadCalibDataTool::m_id_sct
const SCT_ID * m_id_sct
Handle to SCT ID helper.
Definition: SCT_ReadCalibDataTool.h:82
SCT_ReadCalibDataTool::~SCT_ReadCalibDataTool
virtual ~SCT_ReadCalibDataTool()=default
Destructor.
SCT_CalibDefectData.h
SCT_ReadCalibDataTool::isGood
virtual bool isGood(const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override
Summarise the result from the tool as good/bad.
Definition: SCT_ReadCalibDataTool.cxx:110
SCT_ReadCalibDataTool::STRIPS_PER_WAFER
@ STRIPS_PER_WAFER
Definition: SCT_ReadCalibDataTool.h:37
SCT_ReadCalibDataTool::m_condKeyNoise
SG::ReadCondHandleKey< SCT_CalibDefectData > m_condKeyNoise
Definition: SCT_ReadCalibDataTool.h:71
InDetConditions::Hierarchy
Hierarchy
Definition: InDetHierarchy.h:14
SCT_CalibDefectData
Container with a list of defects derived from calibration data and used in SCT_ReadCalibDataCondAlg a...
Definition: SCT_CalibDefectData.h:29
SCT_ReadCalibDataTool::isGood
virtual bool isGood(const IdentifierHash &) const override
same thing with id hash, introduced by shaun with dummy method for now
Definition: SCT_ReadCalibDataTool.h:54
SCT_ReadCalibDataTool::initialize
virtual StatusCode initialize() override
Gaudi initialiser.
Definition: SCT_ReadCalibDataTool.cxx:28
SCT_ReadCalibDataTool::isGood
virtual bool isGood(const IdentifierHash &hashId, const EventContext &) const override
Definition: SCT_ReadCalibDataTool.h:55
SCT_ReadCalibDataTool::m_condKeyInfo
SG::ReadCondHandleKey< SCT_AllGoodStripInfo > m_condKeyInfo
Definition: SCT_ReadCalibDataTool.h:72
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
SCT_ReadCalibDataTool::m_cabling
ToolHandle< ISCT_CablingTool > m_cabling
Definition: SCT_ReadCalibDataTool.h:81
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SCT_ReadCalibDataTool::getDetectorElement
const InDetDD::SiDetectorElement * getDetectorElement(const IdentifierHash &waferHash, const EventContext &ctx) const
Definition: SCT_ReadCalibDataTool.cxx:431
SCT_AllGoodStripInfo.h
SCT_ReadCalibDataTool::m_condKeyGain
SG::ReadCondHandleKey< SCT_CalibDefectData > m_condKeyGain
Definition: SCT_ReadCalibDataTool.h:70
ISCT_ReadCalibDataTool::CalibDefectType
Definition: ISCT_ReadCalibDataTool.h:33
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SCT_ReadCalibDataTool::getCondDataGain
const SCT_CalibDefectData * getCondDataGain(const EventContext &ctx) const
Definition: SCT_ReadCalibDataTool.cxx:407
SCT_CalibDefectData::CalibModuleDefects
Definition: SCT_CalibDefectData.h:32
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SiDetectorElementCollection.h
dq_defect_bulk_create_defects.defect
defect
Definition: dq_defect_bulk_create_defects.py:35
SG::ReadCondHandleKey< SCT_CalibDefectData >
SCT_ReadCalibDataTool::finalize
virtual StatusCode finalize() override
Gaudi finaliser.
Definition: SCT_ReadCalibDataTool.cxx:48
SCT_ReadCalibDataTool::defectsSummary
virtual SCT_CalibDefectData::CalibModuleDefects defectsSummary(const Identifier &moduleId, const std::string &scan, const EventContext &ctx) const override
Returns module summary of defect.
Definition: SCT_ReadCalibDataTool.cxx:279
h
scan
void scan(TDirectory *td=0, int depth=0)
Definition: listroot.cxx:440
SCT_WaferGoodStripInfo.h
header file for data object for good strip information of a wafer
SCT_ID
Definition: SCT_ID.h:68
SCT_ReadCalibDataTool
This class contains a Tool that reads SCT calibration data and makes it available to other algorithms...
Definition: SCT_ReadCalibDataTool.h:34
SCT_ReadCalibDataTool::defectList
virtual std::list< Identifier > defectList(const std::string &defect, const EventContext &ctx) const override
Returns module summary of defect.
Definition: SCT_ReadCalibDataTool.cxx:313
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SCT_ReadCalibDataTool::SCT_ReadCalibDataTool
SCT_ReadCalibDataTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: SCT_ReadCalibDataTool.cxx:22
SCT_ReadCalibDataTool::canReportAbout
virtual bool canReportAbout(InDetConditions::Hierarchy h) const override
Definition: SCT_ReadCalibDataTool.cxx:54
SCT_AllGoodStripInfo
std::array< SCT_WaferGoodStripInfo, SCT_ConditionsData::NUMBER_OF_WAFERS > SCT_AllGoodStripInfo
SCT_AllGoodStripInfo is std::array of SCT_WaferGoodStripInfo and is used in SCT_ReadCalibDataCondAlg ...
Definition: SCT_AllGoodStripInfo.h:28
ISCT_CablingTool.h
SCT_ReadCalibDataTool::defectType
virtual ISCT_ReadCalibDataTool::CalibDefectType defectType(const Identifier &stripId, const EventContext &ctx, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override
Return summary of defect type and values for a strip.
Definition: SCT_ReadCalibDataTool.cxx:164
SCT_ReadCalibDataTool::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: SCT_ReadCalibDataTool.h:73
SCT_ReadCalibDataTool::getCondDataNoise
const SCT_CalibDefectData * getCondDataNoise(const EventContext &ctx) const
Definition: SCT_ReadCalibDataTool.cxx:415
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
Identifier
Definition: IdentifierFieldParser.cxx:14