ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
InDetDD::ITk::PixelReadoutManager Class Referencefinal

#include <ITkPixelReadoutManager.h>

Inheritance diagram for InDetDD::ITk::PixelReadoutManager:
Collaboration diagram for InDetDD::ITk::PixelReadoutManager:

Public Member Functions

 PixelReadoutManager (const std::string &name, ISvcLocator *svc)
 
virtual StatusCode initialize () override final
 
virtual PixelModuleType getModuleType (Identifier id) const override final
 
virtual PixelDiodeType getDiodeType (Identifier id) const override final
 
virtual Identifier getPixelIdfromHash (IdentifierHash offlineIdHash, uint32_t FE, uint32_t row, uint32_t column) const override final
 
virtual Identifier getPixelId (Identifier offlineId, uint32_t FE, uint32_t row, uint32_t column) const override final
 
virtual uint32_t getFE (Identifier diodeId, Identifier offlineId) const override final
 
virtual uint32_t getColumn (Identifier diodeId, Identifier offlineId) const override final
 
virtual uint32_t getRow (Identifier diodeId, Identifier offlineId) const override final
 

Private Attributes

ServiceHandle< StoreGateSvcm_detStore {this, "DetectorStore", "DetectorStore"}
 
const PixelDetectorManagerm_detManager {}
 
const PixelIDm_idHelper {}
 
Gaudi::Property< std::string > m_detectorName {this, "DetectorName", "ITkPixel", "Pixel detector name"}
 
Gaudi::Property< std::string > m_pixelIDName {this, "PixelIDName", "PixelID", "Pixel ID name"}
 

Detailed Description

Definition at line 23 of file ITkPixelReadoutManager.h.

Constructor & Destructor Documentation

◆ PixelReadoutManager()

InDetDD::ITk::PixelReadoutManager::PixelReadoutManager ( const std::string &  name,
ISvcLocator *  svc 
)

Definition at line 16 of file ITkPixelReadoutManager.cxx.

18  : base_class(name, svc){
19  }

Member Function Documentation

◆ getColumn()

uint32_t InDetDD::ITk::PixelReadoutManager::getColumn ( Identifier  diodeId,
Identifier  offlineId 
) const
finaloverridevirtual

Definition at line 191 of file ITkPixelReadoutManager.cxx.

191  {
192  const SiDetectorElement *element = m_detManager->getDetectorElement(offlineId);
193  const PixelModuleDesign *p_design = static_cast<const PixelModuleDesign *>(&element->design());
194  if (p_design->getReadoutTechnology() != PixelReadoutTechnology::RD53) {
195  ATH_MSG_ERROR("Non-RD53 readout technologies not supported!");
196  return invalidColumn;
197  }
198  unsigned int columnsPerFE = p_design->columnsPerCircuit();
199  unsigned int eta_index = m_idHelper->eta_index(diodeId);
200  // ---------------------
201  // Convert eta index to column number
202  // ---------------------
203  unsigned int column{};
204  if (eta_index >= columnsPerFE) {
205  column = 2 * columnsPerFE - eta_index - 1;
206  } else {
207  column = eta_index;
208  }
209  // ---------------------
210  // Check output sanity
211  // ---------------------
212  if (column >= columnsPerFE) {
213  ATH_MSG_WARNING("Computed column number exceeds maximum value: col = " << column << " (max = " << columnsPerFE << ")");
214  ATH_MSG_INFO("diodeId = "<<diodeId<<", offlineId= "<<offlineId);
215  ATH_MSG_INFO("ModuleType: "<<PixelModuleTypeName(getModuleType(offlineId)));
216  ATH_MSG_INFO("DiodeType: "<<PixelDiodeTypeName(getDiodeType(offlineId)));
217  return invalidColumn;
218  }
219  return column;
220  }

◆ getDiodeType()

PixelDiodeType InDetDD::ITk::PixelReadoutManager::getDiodeType ( Identifier  id) const
finaloverridevirtual

Definition at line 53 of file ITkPixelReadoutManager.cxx.

53  {
54  const Identifier wafer_id = m_idHelper->wafer_id(id);
55  const SiDetectorElement *element = m_detManager->getDetectorElement(wafer_id);
56  const PixelModuleDesign *p_design = static_cast<const PixelModuleDesign *>(&element->design());
57  if (p_design->getReadoutTechnology() != PixelReadoutTechnology::RD53) {
58  ATH_MSG_ERROR("Non-RD53 readout technologies not supported!");
59  return PixelDiodeType::NONE;
60  }
61 
62  Identifier diodeId = id;
63  uint32_t col = getColumn(diodeId, wafer_id);
64  uint32_t row = getRow(diodeId, wafer_id);
65  if (col == invalidColumn or row == invalidRow){
66  return PixelDiodeType::NONE;
67  }
68  // ---------------------
69  // Get the pixel type
70  // ---------------------
71  unsigned int FEs = p_design->numberOfCircuits();
72  unsigned int rowsPerFE = p_design->rowsPerCircuit();
73  unsigned int columnsPerFE = p_design->columnsPerCircuit();
74 
75  if (FEs == 4) {
76  // long pixel row and columns
77  // 2 per row/column side
78  // TODO: avoid hardcoding this
79  if (row > rowsPerFE - 3 && col < columnsPerFE - 2) {
80  return PixelDiodeType::LONG;
81  }
82  if (col > columnsPerFE - 3 && row < rowsPerFE - 2) {
83  return PixelDiodeType::LONG;
84  }
85  // corner big pixels
86  if (row > rowsPerFE - 3 && col > columnsPerFE - 3) {
87  return PixelDiodeType::LARGE;
88  }
89  } else if (FEs != 1) {
90  ATH_MSG_WARNING("Module with a number of circuits which is not 1 or 4.");
91  ATH_MSG_WARNING("Long/pixel identification not implemented");
92  }
94  }

◆ getFE()

uint32_t InDetDD::ITk::PixelReadoutManager::getFE ( Identifier  diodeId,
Identifier  offlineId 
) const
finaloverridevirtual

Definition at line 153 of file ITkPixelReadoutManager.cxx.

153  {
154  const SiDetectorElement *element = m_detManager->getDetectorElement(offlineId);
155  const PixelModuleDesign *p_design = static_cast<const PixelModuleDesign *>(&element->design());
156  if (p_design->getReadoutTechnology() != PixelReadoutTechnology::RD53) {
157  ATH_MSG_WARNING("Non-RD53 readout technologies not supported!");
158  return invalidFrontEnd;
159  }
160  unsigned int FEsPerRow = p_design->numberOfCircuitsPerRow();
161  unsigned int rowsPerFE = p_design->rowsPerCircuit();
162  unsigned int columnsPerFE = p_design->columnsPerCircuit();
163  // ---------------------
164  // Set module properties
165  // ---------------------
166  unsigned int phi_index = m_idHelper->phi_index(diodeId);
167  unsigned int eta_index = m_idHelper->eta_index(diodeId);
168  PixelModuleType moduleType = getModuleType(offlineId);
169  if (moduleType == PixelModuleType::PIX_ENDCAP) {
170  // Swap phi_index for even endcap modules
171  int module_phi = m_idHelper->phi_module(offlineId);
172  if (module_phi % 2 == 0) {
173  phi_index = FEsPerRow * rowsPerFE - phi_index - 1;
174  }
175  }
176  // ---------------------
177  // Compute FE number
178  // ---------------------
179  // ITk has up to 4 FEs
180  unsigned int FErow = static_cast<unsigned int>(std::floor(phi_index / rowsPerFE));
181  unsigned int FEcol = static_cast<unsigned int>(std::floor(eta_index / columnsPerFE));
182  if (FErow > 0) {
183  return 2 + FEcol;
184  } else {
185  return FEcol;
186  }
187  }

◆ getModuleType()

PixelModuleType InDetDD::ITk::PixelReadoutManager::getModuleType ( Identifier  id) const
finaloverridevirtual

Definition at line 31 of file ITkPixelReadoutManager.cxx.

31  {
32  const Identifier wafer_id = m_idHelper->wafer_id(id);
33  const SiDetectorElement *element = m_detManager->getDetectorElement(wafer_id);
34  const PixelModuleDesign *p_design = static_cast<const PixelModuleDesign *>(&element->design());
35  if (p_design->getReadoutTechnology() != PixelReadoutTechnology::RD53) {
36  ATH_MSG_ERROR("Non-RD53 readout technologies not supported!");
37  return PixelModuleType::NONE;
38  }
39 
40  if (m_idHelper->barrel_ec(id) == 0) {
42  }
43 
44  if (std::abs(m_idHelper->barrel_ec(id)) == 2) {
46  }
47 
48  return PixelModuleType::NONE;
49  }

◆ getPixelId()

Identifier InDetDD::ITk::PixelReadoutManager::getPixelId ( Identifier  offlineId,
uint32_t  FE,
uint32_t  row,
uint32_t  column 
) const
finaloverridevirtual

Definition at line 104 of file ITkPixelReadoutManager.cxx.

104  {
105  const SiDetectorElement *element = m_detManager->getDetectorElement(offlineId);
106  const PixelModuleDesign *p_design = static_cast<const PixelModuleDesign *>(&element->design());
107  if (p_design->getReadoutTechnology() != PixelReadoutTechnology::RD53) {
108  ATH_MSG_ERROR("Non-RD53 readout technologies not supported!");
109  return {};// illegal Identifier, standardized for PixelRodDecoder
110  }
111  unsigned int FEs = p_design->numberOfCircuits();
112  unsigned int FEsPerRow = p_design->numberOfCircuitsPerRow();
113  unsigned int rowsPerFE = p_design->rowsPerCircuit();
114  unsigned int columnsPerFE = p_design->columnsPerCircuit();
115  // ---------------------
116  // Check input sanity
117  // ---------------------
118  if (row >= rowsPerFE || column >= columnsPerFE || FE >= FEs) {
119  ATH_MSG_DEBUG("Illegal pixel requested OfflineID: " << std::hex << offlineId << std::dec << " FE: " << FE << " row: " << row << " column: " << column);
120  ATH_MSG_DEBUG("Limits are: FE < " << FEs << ", row < " << rowsPerFE << ", column < " << columnsPerFE);
121  return {}; // illegal Identifier, standardized for PixelRodDecoder
122  }
123  // ---------------------
124  // Convert row/column to eta/phi indices
125  // ---------------------
126  unsigned int phi_index{}, eta_index{};
127  if (FE >= 2) {
128  phi_index = 2 * rowsPerFE - 1 - row;
129  } else {
130  phi_index = row;
131  }
132  if (FE % 2 == 1) {
133  eta_index = 2 * columnsPerFE - 1 - column;
134  } else {
135  eta_index = column;
136  }
137 
138  // Identify the module type
139  PixelModuleType moduleType = getModuleType(offlineId);
140  if (moduleType == PixelModuleType::PIX_ENDCAP) {
141  // Swap phi_index for even endcap modules
142  int module_phi = m_idHelper->phi_module(offlineId);
143  if (module_phi % 2 == 0) {
144  phi_index = FEsPerRow * rowsPerFE - phi_index - 1;
145  ATH_MSG_DEBUG("Even disk module found, phi module: " << module_phi << " swapped phi index to : " << phi_index);
146  }
147  }
148  return m_idHelper->pixel_id(offlineId, phi_index, eta_index);
149  }

◆ getPixelIdfromHash()

Identifier InDetDD::ITk::PixelReadoutManager::getPixelIdfromHash ( IdentifierHash  offlineIdHash,
uint32_t  FE,
uint32_t  row,
uint32_t  column 
) const
finaloverridevirtual

Definition at line 97 of file ITkPixelReadoutManager.cxx.

98  {
99  return getPixelId(m_idHelper->wafer_id(offlineIdHash), FE, row, column);
100  }

◆ getRow()

uint32_t InDetDD::ITk::PixelReadoutManager::getRow ( Identifier  diodeId,
Identifier  offlineId 
) const
finaloverridevirtual

Definition at line 224 of file ITkPixelReadoutManager.cxx.

224  {
225  const SiDetectorElement *element = m_detManager->getDetectorElement(offlineId);
226  const PixelModuleDesign *p_design = static_cast<const PixelModuleDesign *>(&element->design());
227  if (p_design->getReadoutTechnology() != PixelReadoutTechnology::RD53) {
228  ATH_MSG_WARNING("Non-RD53 readout technologies not supported!");
229  return invalidRow;
230  }
231  unsigned int FEsPerRow = p_design->numberOfCircuitsPerRow();
232  unsigned int rowsPerFE = p_design->rowsPerCircuit();
233  unsigned int phi_index = m_idHelper->phi_index(diodeId);
234  // Identify the module type
235  PixelModuleType moduleType = getModuleType(offlineId);
236  if (moduleType == PixelModuleType::PIX_ENDCAP) {
237  // Swap phi_index for even endcap modules
238  int module_phi = m_idHelper->phi_module(offlineId);
239  if (module_phi % 2 == 0) {
240  phi_index = FEsPerRow * rowsPerFE - phi_index - 1;
241  }
242  }
243  // ---------------------
244  // Convert phi index to row number
245  // ---------------------
246  unsigned int row{};
247  if (phi_index >= rowsPerFE) {
248  row = 2 * rowsPerFE - phi_index - 1;
249  } else {
250  row = phi_index;
251  }
252  // ---------------------
253  // Check output sanity
254  // ---------------------
255  if (row >= rowsPerFE) {
256  ATH_MSG_WARNING("Computed row number exceeds maximum value: row = " << row << "(max = " << rowsPerFE << ")");
257  return invalidRow;
258  }
259  return row;
260  }

◆ initialize()

StatusCode InDetDD::ITk::PixelReadoutManager::initialize ( )
finaloverridevirtual

Definition at line 22 of file ITkPixelReadoutManager.cxx.

22  {
23  ATH_MSG_DEBUG("ITkPixelReadoutManager::initialize()");
24  ATH_CHECK(m_detStore.retrieve());
25  ATH_CHECK(m_detStore->retrieve(m_detManager, m_detectorName.value()));
26  ATH_CHECK(m_detStore->retrieve(m_idHelper, m_pixelIDName.value()));
27  return StatusCode::SUCCESS;
28  }

Member Data Documentation

◆ m_detectorName

Gaudi::Property<std::string> InDetDD::ITk::PixelReadoutManager::m_detectorName {this, "DetectorName", "ITkPixel", "Pixel detector name"}
private

Definition at line 56 of file ITkPixelReadoutManager.h.

◆ m_detManager

const PixelDetectorManager* InDetDD::ITk::PixelReadoutManager::m_detManager {}
private

Definition at line 53 of file ITkPixelReadoutManager.h.

◆ m_detStore

ServiceHandle<StoreGateSvc> InDetDD::ITk::PixelReadoutManager::m_detStore {this, "DetectorStore", "DetectorStore"}
private

Definition at line 51 of file ITkPixelReadoutManager.h.

◆ m_idHelper

const PixelID* InDetDD::ITk::PixelReadoutManager::m_idHelper {}
private

Definition at line 54 of file ITkPixelReadoutManager.h.

◆ m_pixelIDName

Gaudi::Property<std::string> InDetDD::ITk::PixelReadoutManager::m_pixelIDName {this, "PixelIDName", "PixelID", "Pixel ID name"}
private

Definition at line 58 of file ITkPixelReadoutManager.h.


The documentation for this class was generated from the following files:
InDetDD::ITk::PixelReadoutManager::getPixelId
virtual Identifier getPixelId(Identifier offlineId, uint32_t FE, uint32_t row, uint32_t column) const override final
Definition: ITkPixelReadoutManager.cxx:104
query_example.row
row
Definition: query_example.py:24
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
InDetDD::invalidColumn
constexpr uint32_t invalidColumn
Definition: PixelReadoutDefinitions.h:43
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
InDetDD::invalidFrontEnd
constexpr uint32_t invalidFrontEnd
Definition: PixelReadoutDefinitions.h:44
InDetDD::PixelModuleTypeName
std::string PixelModuleTypeName(const PixelModuleType &t)
Definition: PixelReadoutDefinitions.cxx:10
InDetDD::ITk::PixelReadoutManager::getModuleType
virtual PixelModuleType getModuleType(Identifier id) const override final
Definition: ITkPixelReadoutManager.cxx:31
DeMoUpdate.column
dictionary column
Definition: DeMoUpdate.py:1110
InDetDD::ITk::PixelReadoutManager::m_idHelper
const PixelID * m_idHelper
Definition: ITkPixelReadoutManager.h:54
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:364
InDetDD::PixelReadoutTechnology::RD53
@ RD53
InDetDD::ITk::PixelReadoutManager::m_detManager
const PixelDetectorManager * m_detManager
Definition: ITkPixelReadoutManager.h:53
InDetDD::PixelModuleType::NONE
@ NONE
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDetDD::PixelDiodeType::LONG
@ LONG
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDetDD::ITk::PixelReadoutManager::m_detectorName
Gaudi::Property< std::string > m_detectorName
Definition: ITkPixelReadoutManager.h:57
InDetDD::ITk::PixelReadoutManager::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: ITkPixelReadoutManager.h:51
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
InDetDD::PixelDiodeType::LARGE
@ LARGE
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDetDD::PixelModuleType
PixelModuleType
Definition: PixelReadoutDefinitions.h:15
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
createCablingJSON.eta_index
int eta_index
Definition: createCablingJSON.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDetDD::ITk::PixelReadoutManager::getColumn
virtual uint32_t getColumn(Identifier diodeId, Identifier offlineId) const override final
Definition: ITkPixelReadoutManager.cxx:191
query_example.col
col
Definition: query_example.py:7
InDetDD::ITk::PixelReadoutManager::getRow
virtual uint32_t getRow(Identifier diodeId, Identifier offlineId) const override final
Definition: ITkPixelReadoutManager.cxx:224
InDetDD::invalidRow
constexpr uint32_t invalidRow
Definition: PixelReadoutDefinitions.h:42
InDetDD::ITk::PixelReadoutManager::getDiodeType
virtual PixelDiodeType getDiodeType(Identifier id) const override final
Definition: ITkPixelReadoutManager.cxx:53
InDetDD::PixelModuleType::PIX_ENDCAP
@ PIX_ENDCAP
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
InDetDD::PixelDiodeType::NONE
@ NONE
InDetDD::ITk::PixelReadoutManager::m_pixelIDName
Gaudi::Property< std::string > m_pixelIDName
Definition: ITkPixelReadoutManager.h:59
PixelID::pixel_id
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
Definition: PixelID.h:432
InDetDD::PixelDiodeType::NORMAL
@ NORMAL
InDetDD::PixelModuleType::PIX_BARREL
@ PIX_BARREL
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition: PixelID.h:644
InDetDD::PixelDiodeTypeName
std::string PixelDiodeTypeName(const PixelDiodeType &t)
Definition: PixelReadoutDefinitions.cxx:19
InDetDD::PixelDetectorManager::getDetectorElement
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier
Definition: PixelDetectorManager.cxx:80
Identifier
Definition: IdentifierFieldParser.cxx:14