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"
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  // Method to check if an RDO is duplicated.
83  // If it is, update lvl1 value.
84  bool checkDuplication(const PixelID& pixelID,
85  const Identifier& rdoID,
86  const int lvl1,
87  std::vector<UnpackedPixelRDO>& collectionID) const;
88 
89  const InDet::SiDetectorElementStatus* getPixelDetElStatus(const EventContext& ctx) const;
90 
91  // Check if we have a valid RDO collection. If so, return pointer
92  // to corresponding detector element.
95  const EventContext& ctx) const;
96 
97 
98 private:
99 
100  ToolHandle<IInDetConditionsTool> m_summaryTool {
101  this,
102  "PixelConditionsSummaryTool",
103  "PixelConditionsSummaryTool",
104  "Tool to retrieve Pixel Conditions summary"
105  };
106 
113  this,
114  "PixelDetElStatus",
115  "" ,
116  "Key of SiDetectorElementStatus for Pixel"
117  };
118 
120  this,
121  "PixelReadoutManager",
122  "PixelReadoutManager",
123  "Pixel readout manager"
124  };
125 
126  const PixelID* m_pixelId = nullptr;
127 
128  BooleanProperty m_checkDuplicatedRDO {
129  this,
130  "CheckDuplicatedRDO",
131  false,
132  "Check duplicated RDOs using isDuplicated method"
133  };
134 
135  BooleanProperty m_printDuplicate {
136  this,
137  "PrintDuplicate",
138  true,
139  "Print duplicate RDO warning"
140  };
141 
142  BooleanProperty m_checkGanged {
143  this,
144  "CheckGanged",
145  true,
146  "Check for ganged pixels when unpacking the RDOs"
147  };
148 
149 
150  BooleanProperty m_useModuleMap {
151  this,
152  "UsePixelModuleMap",
153  true,
154  "Use bad modules map"
155  };
156 
158  this,
159  "PixelDetEleCollKey",
160  "PixelDetectorElementCollection",
161  "Key of SiDetectorElementCollection for Pixel"
162  };
163 
164 
165 };
166 
167 }
168 #endif // SICLUSTERIZATIONTOOL_PIXELRDOTOOL_H
InDet::PixelRDOTool::getPixelDetElStatus
const InDet::SiDetectorElementStatus * getPixelDetElStatus(const EventContext &ctx) const
Definition: PixelRDOTool.cxx:99
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:26
InDet::PixelRDOTool::m_checkGanged
BooleanProperty m_checkGanged
Definition: PixelRDOTool.h:142
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:112
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
SiDetectorElementStatus.h
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:60
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:150
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:117
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:160
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::PixelRDOTool::m_checkDuplicatedRDO
BooleanProperty m_checkDuplicatedRDO
Definition: PixelRDOTool.h:128
IPixelReadoutManager.h
InDet::PixelRDOTool::PixelRDOTool
PixelRDOTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PixelRDOTool.cxx:19
InDet::PixelRDOTool::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition: PixelRDOTool.h:119
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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:157
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:77
InDet::PixelRDOTool::m_printDuplicate
BooleanProperty m_printDuplicate
Definition: PixelRDOTool.h:135
InDet::PixelRDOTool::m_summaryTool
ToolHandle< IInDetConditionsTool > m_summaryTool
Definition: PixelRDOTool.h:100
InDet::PixelRDOTool::isGanged
static std::optional< Identifier > isGanged(const Identifier &rdoID, const InDetDD::SiDetectorElement *element)
Definition: PixelRDOTool.cxx:47
ServiceHandle
Definition: ClusterMakerTool.h:37
IInDetConditionsTool::IDCCacheEntry
Definition: IInDetConditionsTool.h:33
InDet::PixelRDOTool::m_pixelId
const PixelID * m_pixelId
Definition: PixelRDOTool.h:126
Identifier
Definition: IdentifierFieldParser.cxx:14