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