Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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"
23 
25 template <class T> class ServiceHandle;
26 
27 namespace InDet {
28 
29 class ClusterMakerTool;
30 
32  public:
33 
34  UnpackedPixelRDO(int ncl, int row, int col, int tot, int lvl1, Identifier id):
35  NCL(ncl), ROW(row), COL(col), TOT(tot), LVL1(lvl1), ID(id) {};
36 
37  int NCL;
38  int ROW;
39  int COL;
40  int TOT;
41  int LVL1;
43 };
44 
45 
46 class PixelRDOTool : public AthAlgTool
47 {
48 
49 public:
51  (const std::string& type,
52  const std::string& name,
53  const IInterface* parent);
54 
55  virtual ~PixelRDOTool() = default;
56  virtual StatusCode initialize();
57 
58  // Produces a vector of validated unpacked pixel RDOs
59  std::vector<UnpackedPixelRDO>
61  const PixelID& pixelID,
62  const InDetDD::SiDetectorElement* element,
63  const EventContext& ctx,
64  int defaultLabel = -1) const;
65 
66  // Determines if a pixel cell (whose identifier is the first argument) is
67  // a ganged pixel. If this is the case, the last argument assumes the
68  // value of the identifier of the cell it is ganged with.
69  // The second argument is the pixel module the hit belongs to.
70  static std::optional<Identifier>
71  isGanged(const Identifier& rdoID,
72  const InDetDD::SiDetectorElement* element);
73 
74  // Determines if a pixel cell is in a good state, either using
75  // the detector element status or the module-map-based summary tool
76  bool isGoodRDO(const InDet::SiDetectorElementStatus *pixelDetElStatus,
77  const IdentifierHash& moduleHash,
78  const Identifier& rdoID,
79  const EventContext& ctx,
80  const IInDetConditionsTool::IDCCacheEntry* cacheEntry) const;
81 
82  // Same method to check for a pixel in a good state, but with less id look-ups
83  bool isGoodRDO(const InDet::SiDetectorElementStatus *pixelDetElStatus,
84  const IdentifierHash& moduleHash,
85  const InDetDD::SiDetectorElement* element,
86  const Identifier& rdoID,
87  const EventContext& ctx,
88  const IInDetConditionsTool::IDCCacheEntry* cacheEntry) const;
89 
90  // Method to check if an RDO is duplicated.
91  // If it is, update lvl1 value.
92  bool checkDuplication(const PixelID& pixelID,
93  const Identifier& rdoID,
94  const int lvl1,
95  std::vector<UnpackedPixelRDO>& collectionID) const;
96 
97  const InDet::SiDetectorElementStatus* getPixelDetElStatus(const EventContext& ctx) const;
98 
99  // Check if we have a valid RDO collection. If so, return pointer
100  // to corresponding detector element.
103  const EventContext& ctx) const;
104 
105 
106 private:
107 
108  ToolHandle<IInDetConditionsTool> m_summaryTool {
109  this,
110  "PixelConditionsSummaryTool",
111  "PixelConditionsSummaryTool",
112  "Tool to retrieve Pixel Conditions summary"
113  };
114 
121  this,
122  "PixelDetElStatus",
123  "" ,
124  "Key of SiDetectorElementStatus for Pixel"
125  };
126 
128  this,
129  "PixelReadoutManager",
130  "PixelReadoutManager",
131  "Pixel readout manager"
132  };
133 
134  const PixelID* m_pixelId = nullptr;
135 
136  BooleanProperty m_checkDuplicatedRDO {
137  this,
138  "CheckDuplicatedRDO",
139  false,
140  "Check duplicated RDOs using isDuplicated method"
141  };
142 
143  BooleanProperty m_printDuplicate {
144  this,
145  "PrintDuplicate",
146  true,
147  "Print duplicate RDO warning"
148  };
149 
150  BooleanProperty m_checkGanged {
151  this,
152  "CheckGanged",
153  true,
154  "Check for ganged pixels when unpacking the RDOs"
155  };
156 
157 
158  BooleanProperty m_useModuleMap {
159  this,
160  "UsePixelModuleMap",
161  true,
162  "Use bad modules map"
163  };
164 
165  BooleanProperty m_isITk {
166  this,
167  "isITk",
168  false,
169  "Toggle specific checks for ITk RDO data"
170  };
171 
173  this,
174  "PixelDetEleCollKey",
175  "PixelDetectorElementCollection",
176  "Key of SiDetectorElementCollection for Pixel"
177  };
178 
179 
180 };
181 
182 }
183 #endif // SICLUSTERIZATIONTOOL_PIXELRDOTOOL_H
InDet::PixelRDOTool::getPixelDetElStatus
const InDet::SiDetectorElementStatus * getPixelDetElStatus(const EventContext &ctx) const
Definition: PixelRDOTool.cxx:135
InDet::UnpackedPixelRDO::LVL1
int LVL1
Definition: PixelRDOTool.h:41
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
query_example.row
row
Definition: query_example.py:24
InDet::PixelRDOTool::initialize
virtual StatusCode initialize()
Definition: PixelRDOTool.cxx:28
InDet::PixelRDOTool::m_checkGanged
BooleanProperty m_checkGanged
Definition: PixelRDOTool.h:150
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:120
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
SiDetectorElementStatus.h
InDet::PixelRDOTool::m_isITk
BooleanProperty m_isITk
Definition: PixelRDOTool.h:165
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::PixelRDOTool::isGoodRDO
bool isGoodRDO(const InDet::SiDetectorElementStatus *pixelDetElStatus, const IdentifierHash &moduleHash, const Identifier &rdoID, const EventContext &ctx, const IInDetConditionsTool::IDCCacheEntry *cacheEntry) const
Definition: PixelRDOTool.cxx:61
InDet::UnpackedPixelRDO::UnpackedPixelRDO
UnpackedPixelRDO(int ncl, int row, int col, int tot, int lvl1, Identifier id)
Definition: PixelRDOTool.h:34
InDet::PixelRDOTool::m_useModuleMap
BooleanProperty m_useModuleMap
Definition: PixelRDOTool.h:158
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:153
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
IPixelClusteringTool.h
InDet::PixelRDOTool::~PixelRDOTool
virtual ~PixelRDOTool()=default
InDet::UnpackedPixelRDO::TOT
int TOT
Definition: PixelRDOTool.h:40
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
InDet::PixelRDOTool
Definition: PixelRDOTool.h:47
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:196
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::PixelRDOTool::m_checkDuplicatedRDO
BooleanProperty m_checkDuplicatedRDO
Definition: PixelRDOTool.h:136
IPixelReadoutManager.h
InDet::PixelRDOTool::PixelRDOTool
PixelRDOTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PixelRDOTool.cxx:21
InDet::PixelRDOTool::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition: PixelRDOTool.h:127
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDet::UnpackedPixelRDO::ROW
int ROW
Definition: PixelRDOTool.h:38
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SiDetectorElementCollection.h
query_example.col
col
Definition: query_example.py:7
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
IInDetConditionsTool
Definition: IInDetConditionsTool.h:27
InDet::UnpackedPixelRDO
Definition: PixelRDOTool.h:31
InDet::UnpackedPixelRDO::NCL
int NCL
Definition: PixelRDOTool.h:35
InDet::UnpackedPixelRDO::COL
int COL
Definition: PixelRDOTool.h:39
InDet::UnpackedPixelRDO::ID
Identifier ID
Definition: PixelRDOTool.h:42
InDet::PixelRDOTool::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: PixelRDOTool.h:172
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:113
InDet::PixelRDOTool::m_printDuplicate
BooleanProperty m_printDuplicate
Definition: PixelRDOTool.h:143
InDet::PixelRDOTool::m_summaryTool
ToolHandle< IInDetConditionsTool > m_summaryTool
Definition: PixelRDOTool.h:108
InDet::PixelRDOTool::isGanged
static std::optional< Identifier > isGanged(const Identifier &rdoID, const InDetDD::SiDetectorElement *element)
Definition: PixelRDOTool.cxx:49
ServiceHandle
Definition: ClusterMakerTool.h:37
IInDetConditionsTool::IDCCacheEntry
Definition: IInDetConditionsTool.h:33
InDet::PixelRDOTool::m_pixelId
const PixelID * m_pixelId
Definition: PixelRDOTool.h:134
Identifier
Definition: IdentifierFieldParser.cxx:14