ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
InDetDD::detail::PixelDiodeTreeMaker< T_MsgParent > Struct Template Referencefinal

#include <PixelGeoUtils.h>

Inheritance diagram for InDetDD::detail::PixelDiodeTreeMaker< T_MsgParent >:
Collaboration diagram for InDetDD::detail::PixelDiodeTreeMaker< T_MsgParent >:

Public Member Functions

 PixelDiodeTreeMaker (T_MsgParent *msgParent)
 
virtual MsgStream & msg (const MSG::Level lvl) const override
 
virtual bool msgLvl (const MSG::Level lvl) const override
 
PixelDiodeTree make (InDetDD::PixelReadoutTechnology readoutTechnology, const std::array< int, kNDirections > &circuits, const std::array< int, kNDirections > &dimPerCircuit, const std::array< std::array< double, kNDirections >, kNPixelLocations > &pitch, FENumbering fe_numbering)
 

Public Attributes

T_MsgParent * m_msgParent
 

Detailed Description

template<class T_MsgParent>
struct InDetDD::detail::PixelDiodeTreeMaker< T_MsgParent >

Definition at line 45 of file PixelGeoUtils.h.

Constructor & Destructor Documentation

◆ PixelDiodeTreeMaker()

template<class T_MsgParent >
InDetDD::detail::PixelDiodeTreeMaker< T_MsgParent >::PixelDiodeTreeMaker ( T_MsgParent *  msgParent)
inline

Definition at line 47 of file PixelGeoUtils.h.

47 : m_msgParent(msgParent) {}

Member Function Documentation

◆ make()

PixelDiodeTree InDetDD::detail::PixelDiodeTreeMakerBase::make ( InDetDD::PixelReadoutTechnology  readoutTechnology,
const std::array< int, kNDirections > &  circuits,
const std::array< int, kNDirections > &  dimPerCircuit,
const std::array< std::array< double, kNDirections >, kNPixelLocations > &  pitch,
FENumbering  fe_numbering 
)
inherited

Definition at line 13 of file PixelGeoUtils.cxx.

17  {
18 
19  // helper function to associate correct diode type and front-end number to sub-matrices and diodes
20  // in the diode tree as attributes.
21  auto computeAttribute = [
22  &pitch=pitch[InDetDD::detail::kCentral],
23  &circuits,
24  &dimPerCircuit,
25  fe_numbering
26  ](const std::array<PixelDiodeTree::IndexType,2> &split_idx,
27  const PixelDiodeTree::Vector2D &diode_width,
28  [[maybe_unused]] const std::array<bool,4> &ganged,
29  [[maybe_unused]] unsigned int split_i,
30  PixelDiodeTree::AttributeType current_matrix_attribute,
31  PixelDiodeTree::AttributeType current_diode_attribute)
32  -> std::tuple<PixelDiodeTree::AttributeType,PixelDiodeTree::AttributeType>
33  {
34  // split_i defines which of the 4 areas the diode belongs to : 2 | 3 ^
35  // ----- | local-y (chip-columns)
36  // 0 | 1 |
37  // ---> local-x (chip-rows)
38  //
39  // split_idx the absolute index at which this sub-matrix is split into 4 sub-sub-matrices
40  // diode_width the diode pitch in both directions
41  // ganged ganged[0],ganged[1] whether the pixel diode is ganged in the corresponding direction
42  // ganged[2],ganged[3] whether the diode is inside (true) or outside the dead zone
43  // where ganged[2] denotes the flag in local-x and ganged[3] in local-y direction
44  // current_matrix_attribute the default attribute for the unsplit sub-matrix assigned by the builder
45  // current_diode_attribute the default attribute assigned to the current diode associated to the split
46  // area specified by split_i
47  // return new matrix attribute, new diode attribute
48 
49  // if the pixel is significantly wider in one direction consider the pixel to be long
50  // or if wider in both directions large
51  assert(split_idx[0]>=0 && split_idx[1]>=0);
52  std::array<int,2> chip_idx{split_idx[0]/dimPerCircuit[InDetDD::detail::kPhi], split_idx[1]/dimPerCircuit[InDetDD::detail::kEta]};
53 
54  unsigned int n_large_dimensions = ( (std::abs(diode_width[0]-pitch[InDetDD::detail::kPhi])>pitch[InDetDD::detail::kPhi]*.25)
55  +(std::abs(diode_width[1]-pitch[InDetDD::detail::kEta])>pitch[InDetDD::detail::kEta]*.25));
56  switch (n_large_dimensions) {
57  case 1:
59  break;
60  case 2:
62  break;
63  default:
65  }
66 
67  // FEI3 front-end numbering scheme
68  // if there is a single row just the chip-column (local-y, eta)
69  // if there are two rows: top row chip-column starting from the opposite end; bottom row: chip column + chips per top row
70  // ^ 0 |.. |n/2-1
71  // local-x | --------------- [swapped axis direction to fit into fewer lines]
72  // /phi/row | n-1 |... |n/2
73  // --> local-y (chip-column, eta)
74  current_matrix_attribute
75  = InDetDD::detail::makeAttributeType( chip_idx[0] > 0
76  ? circuits[InDetDD::detail::kEta] - chip_idx[1] - 1
77  : (circuits[InDetDD::detail::kPhi]-1) * circuits[InDetDD::detail::kEta] + chip_idx[1]);
78 
79  switch (fe_numbering) {
81  // for even phi Run <=3 endcap modules the numbering is mirrored
82  if (circuits[InDetDD::detail::kPhi] == 2) {
83  current_matrix_attribute = circuits[InDetDD::detail::kEta]- (current_matrix_attribute % circuits[InDetDD::detail::kEta]) -1
84  + ((current_matrix_attribute / circuits[InDetDD::detail::kEta]) ^ 1) * circuits[InDetDD::detail::kEta];
85  }
86  break;
87  }
88  default:
89  break;
90  }
91 
92  return std::make_tuple(current_matrix_attribute, current_diode_attribute);
93  };
94 
95  unsigned int nEtaLongEnd = pitch[InDetDD::detail::kOuterEdge][InDetDD::detail::kEta]>0. ? 1u : 0u;
96  unsigned int nEtaLong = pitch[InDetDD::detail::kInnerEdge][InDetDD::detail::kEta]>0. ? 1u : 0u;
97  PixelDiodeTree diode_tree
98  = createPixelDiodeTree(std::array<unsigned int,2>{static_cast<unsigned int>(circuits[InDetDD::detail::kPhi]),
99  static_cast<unsigned int>(circuits[InDetDD::detail::kEta])},
100  std::array<unsigned int,2>{static_cast<unsigned int>(dimPerCircuit[InDetDD::detail::kPhi]),
101  static_cast<unsigned int>(dimPerCircuit[InDetDD::detail::kEta])},
103  pitch[InDetDD::detail::kCentral][InDetDD::detail::kEta]}, // regular ptich
104  std::array<std::array<unsigned int,2>, 2>{ std::array<unsigned int,2>{0u,nEtaLongEnd}, // outer edge in pixels (correct?)
105  std::array<unsigned int,2>{0u,nEtaLong}}, // inner edge in pixels (correct?)
106  std::array<PixelDiodeTree::Vector2D,2>{PixelDiodeTree::Vector2D{0.,
110  },
111  std::array<std::array<unsigned int,2>, 2>{ std::array<unsigned int,2>{0u,0u}, // @TODO add dead zone for run1-3 pixels
112  std::array<unsigned int,2>{0u,0u} // @TODO add dead zone for run1-3 pixels
113  },
114  computeAttribute,
115  nullptr);
116  GEO_MSG_DEBUG( "module " << " " << circuits[InDetDD::detail::kPhi] << "x" << circuits[InDetDD::detail::kEta] << " "
117  << dimPerCircuit[InDetDD::detail::kPhi] << " " << dimPerCircuit[InDetDD::detail::kEta] << ":\n"
118  << " pitch: regular " << pitch[InDetDD::detail::kCentral][InDetDD::detail::kPhi]
120  << " long: " << pitch[InDetDD::detail::kInnerEdge][InDetDD::detail::kEta] << " end " << pitch[InDetDD::detail::kOuterEdge][InDetDD::detail::kEta] << ":\n"
121  << diode_tree.debugStringRepr());
122  return diode_tree;
123 }

◆ msg()

template<class T_MsgParent >
virtual MsgStream& InDetDD::detail::PixelDiodeTreeMaker< T_MsgParent >::msg ( const MSG::Level  lvl) const
inlineoverridevirtual

Implements InDetDD::detail::MessagingAdapter.

Definition at line 48 of file PixelGeoUtils.h.

48 { return m_msgParent->msg(lvl); }

◆ msgLvl()

template<class T_MsgParent >
virtual bool InDetDD::detail::PixelDiodeTreeMaker< T_MsgParent >::msgLvl ( const MSG::Level  lvl) const
inlineoverridevirtual

Implements InDetDD::detail::MessagingAdapter.

Definition at line 49 of file PixelGeoUtils.h.

49 { return m_msgParent ? m_msgParent->msgLvl(lvl) : false; }

Member Data Documentation

◆ m_msgParent

template<class T_MsgParent >
T_MsgParent* InDetDD::detail::PixelDiodeTreeMaker< T_MsgParent >::m_msgParent

Definition at line 46 of file PixelGeoUtils.h.


The documentation for this struct was generated from the following file:
InDetDD::detail::kOuterEdge
@ kOuterEdge
Definition: PixelGeoUtils.h:21
InDetDD::detail::kInnerEdge
@ kInnerEdge
Definition: PixelGeoUtils.h:21
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
InDetDD::PixelDiodeType::LONG
@ LONG
InDetDD::PixelDiodeTree::AttributeType
unsigned int AttributeType
Definition: PixelDiodeTree.h:39
InDetDD::PixelDiodeType::LARGE
@ LARGE
InDetDD::detail::PixelDiodeTreeMaker::m_msgParent
T_MsgParent * m_msgParent
Definition: PixelGeoUtils.h:46
InDetDD::detail::makeAttributeType
InDetDD::PixelDiodeTree::AttributeType makeAttributeType(T val)
convenience method to convert the given value into an attribute
Definition: PixelDiodeTreeBuilder.h:79
InDetDD::PixelDiodeTree::Vector2D
Amg::Vector2D Vector2D
Definition: PixelDiodeTree.h:35
InDetDD::detail::FENumbering::kMirror
@ kMirror
InDetDD::detail::kEta
@ kEta
Definition: PixelGeoUtils.h:22
InDetDD::detail::kCentral
@ kCentral
Definition: PixelGeoUtils.h:21
InDetDD::detail::kPhi
@ kPhi
Definition: PixelGeoUtils.h:22
InDetDD::PixelDiodeType::NORMAL
@ NORMAL
InDetDD::createPixelDiodeTree
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.
Definition: PixelDiodeTreeBuilder.cxx:224
GEO_MSG_DEBUG
#define GEO_MSG_DEBUG(body)
Definition: PixelGeoUtils.h:14