ATLAS Offline Software
PixelRDOTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // PixelRDOTool.h
8 // (c) ATLAS Detector software
10 
11 #ifndef SICLUSTERIZATIONTOOL_PIXELRDOTOOL_H
12 #define SICLUSTERIZATIONTOOL_PIXELRDOTOOL_H
13 
14 //#include "GaudiKernel/AlgTool.h"
17 #include "GaudiKernel/ToolHandle.h"
22 
24 template <class T> class ServiceHandle;
25 
26 namespace InDetDD {
27  class PixelModuleDesign;
28 }
29 namespace InDet {
30 
31 class ClusterMakerTool;
32 
34  public:
35 
36  UnpackedPixelRDO(int ncl, int row, int col, int tot, int lvl1, Identifier id):
37  NCL(ncl), ROW(row), COL(col), TOT(tot), LVL1(lvl1), ID(id) {};
38 
39  int NCL;
40  int ROW;
41  int COL;
42  int TOT;
43  int LVL1;
45 };
46 
47 
48 class PixelRDOTool : public AthAlgTool
49 {
50 
51 public:
53  (const std::string& type,
54  const std::string& name,
55  const IInterface* parent);
56 
57  virtual ~PixelRDOTool() = default;
58  virtual StatusCode initialize();
59 
60  // Produces a vector of validated unpacked pixel RDOs
61  std::vector<UnpackedPixelRDO>
63  const PixelID& pixelID,
64  const InDetDD::SiDetectorElement* element,
65  const EventContext& ctx,
66  int defaultLabel = -1) const;
67 
68  // Determines if a pixel cell (whose identifier is the first argument) is
69  // a ganged pixel. If this is the case, the last argument assumes the
70  // value of the identifier of the cell it is ganged with.
71  // The second argument is the pixel module the hit belongs to.
72  static std::optional<Identifier>
73  isGanged(const Identifier& rdoID,
74  const InDetDD::SiDetectorElement* element);
75 
76  // Method to check if an RDO is duplicated.
77  // If it is, update lvl1 value.
78  bool checkDuplication(const PixelID& pixelID,
79  const Identifier& rdoID,
80  const int lvl1,
81  std::vector<UnpackedPixelRDO>& collectionID) const;
82 
83  const InDet::SiDetectorElementStatus* getPixelDetElStatus(const EventContext& ctx) const;
84 
85  // Check if we have a valid RDO collection. If so, return pointer
86  // to corresponding detector element.
89  const EventContext& ctx) const;
90 
91 
92 private:
93  // Same method to check for a pixel in a good state, but with less id look-ups
94  bool isGoodRDO(const InDet::SiDetectorElementStatus *pixelDetElStatus,
95  const IdentifierHash& moduleHash,
96  const InDetDD::PixelModuleDesign &pixel_design,
97  const Identifier& rdoID,
98  const EventContext& ctx,
99  const IInDetConditionsTool::IDCCacheEntry* cacheEntry) const;
100 
101  ToolHandle<IInDetConditionsTool> m_summaryTool {
102  this,
103  "PixelConditionsSummaryTool",
104  "PixelConditionsSummaryTool",
105  "Tool to retrieve Pixel Conditions summary"
106  };
107 
114  this,
115  "PixelDetElStatus",
116  "" ,
117  "Key of SiDetectorElementStatus for Pixel"
118  };
119 
120  const PixelID* m_pixelId = nullptr;
121 
122  BooleanProperty m_checkDuplicatedRDO {
123  this,
124  "CheckDuplicatedRDO",
125  false,
126  "Check duplicated RDOs using isDuplicated method"
127  };
128 
129  BooleanProperty m_printDuplicate {
130  this,
131  "PrintDuplicate",
132  true,
133  "Print duplicate RDO warning"
134  };
135 
136  BooleanProperty m_checkGanged {
137  this,
138  "CheckGanged",
139  true,
140  "Check for ganged pixels when unpacking the RDOs"
141  };
142 
143 
144  BooleanProperty m_useModuleMap {
145  this,
146  "UsePixelModuleMap",
147  true,
148  "Use bad modules map"
149  };
150 
151  BooleanProperty m_isITk {
152  this,
153  "isITk",
154  false,
155  "Toggle specific checks for ITk RDO data"
156  };
157 
159  this,
160  "PixelDetEleCollKey",
161  "PixelDetectorElementCollection",
162  "Key of SiDetectorElementCollection for Pixel"
163  };
164 
165 
166 };
167 
168 }
169 #endif // SICLUSTERIZATIONTOOL_PIXELRDOTOOL_H
InDet::PixelRDOTool::getPixelDetElStatus
const InDet::SiDetectorElementStatus * getPixelDetElStatus(const EventContext &ctx) const
Definition: PixelRDOTool.cxx:112
InDet::UnpackedPixelRDO::LVL1
int LVL1
Definition: PixelRDOTool.h:43
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
InDet::PixelRDOTool::initialize
virtual StatusCode initialize()
Definition: PixelRDOTool.cxx:29
InDet::PixelRDOTool::isGoodRDO
bool isGoodRDO(const InDet::SiDetectorElementStatus *pixelDetElStatus, const IdentifierHash &moduleHash, const InDetDD::PixelModuleDesign &pixel_design, const Identifier &rdoID, const EventContext &ctx, const IInDetConditionsTool::IDCCacheEntry *cacheEntry) const
Definition: PixelRDOTool.cxx:59
InDet::PixelRDOTool::m_checkGanged
BooleanProperty m_checkGanged
Definition: PixelRDOTool.h:136
IInDetConditionsTool.h
InDet::PixelRDOTool::m_pixelDetElStatus
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatus
Optional read handle to get status data to test whether a pixel detector element is good.
Definition: PixelRDOTool.h:113
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:45
SiDetectorElementStatus.h
InDet::PixelRDOTool::m_isITk
BooleanProperty m_isITk
Definition: PixelRDOTool.h:151
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
keylayer_zslicemap.row
row
Definition: keylayer_zslicemap.py:155
InDet::UnpackedPixelRDO::UnpackedPixelRDO
UnpackedPixelRDO(int ncl, int row, int col, int tot, int lvl1, Identifier id)
Definition: PixelRDOTool.h:36
InDet::PixelRDOTool::m_useModuleMap
BooleanProperty m_useModuleMap
Definition: PixelRDOTool.h:144
SG::ReadHandleKey< InDet::SiDetectorElementStatus >
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
InDet::PixelRDOTool::checkCollection
const InDetDD::SiDetectorElement * checkCollection(const InDetRawDataCollection< PixelRDORawData > &collection, const EventContext &ctx) const
Definition: PixelRDOTool.cxx:130
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
IPixelClusteringTool.h
InDet::PixelRDOTool::~PixelRDOTool
virtual ~PixelRDOTool()=default
InDet::UnpackedPixelRDO::TOT
int TOT
Definition: PixelRDOTool.h:42
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
InDet::PixelRDOTool
Definition: PixelRDOTool.h:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
InDet::PixelRDOTool::getUnpackedPixelRDOs
std::vector< UnpackedPixelRDO > getUnpackedPixelRDOs(const InDetRawDataCollection< PixelRDORawData > &collection, const PixelID &pixelID, const InDetDD::SiDetectorElement *element, const EventContext &ctx, int defaultLabel=-1) const
Definition: PixelRDOTool.cxx:173
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::PixelRDOTool::m_checkDuplicatedRDO
BooleanProperty m_checkDuplicatedRDO
Definition: PixelRDOTool.h:122
InDet::PixelRDOTool::PixelRDOTool
PixelRDOTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PixelRDOTool.cxx:22
PixelCalibrationConfig.tot
tot
Definition: PixelCalibrationConfig.py:28
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
InDet::UnpackedPixelRDO::ROW
int ROW
Definition: PixelRDOTool.h:40
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SiDetectorElementCollection.h
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
IInDetConditionsTool
Definition: IInDetConditionsTool.h:26
InDet::UnpackedPixelRDO
Definition: PixelRDOTool.h:33
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDet::UnpackedPixelRDO::NCL
int NCL
Definition: PixelRDOTool.h:37
InDet::UnpackedPixelRDO::COL
int COL
Definition: PixelRDOTool.h:41
InDet::UnpackedPixelRDO::ID
Identifier ID
Definition: PixelRDOTool.h:44
InDet::PixelRDOTool::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: PixelRDOTool.h:158
AthAlgTool
Definition: AthAlgTool.h:26
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
PixelID
Definition: PixelID.h:67
InDet::PixelRDOTool::checkDuplication
bool checkDuplication(const PixelID &pixelID, const Identifier &rdoID, const int lvl1, std::vector< UnpackedPixelRDO > &collectionID) const
Definition: PixelRDOTool.cxx:90
InDet::PixelRDOTool::m_printDuplicate
BooleanProperty m_printDuplicate
Definition: PixelRDOTool.h:129
InDet::PixelRDOTool::m_summaryTool
ToolHandle< IInDetConditionsTool > m_summaryTool
Definition: PixelRDOTool.h:101
InDet::PixelRDOTool::isGanged
static std::optional< Identifier > isGanged(const Identifier &rdoID, const InDetDD::SiDetectorElement *element)
Definition: PixelRDOTool.cxx:47
ServiceHandle
Definition: ClusterMakerTool.h:36
IInDetConditionsTool::IDCCacheEntry
Definition: IInDetConditionsTool.h:32
InDet::PixelRDOTool::m_pixelId
const PixelID * m_pixelId
Definition: PixelRDOTool.h:120
Identifier
Definition: IdentifierFieldParser.cxx:14