ATLAS Offline Software
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
InDetDD Namespace Reference

Message Stream Member. More...

Namespaces

 detail
 
 HGTDDetEl
 
 ITk
 

Classes

class  AthenaComps
 Class to hold various Athena components. More...
 
class  BCM_Builder
 
class  BCMPrimeDetectorManager
 
class  BCMPrimeGmxInterface
 
class  BLM_Builder
 
class  DetectorDesign
 
class  DetectorFactoryBase
 
class  DistortedMaterialManager
 
class  ExtendedAlignableTransform
 
class  ExtraMaterial
 
class  GenericTubeMaker
 
class  HGTD_DetectorElement
 
class  HGTD_ModuleDesign
 
class  InDetDetectorManager
 
class  InDetServMatManager
 
class  IPixelReadoutManager
 
class  PairIndexMap
 Class to store map between pair of two ints and an int. More...
 
class  PconZone
 
class  PixelDetectorManager
 
class  PixelDiodeMap
 
class  PixelDiodeMatrix
 
class  PixelDiodeParametersProxy
 Helper class to cache a pixel diode position, and provide access to diode parameters. More...
 
class  PixelDiodeTree
 Tree structure to find the position, index or pitch of a pixel on a semi-regular grid The grid is considered regular if sub grids resulting from consecutive splits in local-x and local-y direction have identical pitch. More...
 
class  PixelModuleDesign
 
class  PixelMultipleConnection1D
 
class  PixelReadoutManager
 
class  PixelReadoutScheme
 
class  PLRGmxInterface
 
class  Point
 
class  Ray
 
class  SCT_BarrelModuleSideDesign
 
class  SCT_DetectorManager
 
class  SCT_ForwardFrameTransformation
 
class  SCT_ForwardModuleSideDesign
 
class  SCT_ForwardModuleSideGeometry
 
class  SCT_ForwardPolarPosition
 
class  SCT_ModuleSideDesign
 
class  SCT_ReadoutScheme
 
class  Segment
 
class  SegmentList
 
class  SegmentSplitter
 
class  ServiceVolume
 
class  ServiceVolumeMaker
 
class  ServiceVolumeMakerMgr
 
class  ServiceVolumeSchema
 
class  SiCellId
 
class  SiCommonItems
 
class  SiDetectorDesign
 
class  SiDetectorElement
 
class  SiDetectorElementCollection
 
class  SiDetectorManager
 
class  SiDiodesParameters
 
class  SiIntersect
 
class  SiLocalPosition
 
class  SiNumerology
 
class  SiReadoutCellId
 
class  SolidStateDetectorElementBase
 
class  StripAnnulusDesign
 
class  StripBoxDesign
 
class  StripStereoAnnulusDesign
 
class  SubDetectorFactoryBase
 
class  SurfaceCache
 
class  SurfaceCacheBase
 
class  TRT_BarrelCode
 
class  TRT_BarrelDescriptor
 
class  TRT_BarrelElement
 
class  TRT_BaseElement
 
class  TRT_Conditions
 
class  TRT_DetectorManager
 The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements which can be retrieved from the TRT_DetectorManager either via numerology or Identifier access. More...
 
class  TRT_DetElementCollection
 Class to hold collection of TRT detector elements. More...
 
class  TRT_DetElementContainer
 Class to hold different TRT detector elements structures. More...
 
class  TRT_EndcapCode
 
class  TRT_EndcapDescriptor
 class TRT_EndcapDescriptor More...
 
class  TRT_EndcapElement
 
class  TRT_Numerology
 
class  TubeVolData
 Helper class to read in generic TUBE, TUBS, CONS or PCON type volumes. More...
 
class  TubeZone
 
class  UnboundedZone
 
class  Version
 
class  VolumeBuilder
 
class  VolumeSplitter
 
class  Zone
 

Typedefs

using AttributeRefiner = std::function< std::tuple< PixelDiodeTree::AttributeType, PixelDiodeTree::AttributeType >(const std::array< PixelDiodeTree::IndexType, 2 > &, const PixelDiodeTree::Vector2D &, const std::array< bool, 4 > &, unsigned int, PixelDiodeTree::AttributeType, PixelDiodeTree::AttributeType)>
 
using HGTD_DetectorElementCollection = DataVector< HGTD_DetectorElement >
 
using GeoShapeHolder = GeoIntrusivePtr< const GeoShape >
 
using PhysVolPtr = VolumeBuilder::PhysVolPtr
 
typedef std::map< std::string, const void * > RawAlignmentObjects
 

Enumerations

enum  DetectorShape {
  Box =0, Trapezoid, Annulus, Other,
  PolarAnnulus
}
 
enum  DetectorType {
  Undefined =0, PixelBarrel, PixelEndcap, PixelInclined,
  StripBarrel, StripEndcap, BCMPrime, PLR,
  HGTD
}
 
enum  FrameType { local, global, other }
 
enum  CarrierType { holes, electrons }
 
enum  AlignFolderType { none = -1, static_run1 = 0, timedependent_run2 = 1 }
 
enum  PixelModuleType {
  PixelModuleType::NONE =-1, PixelModuleType::DBM, PixelModuleType::IBL_PLANAR, PixelModuleType::IBL_3D,
  PixelModuleType::PIX_BARREL, PixelModuleType::PIX_ENDCAP, PixelModuleType::N_PIXELMODULETYPES
}
 
enum  PixelDiodeType {
  PixelDiodeType::NONE =-1, PixelDiodeType::NORMAL, PixelDiodeType::LONG, PixelDiodeType::GANGED,
  PixelDiodeType::LARGE, PixelDiodeType::N_DIODETYPES
}
 
enum  PixelReadoutTechnology {
  PixelReadoutTechnology::NONE =-1, PixelReadoutTechnology::FEI3, PixelReadoutTechnology::FEI4, PixelReadoutTechnology::RD53,
  PixelReadoutTechnology::N_TECHNOLOGIES
}
 

Functions

PixelDiodeTree createPixelDiodeTree (const std::array< unsigned int, 2 > &chip_dim, const std::array< unsigned int, 2 > &chip_matrix_dim, const PixelDiodeTree::Vector2D &pitch, const std::array< std::array< unsigned int, 2 >, 2 > &edge_dim, const std::array< PixelDiodeTree::Vector2D, 2 > &edge_pitch, const std::array< std::array< unsigned int, 2 >, 2 > &dead_zone, const AttributeRefiner &func_compute_attribute, std::ostream *debug_out=nullptr)
 Create a pixel diode tree. More...
 
std::ostream & operator<< (std::ostream &os, const SiCellId &cellId)
 
SiLocalPosition operator+ (const SiLocalPosition &position1, const SiLocalPosition &position2)
 
SiLocalPosition operator* (const SiLocalPosition &position, const double factor)
 
SiLocalPosition operator* (const double factor, const SiLocalPosition &position)
 
SiLocalPosition operator/ (const SiLocalPosition &position, const double factor)
 
std::ostream & operator<< (std::ostream &os, const InDetDD::Point &point)
 
std::ostream & operator<< (std::ostream &os, const InDetDD::Ray &ray)
 
template<typename T >
constexpr std::size_t enum2uint (T n, std::string_view callingFunctionName="")
 Convert an enum class to size_t for use as an array index. More...
 
std::string PixelModuleTypeName (const PixelModuleType &t)
 
std::string PixelDiodeTypeName (const PixelDiodeType &t)
 
std::string PixelReadoutTechnologyName (const PixelReadoutTechnology &t)
 
void TRT_DetectorManager::addKey ATLAS_NOT_THREAD_SAFE (const std::string &key, int level)
 

Variables

constexpr uint32_t invalidRow = 0xFFFFFFFF
 
constexpr uint32_t invalidColumn = 0xFFFFFFFF
 
constexpr uint32_t invalidFrontEnd = 0xFFFFFFFF
 
const int FIRST_HIGHER_LEVEL = 1
 

Detailed Description

Message Stream Member.

Authors: John Alison (johnd.nosp@m.a@he.nosp@m.p.upe.nosp@m.nn.e.nosp@m.du)

Base class.

Helper class to make general tubes used mainly for services.

Takes as input a DB table which has the following columns Handles numberouse cases Simple tubes: Rmin2, Rmax2 <=0. Cones: Uses Rmin2 and Rmax2. Tube and cone sectors: Uses phi start and phi delta. If RadialDiv > 0 then simulates the CLHEP::radial dependence of tubes/cables going outward CLHEP::radially.

Date: 22 Aug 2008

Description: This algorithm loops over the Inner Detector elements and prints thier local frames to a text file (IDLocalFrames.txt)

Date: 22 Aug 2008

Description: This algorithm loops over the Inner Detector elements and prints thier global positions to a text file (IDgeometryTextFile.txt)

Typedef Documentation

◆ AttributeRefiner

Definition at line 39 of file PixelDiodeTreeBuilder.h.

◆ GeoShapeHolder

using InDetDD::GeoShapeHolder = typedef GeoIntrusivePtr<const GeoShape>

◆ HGTD_DetectorElementCollection

Definition at line 20 of file HGTD_DetectorElementCollection.h.

◆ PhysVolPtr

Definition at line 19 of file VolumeBuilder.cxx.

◆ RawAlignmentObjects

typedef std::map<std::string, const void*> InDetDD::RawAlignmentObjects

Definition at line 43 of file InDetDetectorManager.h.

Enumeration Type Documentation

◆ AlignFolderType

Enumerator
none 
static_run1 
timedependent_run2 

Definition at line 19 of file InDetDD_Defs.h.

19 {none = -1, static_run1 = 0, timedependent_run2 = 1};

◆ CarrierType

Enumerator
holes 
electrons 

Definition at line 17 of file InDetDD_Defs.h.

17 {holes, electrons};

◆ DetectorShape

Enumerator
Box 
Trapezoid 
Annulus 
Other 
PolarAnnulus 

Definition at line 41 of file DetectorDesign.h.

41  {
43 };

◆ DetectorType

Enumerator
Undefined 
PixelBarrel 
PixelEndcap 
PixelInclined 
StripBarrel 
StripEndcap 
BCMPrime 
PLR 
HGTD 

Definition at line 45 of file DetectorDesign.h.

◆ FrameType

Enumerator
local 
global 
other 

Definition at line 16 of file InDetDD_Defs.h.

16 {local, global, other};

◆ PixelDiodeType

Enumerator
NONE 
NORMAL 
LONG 
GANGED 
LARGE 
N_DIODETYPES 

Definition at line 28 of file PixelReadoutDefinitions.h.

28  {
29  NONE=-1,
30  NORMAL,
31  LONG,
32  GANGED,
33  LARGE,
35  };

◆ PixelModuleType

Enumerator
NONE 
DBM 
IBL_PLANAR 
IBL_3D 
PIX_BARREL 
PIX_ENDCAP 
N_PIXELMODULETYPES 

Definition at line 18 of file PixelReadoutDefinitions.h.

18  {
19  NONE =-1,
20  DBM,
21  IBL_PLANAR,
22  IBL_3D,
23  PIX_BARREL,
24  PIX_ENDCAP,
26  };

◆ PixelReadoutTechnology

Enumerator
NONE 
FEI3 
FEI4 
RD53 
N_TECHNOLOGIES 

Definition at line 37 of file PixelReadoutDefinitions.h.

37  {
38  NONE =-1,
39  FEI3,
40  FEI4,
41  RD53,
43  };

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

void TRT_DetectorManager::addKey InDetDD::ATLAS_NOT_THREAD_SAFE ( const std::string &  key,
int  level 
)

Definition at line 224 of file TRT_DetectorManager.cxx.

225  {
226  if(msgLvl(MSG::DEBUG))
227  msg(MSG::DEBUG) << "Registering alignmentCallback with key " << key << ", at level " << level
228  << endmsg;
229 
230  const DataHandle<AlignableTransform> transformCollection;
231  if (m_detStore->regFcn(&TRT_DetectorManager::alignmentCallback, this, transformCollection, key).isFailure()) {
232  ATH_MSG_ERROR("Cannot register callback with DetectorStore");
233  }
234  addKey(key, level, InDetDD::other);
235  }

◆ createPixelDiodeTree()

PixelDiodeTree InDetDD::createPixelDiodeTree ( const std::array< unsigned int, 2 > &  chip_dim,
const std::array< unsigned int, 2 > &  chip_matrix_dim,
const PixelDiodeTree::Vector2D pitch,
const std::array< std::array< unsigned int, 2 >, 2 > &  edge_dim,
const std::array< PixelDiodeTree::Vector2D, 2 > &  edge_pitch,
const std::array< std::array< unsigned int, 2 >, 2 > &  dead_zone,
const AttributeRefiner func_compute_attribute,
std::ostream *  debug_out = nullptr 
)

Create a pixel diode tree.

Parameters
chip_dimthe number of circuits in local-x (phi, row) and local-y (eta, column) direction.
chip_matrix_dimthe width of a matrix in number of pixels in local-x(phi, row) and local-y (eta, column) direction.
pitchthe pitch of regular pixels in local-x (phi, row) and local-y (eta, column) direction.
edge_dimthe width of the outer, and inner edge of the sub-matrix associated to one circuit.
edge_pitchthe pitch of diodes in the outer or inner edge of a sub-matrix in local-x and local-y direction.
dead_zonethe width of a "dead" zone at the the outside of an outer or inner edge in pixels.
func_compute_attributea functional to "compute" attributes to diodes and sub-matrices.
debug_outnullptr or a valid output stream to get debug output. Will create a diode tree to compute diode positions or indices from indices or positions and

Definition at line 224 of file PixelDiodeTreeBuilder.cxx.

231  {
232  // strategy :
233  // split the entire pixel matrix first by circuit, then by special pixel areas
234  // add new diodes for sub matrices only composed of a single diode type, where the
235  // diode type is defined by the area i.e. it is located on one of the outer edges of the full matrix,
236  // one of the inner edges i.e. areas "between" circuits, in the "dead" zone between circuits
237  // or on the regular matrix.
238  //
239  // 1) first split circuit arrays in roughly by half until all sub-matrices span only a single circuit
240  // 2) split sub-matrices until the sub matrix only contains pixel of an outer edge, inner edge
241  // or the "normal" pixels. Inner-edge sub-matrices are split further if there is a dead zone.
242  // @TODO split by circuit and edge type independently per axis, to reduce number of unused splits
243  // original pixel matrix (Run 1-Run 3)
244 
245  std::array<unsigned int,2> dim{};
247  // compute total width of diode matrix
248  for (unsigned int axis_i=0; axis_i<2; ++axis_i) {
249  dim[axis_i] = chip_dim[axis_i] * chip_matrix_dim[axis_i];
250  unsigned int n_inner_edges = chip_dim[axis_i]*2-2 ;
251  constexpr unsigned int n_outer_edges = 2;
252  width[axis_i] = ( ( chip_dim[axis_i]*chip_matrix_dim[axis_i]
253  - edge_dim[kInner][axis_i]*n_inner_edges
254  - edge_dim[kOuter][axis_i]*n_outer_edges ) * pitch[axis_i]
255  + edge_dim[kInner][axis_i]*edge_pitch[kInner][axis_i]*n_inner_edges
256  + edge_dim[kOuter][axis_i]*edge_pitch[kOuter][axis_i]*n_outer_edges);
257  }
258  PixelDiodeTree diode_tree(width);
259  std::unordered_map<unsigned int, DiodeInfo > diode_idx;
260 
261  std::array<std::string,SubMatrixData::kDeadZoneInner+1> edgeName {
262  std::string("Outer"),
263  std::string("Inner"),
264  std::string("Internal"),
265  std::string("DeadZoneOuter"),
266  std::string("DeadZoneInner")
267  };
268 
269 
270  std::vector< SubMatrixData > stack;
271  stack.emplace_back(width,dim, chip_dim);
272  while (!stack.empty()) {
273  SubMatrixData current_submatrix = std::move(stack.back());
274  const std::array<unsigned int,2 > &split_chip_dim = current_submatrix.m_chipDim;
275  stack.pop_back();
276 
277  std::array<PixelDiodeTree::Vector2D,2> split_width{current_submatrix.m_width,
278  PixelDiodeTree::Vector2D::Zero()}; // default for no splitting
279  std::array<unsigned int,2> split_idx{current_submatrix.m_idx[0]+current_submatrix.m_dim[0], //set split point to outside outermost cell
280  current_submatrix.m_idx[1]+current_submatrix.m_dim[1]};
281  std::array<std::array<unsigned int,2>,2 > new_chip_dim{ split_chip_dim, split_chip_dim};
282  unsigned int n_sub_matrices=0;
283 
284  if (debug_out) {
285  *debug_out << "Split : " << std::setw(4) << current_submatrix.m_idx[0] << ", " << std::setw(4) << current_submatrix.m_idx[1]
286  << " " << std::setw(4) << current_submatrix.m_dim[0] << " x " << std::setw(4) << current_submatrix.m_dim[1]
287  << " pos " << std::setw(6) << current_submatrix.m_pos[0] << " , " << std::setw(6) << current_submatrix.m_pos[1]
288  << " w " << std::setw(6) << current_submatrix.m_width[0] << " , " << std::setw(6) << current_submatrix.m_width[1]
289  << " chips " << current_submatrix.m_chipDim[0] << " x " << current_submatrix.m_chipDim[1]
290  << " edges: " << edgeName[current_submatrix.m_edgeType[0] ] << " | " << edgeName[current_submatrix.m_edgeType[1] ]
291  << " , " << edgeName[current_submatrix.m_edgeType[2] ] << " | " << edgeName[current_submatrix.m_edgeType[3] ]
292  << std::endl;
293  }
294 
295  // 1) split circuits until sub-matrix composed of a single circuit
296  for (unsigned int axis_i=0; axis_i<2; ++axis_i) {
297  if (current_submatrix.m_chipDim[axis_i]>1) {
298  n_sub_matrices+=2;
299  unsigned int odd = current_submatrix.m_chipDim[axis_i] & 1;
300  unsigned int axis_idx= current_submatrix.m_idx[axis_i];
301 
302  for (unsigned int part_i=0; part_i<2; ++part_i) {
303  unsigned n_chips = (current_submatrix.m_chipDim[axis_i] + odd)/2;
304  new_chip_dim[part_i][axis_i]=n_chips;
305  unsigned int n_outer_edges=(current_submatrix.m_edgeType[axis_i*2+part_i]==SubMatrixData::kOuter);
306  unsigned int n_inner_edges=n_chips*2-n_outer_edges;
307  split_idx[axis_i]=axis_idx;
308  split_width[part_i][axis_i] = ( n_chips*chip_matrix_dim[axis_i]
309  - edge_dim[kInner][axis_i]*n_inner_edges
310  - edge_dim[kOuter][axis_i]*n_outer_edges ) * pitch[axis_i]
311  + n_inner_edges*edge_dim[kInner][axis_i]*edge_pitch[kInner][axis_i]
312  + n_outer_edges*edge_dim[kOuter][axis_i]*edge_pitch[kOuter][axis_i];
313  axis_idx += n_chips * chip_matrix_dim[axis_i];
314  odd=0u;
315  }
316  }
317  }
318  std::array<bool,2> dead_zone_split{};
319  // composed of a single circuit split off special pixel edges, or split off dead zone
320  if (n_sub_matrices<=1) {
321  if (debug_out){
322  (*debug_out) << "Split circuit arrays into " << n_sub_matrices << " sub arrays." << std::endl;
323  }
324  n_sub_matrices=0;
325  for (unsigned int axis_i=0; axis_i<2; ++axis_i) {
326  // compute the dimension of the edges on both sides
327  std::array<unsigned int, 2> axis_edge_dim{0,0};
328  for (unsigned int side_i=0; side_i<2; ++side_i) {
329  new_chip_dim[side_i][axis_i]=0u;
330  if (current_submatrix.m_edgeType[axis_i*2+side_i]<SubMatrixData::kInternal) {
331  axis_edge_dim[side_i]=edge_dim[ kOuter + (current_submatrix.m_edgeType[axis_i*2+side_i]==SubMatrixData::kInner) ][axis_i];
332  }
333  }
334 
335  if (debug_out) {
336  (*debug_out) << "Split submatrix " << (axis_i == 0 ? "x: " : "y: ")
337  << edgeName[current_submatrix.m_edgeType[axis_i*2]]
338  << " | "
339  << edgeName[current_submatrix.m_edgeType[axis_i*2+1]]
340  << " -> " << axis_edge_dim[0] << " , " << axis_edge_dim[1]
341  << std::endl;
342  }
343  unsigned int axis_dim = std::min(current_submatrix.m_dim[axis_i],chip_matrix_dim[axis_i]);
344  split_idx[axis_i]=current_submatrix.m_idx[axis_i]+axis_dim;
345 
346  // loop over the two sides until one side has an edge or dead zone that can be split off
347  if (axis_edge_dim[0]+axis_edge_dim[1]>0 ) { // if either side has a margin tht needs to be split off
348  for (unsigned int side_i=0; side_i<2; ++side_i) {
349  split_width[side_i][axis_i]=0.;
350  if (axis_edge_dim[side_i] > 0 ) {
351  unsigned int inner_outer = kOuter + (current_submatrix.m_edgeType[axis_i*2+side_i]==SubMatrixData::kInner);
352  ++n_sub_matrices;
353  split_idx[axis_i]=current_submatrix.m_idx[axis_i];
354  if (side_i==0) {
355  split_idx[axis_i] += std::min(axis_edge_dim[side_i], current_submatrix.m_dim[axis_i]);
356  // if there is no split check whether the edge has a dead zone
357  if (split_idx[axis_i] == current_submatrix.m_idx[axis_i] + axis_dim
358  && axis_dim == edge_dim[inner_outer][axis_i]
359  && dead_zone[inner_outer][axis_i]>0u ) {
360  split_idx[axis_i] = current_submatrix.m_idx[axis_i] + dead_zone[inner_outer][axis_i];
361  split_width[side_i][axis_i]=dead_zone[inner_outer][axis_i]*edge_pitch[inner_outer][axis_i];
362  split_width[side_i^1][axis_i]=(edge_dim[inner_outer][axis_i] - dead_zone[inner_outer][axis_i])*edge_pitch[inner_outer][axis_i];
363  dead_zone_split[axis_i]=true;
364  break;
365  }
366  }
367  else {
368  split_idx[axis_i] += axis_dim - std::min(axis_edge_dim[side_i],current_submatrix.m_dim[axis_i]) ;
369  // if there is no split check whether the edge has a dead zone
370  if (split_idx[axis_i] == current_submatrix.m_idx[axis_i]
371  && axis_dim == axis_edge_dim[side_i]
372  && dead_zone[inner_outer][axis_i]>0u ) {
373  split_idx[axis_i] = current_submatrix.m_idx[axis_i] + current_submatrix.m_dim[axis_i] - dead_zone[inner_outer][axis_i];
374  split_width[side_i][axis_i]=dead_zone[inner_outer][axis_i]*edge_pitch[inner_outer][axis_i];
375  split_width[side_i^1][axis_i]=(edge_dim[inner_outer][axis_i] - dead_zone[inner_outer][axis_i])*edge_pitch[inner_outer][axis_i];
376  dead_zone_split[axis_i]=true;
377  break;
378  }
379  // lower side only
380  }
381  if (split_idx[axis_i]<current_submatrix.m_idx[axis_i]
382  || split_idx[axis_i]>current_submatrix.m_idx[axis_i]+current_submatrix.m_dim[axis_i]
383  || (current_submatrix.m_dim[axis_i] < edge_dim[kOuter][axis_i] && current_submatrix.m_dim[axis_i] < edge_dim[kInner][axis_i])
384  ) {
385  throw std::logic_error("invalid split index.");
386  }
387  split_width[side_i][axis_i]=axis_edge_dim[side_i] * edge_pitch[inner_outer][axis_i];
388  // only edges on side 0 here
389  unsigned int n_inner_edges = current_submatrix.m_edgeType[axis_i*2+(side_i^1)]==SubMatrixData::kInner;
390  unsigned int n_outer_edges = current_submatrix.m_edgeType[axis_i*2+(side_i^1)]==SubMatrixData::kOuter;
391  split_width[side_i^1][axis_i] = ( ( axis_dim
392  // edges on both sides here
393  - edge_dim[kInner][axis_i]*(n_inner_edges+current_submatrix.m_edgeType[axis_i*2+side_i]==SubMatrixData::kInner)
394  - edge_dim[kOuter][axis_i]*(n_outer_edges+current_submatrix.m_edgeType[axis_i*2+side_i]==SubMatrixData::kOuter))
395  * pitch[axis_i]
396  + edge_dim[kInner][axis_i]*edge_pitch[kInner][axis_i]*n_inner_edges
397  + edge_dim[kOuter][axis_i]*edge_pitch[kOuter][axis_i]*n_outer_edges);
398  break;
399  }
400  }
401  }
402  }
403  if (n_sub_matrices>0) {
404  if( (split_idx[0]>=current_submatrix.m_idx[0]+current_submatrix.m_dim[0] || split_idx[0]==current_submatrix.m_idx[0])
405  && (split_idx[1]>=current_submatrix.m_idx[1]+current_submatrix.m_dim[1] || split_idx[1]==current_submatrix.m_idx[1])) {
406  // nothing to split
407  n_sub_matrices=0;
408  }
409  }
410  }
411 
412  if (n_sub_matrices>0)
413  {
414  // split current matrix further into sub-matrices
415  if (debug_out) {
416  (*debug_out) << "Split : " << current_submatrix.m_idx[0] << " , " << current_submatrix.m_idx[1] << " " << current_submatrix.m_dim[0] << "x" << current_submatrix.m_dim[1]
417  << " split at " << split_idx[0] << ", " << split_idx[1]
418  << " " << (split_idx[0] - current_submatrix.m_idx[0]) << "|" << (current_submatrix.m_idx[0]+current_submatrix.m_dim[0]-split_idx[0])
419  << ", " << (split_idx[1] - current_submatrix.m_idx[1]) << "|" << (current_submatrix.m_idx[1]+current_submatrix.m_dim[1]-split_idx[1])
420  << " width " << split_width[0][0] << ", " << split_width[0][1] << "; " << split_width[1][0] << ", " << split_width[1][1]
421  << std::endl;
422  }
423  std::size_t stack_size=stack.size();
424  splitMatrix(current_submatrix,
425  split_idx,
426  split_width,
427  new_chip_dim,
428  dead_zone_split,
429  std::array<std::array<PixelDiodeTree::AttributeType, 2>,2> {std::array<PixelDiodeTree::AttributeType, 2>{SubMatrixData::s_defaultMatrixAttribute,
430  SubMatrixData::s_defaultMatrixAttribute},
431  std::array<PixelDiodeTree::AttributeType, 2>{SubMatrixData::s_defaultMatrixAttribute,
432  SubMatrixData::s_defaultMatrixAttribute}},
433  stack,
434  diode_tree,
435  debug_out,
436  &edgeName);
437  if (stack_size == stack.size()) {
438  // split surprisingly resulted in zero new sub-matrices. @TODO is this possible ? Should this be a logic error ?
439  n_sub_matrices=0;
440  }
441  }
442 
443  // if the current matrix was not split into further sub-matrices
444  // register and assign a diode for it.
445  if (n_sub_matrices==0) {
446 
447  // if the diode tree is still empty
448  // create a dummy split of which only the first area is used.
449  if (diode_tree.empty()) {
450  assert( stack.empty() ); // this can only happen if no matrix has been split yet, and then the stack must also be empty
451  assert( chip_dim[0]==1 && chip_dim[1]==1); // should only happen for single chip modules
452  assert( current_submatrix.m_subMatrixIdx==std::numeric_limits<unsigned int>::max());
453  current_submatrix.m_subMatrixIdx
454  = diode_tree.split( std::array<PixelDiodeTree::CellIndexType,2>{ static_cast< PixelDiodeTree::CellIndexType>(current_submatrix.m_dim[0]),
455  static_cast< PixelDiodeTree::CellIndexType>(current_submatrix.m_dim[1]) },
456  current_submatrix.m_pos+current_submatrix.m_width,
457  current_submatrix.m_attribute);
458  }
459 
460  // determine diode type by evaluating whether it is on an inner, or outer edge, a dead zone or just a normal pixel diode
462  PixelDiodeTree::AttributeType full_diode_type{};
463  for (unsigned int axis_i=0; axis_i<2; ++axis_i) {
464  // count inner and outer edges of the current sub matrix
465  unsigned int axis_inner_edges = ( (current_submatrix.m_edgeType[axis_i*2] == SubMatrixData::kInner)
466  + (current_submatrix.m_edgeType[axis_i*2+1] == SubMatrixData::kInner));
467  unsigned int axis_outer_edges = ( (current_submatrix.m_edgeType[axis_i*2] == SubMatrixData::kOuter)
468  + (current_submatrix.m_edgeType[axis_i*2+1] == SubMatrixData::kOuter));
469 
470  // set corresponding bit in diode type if sub-matrix has a non empty inner or outer edge
471  // in principle only one of the two should be true per axis
472  unsigned int diode_type = ((axis_inner_edges * edge_dim[kInner][axis_i]) > 0) << (kInner+1);
473  diode_type |= ((axis_outer_edges * edge_dim[kOuter][axis_i]) > 0) << (kOuter+1);
474  bool ganged=false;
475  unsigned int n = 0;
476  // special handling if this is an edge with a dead zone
477  // @TODO should distinguish inner or outer edges adjacent to dead zone from actual dead zones.
478  if ( current_submatrix.m_edgeType[axis_i*2]>SubMatrixData::kInternal
479  || current_submatrix.m_edgeType[axis_i*2+1]>SubMatrixData::kInternal) {
480  diode_type = ((current_submatrix.m_edgeType[axis_i*2]==SubMatrixData::kDeadZoneInner) << (kInner+1))
481  | ((current_submatrix.m_edgeType[axis_i*2+1]==SubMatrixData::kDeadZoneInner) << (kInner+1))
482  | ((current_submatrix.m_edgeType[axis_i*2]==SubMatrixData::kDeadZoneOuter) << (kOuter+1))
483  | ((current_submatrix.m_edgeType[axis_i*2+1]==SubMatrixData::kDeadZoneOuter) << (kOuter+1));
484  ganged=true;
485  }
486  else {
487  n = current_submatrix.m_dim[axis_i] - edge_dim[kOuter][axis_i] *axis_outer_edges - edge_dim[kInner][axis_i] * axis_inner_edges;
488  }
489  diode_type |= (n>0) << 0u;
490  if (debug_out) {
491  *debug_out << (axis_i==0 ? "x: " : "y:" )
492  << " outer " << axis_outer_edges << " * " << edge_dim[kOuter][axis_i] << " * " << edge_pitch[kOuter][axis_i]
493  << " inner " << axis_inner_edges << " * " << edge_dim[kInner][axis_i] << " * " << edge_pitch[kInner][axis_i]
494  << " normal " << n
495  << " -> " << diode_type
496  << std::endl;
497  }
498  // determine diode width depending on diode type
499  switch (diode_type) {
500  case (1u<<0):
501  diode_width[axis_i]=pitch[axis_i];
502  break;
503  case (1u<<(kOuter+1)):
504  diode_width[axis_i]=edge_pitch[kOuter][axis_i];
505  break;
506  case (1u<<(kInner+1)):
507  diode_width[axis_i]=edge_pitch[kInner][axis_i];
508  break;
509  default:
510  throw std::logic_error("Invalid diode type. Matrix not fully split.");
511  }
512 
513  // one byte per axis
514  full_diode_type<<=8;
515  diode_type|=ganged<<3u;
516  full_diode_type|=(diode_type&0xff);
517  }
518  // first two elements whether the diode is in a ganged area in one of the two directions
519  // second two elements whether
520  // if the diode is adjacent to an inner or outer edge it is in the dead zone if the diode is marked ganged.
521  std::array<bool,4> ganged_flags{ (static_cast<std::size_t>(full_diode_type) & (1u<<3u)) != 0u,
522  (static_cast<std::size_t>(full_diode_type) & (1u<<(3u+8u))) != 0u,
523  current_submatrix.m_edgeType[0]==SubMatrixData::kInner
524  || current_submatrix.m_edgeType[0+1]==SubMatrixData::kInner
525  || current_submatrix.m_edgeType[0]==SubMatrixData::kOuter
526  || current_submatrix.m_edgeType[0+1]==SubMatrixData::kOuter,
527  current_submatrix.m_edgeType[2]==SubMatrixData::kInner
528  || current_submatrix.m_edgeType[2+1]==SubMatrixData::kInner
529  || current_submatrix.m_edgeType[2]==SubMatrixData::kOuter
530  || current_submatrix.m_edgeType[2+1]==SubMatrixData::kOuter};
531  // cannot be in a dead-zone if the pixel is not marked ganged.
532  ganged_flags[2]=ganged_flags[2]&ganged_flags[0];
533  ganged_flags[3]=ganged_flags[3]&ganged_flags[1];
534 
535  PixelDiodeTree::AttributeType current_sub_matrix_attribute=diode_tree.attribute(current_submatrix.m_subMatrixIdx);
536  auto [new_sub_matrix_attribute, new_diode_attribute]
537  = func_compute_attribute(std::array<PixelDiodeTree::CellIndexType,2>{ static_cast<PixelDiodeTree::CellIndexType>(current_submatrix.m_idx[0]),
538  static_cast<PixelDiodeTree::CellIndexType>(current_submatrix.m_idx[1])},
539  diode_width,
540  ganged_flags,
541  current_submatrix.m_splitIdx,
542  current_sub_matrix_attribute,
543  full_diode_type);
544 
546  ret = diode_idx.insert( std::make_pair(full_diode_type, DiodeInfo(std::numeric_limits<unsigned int>::max(),new_diode_attribute)));
547  if (ret.second) {
548  unsigned int diode_idx = diode_tree.addDiode(diode_width,
549  new_diode_attribute);
551  ret.first->second.setIndex( diode_idx );
552  }
553  assert( ret.second || ret.first->second.attributeAgrees(new_diode_attribute) );
554  diode_tree.setAttribute(current_submatrix.m_subMatrixIdx, new_sub_matrix_attribute);
555  assert( current_sub_matrix_attribute==SubMatrixData::s_defaultMatrixAttribute
556  || current_sub_matrix_attribute==new_sub_matrix_attribute);
557 
558  diode_tree.setDiodeForSubMatrix(current_submatrix.m_subMatrixIdx, current_submatrix.m_splitIdx,ret.first->second.diodeIndex());
559  if (debug_out) {
560  (*debug_out) << "Created Diode "
561  << current_submatrix.m_idx[0] << ", " << current_submatrix.m_idx[1] << " "
562  << current_submatrix.m_dim[0] << " x " << current_submatrix.m_dim[1]
563  << " attr: " << new_sub_matrix_attribute
564  << " : diode_pitch " << diode_width[0] << ", " << diode_width[1]
565  << " sub-matrix index " << current_submatrix.m_subMatrixIdx
566  << " split index " << current_submatrix.m_splitIdx
567  << " -> " << -static_cast<PixelDiodeTree::IndexType>(ret.first->second.diodeIndex())
568  << " attribute " << full_diode_type << " -> " << new_diode_attribute
569  << std::endl;
570  }
571  }
572  }
573  if (diode_tree.cloneSingleSplitsToUnusedHalf()>0) {
574  throw std::logic_error("Some splits have invalid indices. That should not happen.");
575  }
576  // set the positions of the upper and lower corner of the matrix
577  diode_tree.computeMatrixCorner(PixelDiodeTree::makeCellIndex(dim[0],dim[1]));
578  return diode_tree;
579 }

◆ enum2uint()

template<typename T >
constexpr std::size_t InDetDD::enum2uint ( n,
std::string_view  callingFunctionName = "" 
)
constexpr

Convert an enum class to size_t for use as an array index.

Definition at line 51 of file PixelReadoutDefinitions.h.

51  {
52  if (n==T::NONE){
53  throw std::out_of_range(std::format("{} InDetDD::enum2uint: 'NONE' type is out of range for {}", callingFunctionName, typeid(T).name()));
54  }
55  return static_cast<size_t>(n);
56  }

◆ operator*() [1/2]

SiLocalPosition InDetDD::operator* ( const double  factor,
const SiLocalPosition position 
)
inline

Definition at line 186 of file SiLocalPosition.h.

187 {
188  return position*factor;
189 }

◆ operator*() [2/2]

SiLocalPosition InDetDD::operator* ( const SiLocalPosition position,
const double  factor 
)

Definition at line 98 of file SiLocalPosition.cxx.

99 {
100  SiLocalPosition result(position);
101  result*=factor;
102  return result;
103 }

◆ operator+()

SiLocalPosition InDetDD::operator+ ( const SiLocalPosition position1,
const SiLocalPosition position2 
)

Definition at line 90 of file SiLocalPosition.cxx.

92 {
93  SiLocalPosition result(position1);
94  result+=position2;
95  return result;
96 }

◆ operator/()

SiLocalPosition InDetDD::operator/ ( const SiLocalPosition position,
const double  factor 
)

Definition at line 105 of file SiLocalPosition.cxx.

106 {
107  SiLocalPosition result(position);
108  result/=factor;
109  return result;
110 }

◆ operator<<() [1/3]

std::ostream & InDetDD::operator<< ( std::ostream &  os,
const InDetDD::Point point 
)

Definition at line 423 of file VolumeSplitterUtils.cxx.

424  {
425  if (!point.valid()) {
426  os << "INVALID";
427  } else {
428  os << "(" << point.z() << ", " << point.r() << ")";
429  }
430  return os;
431  }

◆ operator<<() [2/3]

std::ostream & InDetDD::operator<< ( std::ostream &  os,
const InDetDD::Ray ray 
)

Definition at line 413 of file VolumeSplitterUtils.cxx.

414  {
415  if (!ray.valid()) {
416  os << "INVALID";
417  } else {
418  os << ray.start() << " --> " << ray.end();
419  }
420  return os;
421  }

◆ operator<<() [3/3]

std::ostream & InDetDD::operator<< ( std::ostream &  os,
const SiCellId cellId 
)

Definition at line 8 of file SiCellId.cxx.

9  {
10  if (cellId.isValid()){
11  return os << "[" << cellId.phiIndex() << "." << cellId.etaIndex() << "]";
12  } else {
13  return os << "[INVALID]";
14  }
15  }

◆ PixelDiodeTypeName()

std::string InDetDD::PixelDiodeTypeName ( const PixelDiodeType t)

Definition at line 19 of file PixelReadoutDefinitions.cxx.

19  {
20  if (t==PixelDiodeType::NONE) return "unknown";
21  static const std::array<std::string, enum2uint(PixelDiodeType::N_DIODETYPES)> PixelDiodeTypeNames{
22  "NORMAL", "LONG", "GANGED", "LARGE"
23  };
24  return PixelDiodeTypeNames[enum2uint(t)];
25  }

◆ PixelModuleTypeName()

std::string InDetDD::PixelModuleTypeName ( const PixelModuleType t)

Definition at line 10 of file PixelReadoutDefinitions.cxx.

10  {
11  if (t==PixelModuleType::NONE) return "unknown";
12  static const std::array<std::string, enum2uint(PixelModuleType::N_PIXELMODULETYPES)> PixelModuleTypeNames{
13  "DBM", "IBL_PLANAR", "IBL_3D", "PIX_BARREL", "PIX_ENDCAP"
14  };
15  return PixelModuleTypeNames[enum2uint(t)];
16  }

◆ PixelReadoutTechnologyName()

std::string InDetDD::PixelReadoutTechnologyName ( const PixelReadoutTechnology t)

Definition at line 28 of file PixelReadoutDefinitions.cxx.

28  {
29  if (t==PixelReadoutTechnology::NONE) return "unknown";
30  static const std::array<std::string, enum2uint(PixelReadoutTechnology::N_TECHNOLOGIES)> PixelReadoutTechnologyNames{
31  "FEI3", "FEI4", "RD53"
32  };
33  return PixelReadoutTechnologyNames[enum2uint(t)];
34  }

Variable Documentation

◆ FIRST_HIGHER_LEVEL

const int InDetDD::FIRST_HIGHER_LEVEL = 1

Definition at line 22 of file PixelDetectorManager.cxx.

◆ invalidColumn

constexpr uint32_t InDetDD::invalidColumn = 0xFFFFFFFF
constexpr

Definition at line 46 of file PixelReadoutDefinitions.h.

◆ invalidFrontEnd

constexpr uint32_t InDetDD::invalidFrontEnd = 0xFFFFFFFF
constexpr

Definition at line 47 of file PixelReadoutDefinitions.h.

◆ invalidRow

constexpr uint32_t InDetDD::invalidRow = 0xFFFFFFFF
constexpr

Definition at line 45 of file PixelReadoutDefinitions.h.

xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
NONE
@ NONE
Definition: sTGCenumeration.h:13
InDetDD::PixelReadoutTechnology::N_TECHNOLOGIES
@ N_TECHNOLOGIES
InDetDD::StripEndcap
@ StripEndcap
Definition: DetectorDesign.h:46
InDetDD::Point::valid
bool valid() const
Definition: VolumeSplitterUtils.h:24
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
get_generator_info.result
result
Definition: get_generator_info.py:21
InDetDD::PLR
@ PLR
Definition: DetectorDesign.h:46
InDetDD::Other
@ Other
Definition: DetectorDesign.h:42
vtune_athena.format
format
Definition: vtune_athena.py:14
InDetDD::PixelModuleType::DBM
@ DBM
InDetDD::timedependent_run2
@ timedependent_run2
Definition: InDetDD_Defs.h:19
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDetDD::holes
@ holes
Definition: InDetDD_Defs.h:17
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
InDetDD::Ray::end
const Point & end() const
Definition: VolumeSplitterUtils.h:50
InDetDD::PixelReadoutTechnology::FEI3
@ FEI3
InDetDD::static_run1
@ static_run1
Definition: InDetDD_Defs.h:19
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
InDetDD::global
@ global
Definition: InDetDD_Defs.h:16
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
InDetDD::PixelDiodeType::GANGED
@ GANGED
InDetDD::PixelModuleType::N_PIXELMODULETYPES
@ N_PIXELMODULETYPES
InDetDD::PixelInclined
@ PixelInclined
Definition: DetectorDesign.h:46
InDetDD::PixelEndcap
@ PixelEndcap
Definition: DetectorDesign.h:46
InDetDD::Point::z
double z() const
Definition: VolumeSplitterUtils.h:28
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
InDetDD::PixelDiodeType::N_DIODETYPES
@ N_DIODETYPES
InDetDD::PixelReadoutTechnology::RD53
@ RD53
ActsTrk::IndexType
std::uint32_t IndexType
Definition: Decoration.h:14
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HGTD
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
Definition: Clustering.h:28
InDetDD::PixelDiodeType::LONG
@ LONG
beamspotman.n
n
Definition: beamspotman.py:729
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
InDetDD::Annulus
@ Annulus
Definition: DetectorDesign.h:42
InDetDD::PolarAnnulus
@ PolarAnnulus
Definition: DetectorDesign.h:42
InDetDD::enum2uint
constexpr std::size_t enum2uint(T n, std::string_view callingFunctionName="")
Convert an enum class to size_t for use as an array index.
Definition: PixelReadoutDefinitions.h:51
InDetDD::none
@ none
Definition: InDetDD_Defs.h:19
Box
Acts::Volume::BoundingBox Box
Definition: ActsCaloTrackingVolumeBuilder.cxx:29
InDetDD::Ray::start
const Point & start() const
Definition: VolumeSplitterUtils.h:49
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
InDetDD::local
@ local
Definition: InDetDD_Defs.h:16
lumiFormat.array
array
Definition: lumiFormat.py:91
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
InDetDD::PixelBarrel
@ PixelBarrel
Definition: DetectorDesign.h:46
InDetDD::PixelReadoutTechnology::FEI4
@ FEI4
DataHandle
an iterator over instances of a given type in StoreGateSvc. It d-casts and caches locally the pointed...
Definition: DataHandle.h:43
InDetDD::BCMPrime
@ BCMPrime
Definition: DetectorDesign.h:46
InDetDD::PixelModuleType::IBL_PLANAR
@ IBL_PLANAR
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
InDetDD::PixelModuleType::PIX_ENDCAP
@ PIX_ENDCAP
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
DEBUG
#define DEBUG
Definition: page_access.h:11
InDetDD::Point::r
double r() const
Definition: VolumeSplitterUtils.h:29
LARGE
@ LARGE
Definition: sTGCenumeration.h:40
InDetDD::StripBarrel
@ StripBarrel
Definition: DetectorDesign.h:46
InDetDD::Undefined
@ Undefined
Definition: DetectorDesign.h:46
InDetDD::PixelDiodeType::NORMAL
@ NORMAL
InDetDD::PixelModuleType::PIX_BARREL
@ PIX_BARREL
InDetDD::Ray::valid
bool valid() const
Definition: VolumeSplitterUtils.h:51
InDetDD::PixelModuleType::IBL_3D
@ IBL_3D
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
InDetDD::Trapezoid
@ Trapezoid
Definition: DetectorDesign.h:42
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37