ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
InDetDD::PixelMultipleConnection1D Class Reference

#include <PixelMultipleConnection1D.h>

Collaboration diagram for InDetDD::PixelMultipleConnection1D:

Public Member Functions

 PixelMultipleConnection1D ()
 
 PixelMultipleConnection1D (const int lowerIndex, const std::vector< int > &connections)
 Constructor with parameters: lower diode index for which the connection scheme is given vector containing, for each diode, the readout cell number to which the corresponding diode is connected. More...
 
void set (const int lowerIndex, const std::vector< int > &connections)
 
bool outsideReadout (const int index) const
 Check if the readout cell is in the range; Also for index of gangedCell. More...
 
bool outsideDiode (const int cell) const
 Check if the diode is in the range: More...
 
int numberOfConnectedCells (const int index) const
 Return the number of diodes that are connected to this readout cell, Must check outsideReadout first. More...
 
int connectedCell (const int index, unsigned int number) const
 Return the diode index corresponding the this readout. More...
 
int readoutOfDiode (const int index) const
 Return readout cell id of this diode, Must check outsideDiode first. More...
 
int gangedCell (const int index) const
 If the diode is gnaged return the other diode. More...
 

Private Member Functions

void debugPrintout ()
 

Private Attributes

int m_lowerDiode
 lower diode index to which it applies More...
 
int m_upperDiode
 upper diode index to which it applies More...
 
int m_lowerReadout
 lower cell to which it applies More...
 
int m_upperReadout
 upper cell to which it applies More...
 
std::vector< std::vector< int > > m_readoutToDiode
 connection table readout -> diodes More...
 
std::vector< int > m_diodeToReadout
 connection table diode -> readout More...
 
std::vector< int > m_diodeGanged
 connection table diode -> other diode. More...
 

Detailed Description

Class used to handle connection of multiple diodes to the same readout cell

Author
: David Calvet
Note
: modifed by Grant Gorfine, Andreas Salzburger

Definition at line 27 of file PixelMultipleConnection1D.h.

Constructor & Destructor Documentation

◆ PixelMultipleConnection1D() [1/2]

InDetDD::PixelMultipleConnection1D::PixelMultipleConnection1D ( )

Definition at line 31 of file PixelMultipleConnection1D.cxx.

32  : m_lowerDiode(0),
33  m_upperDiode(-1),
34  m_lowerReadout(0),
35  m_upperReadout(-1)
36 {}

◆ PixelMultipleConnection1D() [2/2]

InDetDD::PixelMultipleConnection1D::PixelMultipleConnection1D ( const int  lowerIndex,
const std::vector< int > &  connections 
)

Constructor with parameters: lower diode index for which the connection scheme is given vector containing, for each diode, the readout cell number to which the corresponding diode is connected.

Definition at line 21 of file PixelMultipleConnection1D.cxx.

23  : m_lowerDiode(0),
24  m_upperDiode(-1),
25  m_lowerReadout(0),
26  m_upperReadout(-1)
27 {
28  set(lowerIndex, connections);
29 }

Member Function Documentation

◆ connectedCell()

int InDetDD::PixelMultipleConnection1D::connectedCell ( const int  index,
unsigned int  number 
) const
inline

Return the diode index corresponding the this readout.

number 0 will return the primary cell (ie diode index = readout cell index) Must check outsideReadout first.

Definition at line 111 of file PixelMultipleConnection1D.h.

112 {
114 }

◆ debugPrintout()

void InDetDD::PixelMultipleConnection1D::debugPrintout ( )
private

Definition at line 111 of file PixelMultipleConnection1D.cxx.

112 {
113  // Debug printout
114  std::cout << "m_lowerDiode = " << m_lowerDiode << std::endl;
115  std::cout << "m_upperDiode = " << m_upperDiode << std::endl;
116  std::cout << "m_lowerReadout = " << m_lowerReadout << std::endl;
117  std::cout << "m_upperReadout = " << m_upperReadout << std::endl;
118  std::cout << "m_readoutToDiode: ";
119  for (unsigned int i = 0; i < m_readoutToDiode.size(); i++) {
120  std::cout << "(" << m_lowerReadout + i << ": ";
121  for (int j : m_readoutToDiode[i]) {
122  std::cout << j << " ";
123  }
124  std::cout << ") ";
125  }
126  std::cout << std::endl;
127 
128  for (unsigned int i = 0; i < m_diodeToReadout.size(); i++) {
129  std::cout << "(" << m_lowerDiode + i << ": " << m_diodeToReadout[i] << ") ";
130  }
131  std::cout << std::endl;
132 
133  for (unsigned int i = 0; i < m_diodeGanged.size(); i++) {
134  std::cout << "(" << m_lowerReadout + i << ": " << m_diodeGanged[i] << ") ";
135  }
136  std::cout << std::endl;
137 }

◆ gangedCell()

int InDetDD::PixelMultipleConnection1D::gangedCell ( const int  index) const
inline

If the diode is gnaged return the other diode.

If the diode is not ganged return the same diode. Must check outsideReadout first.

Definition at line 121 of file PixelMultipleConnection1D.h.

122 {
124 }

◆ numberOfConnectedCells()

int InDetDD::PixelMultipleConnection1D::numberOfConnectedCells ( const int  index) const
inline

Return the number of diodes that are connected to this readout cell, Must check outsideReadout first.

Definition at line 106 of file PixelMultipleConnection1D.h.

107 {
108  return m_readoutToDiode[index - m_lowerReadout].size();
109 }

◆ outsideDiode()

bool InDetDD::PixelMultipleConnection1D::outsideDiode ( const int  cell) const
inline

Check if the diode is in the range:

Definition at line 100 of file PixelMultipleConnection1D.h.

101 {
102  return (diode<m_lowerDiode || diode>m_upperDiode);
103 }

◆ outsideReadout()

bool InDetDD::PixelMultipleConnection1D::outsideReadout ( const int  index) const
inline

Check if the readout cell is in the range; Also for index of gangedCell.

Definition at line 94 of file PixelMultipleConnection1D.h.

95 {
96  return (readout<m_lowerReadout || readout>m_upperReadout);
97 }

◆ readoutOfDiode()

int InDetDD::PixelMultipleConnection1D::readoutOfDiode ( const int  index) const
inline

Return readout cell id of this diode, Must check outsideDiode first.

Definition at line 116 of file PixelMultipleConnection1D.h.

117 {
119 }

◆ set()

void InDetDD::PixelMultipleConnection1D::set ( const int  lowerIndex,
const std::vector< int > &  connections 
)

Definition at line 39 of file PixelMultipleConnection1D.cxx.

41 {
42 
43  // extract lower and upper diode and readout cell numbers from connections vector
44  bool firstDiode = true;
45  bool firstReadout = true;
46  for(unsigned int index = 0; index < connections.size(); ++index) {
47  int readout = connections[index];
48  int diode = lowerIndex + index;
49  if (firstDiode && readout != diode) {
50  m_lowerDiode = diode;
51  m_upperDiode = diode;
52  firstDiode = false;
53  }
54  if (firstReadout) {
55  m_lowerReadout=readout;
56  m_upperReadout=readout;
57  firstReadout = false;
58  }
59  if (readout<m_lowerReadout) m_lowerReadout=readout;
60  if (readout>m_upperReadout) m_upperReadout=readout;
61  if (readout != diode && diode < m_lowerDiode) m_lowerDiode = diode;
62  if (readout != diode && diode > m_upperDiode) m_upperDiode = diode;
63  }
64 
65  // Fource readout range to be include diode range (this is generally already the case)
68 
71 
72  // First fill primary cell. ie diode and readout the same.
73  for(unsigned int index = 0; index < connections.size(); ++index) {
74  int readout = connections[index];
75  int diode = lowerIndex + index;
76  if (readout == diode) m_readoutToDiode[readout-m_lowerReadout].push_back(diode);
77  }
78 
79 
80  // Now the rest of readoutToDiode ie diode and readout not the same.
81  // Fill also diodeToReadout
82  for(unsigned int index = 0; index < connections.size(); ++index) {
83  int readout = connections[index];
84  int diode = lowerIndex + index;
85  if (readout != diode) m_readoutToDiode[readout - m_lowerReadout].push_back(diode);
86  if (diode >= m_lowerDiode && diode <= m_upperDiode) m_diodeToReadout[diode - m_lowerDiode] = readout;
87  }
88 
89  // Created ganged map. If the diode is ganged it points to the other diode.
91  for(int iDiode = m_lowerReadout; iDiode <= m_upperReadout; iDiode++) {
92  // Fill with the same index which indicates its not ganged.
93  m_diodeGanged[iDiode - m_lowerReadout] = iDiode;
94  int readout = iDiode;
95  if (!outsideDiode(iDiode)) readout = readoutOfDiode(iDiode);
96  if (numberOfConnectedCells(readout) >= 2) {
97  int cell0 = connectedCell(readout, 0);
98  int cell1 = connectedCell(readout, 1);
99  if (iDiode == cell0) {
100  m_diodeGanged[iDiode - m_lowerReadout] = cell1;
101  } else {
102  m_diodeGanged[iDiode - m_lowerReadout] = cell0;
103  }
104  }
105  }
106 
107  // For debugging only
108  //debugPrintout();
109 }

Member Data Documentation

◆ m_diodeGanged

std::vector<int> InDetDD::PixelMultipleConnection1D::m_diodeGanged
private

connection table diode -> other diode.

Definition at line 81 of file PixelMultipleConnection1D.h.

◆ m_diodeToReadout

std::vector<int> InDetDD::PixelMultipleConnection1D::m_diodeToReadout
private

connection table diode -> readout

Definition at line 80 of file PixelMultipleConnection1D.h.

◆ m_lowerDiode

int InDetDD::PixelMultipleConnection1D::m_lowerDiode
private

lower diode index to which it applies

Definition at line 75 of file PixelMultipleConnection1D.h.

◆ m_lowerReadout

int InDetDD::PixelMultipleConnection1D::m_lowerReadout
private

lower cell to which it applies

Definition at line 77 of file PixelMultipleConnection1D.h.

◆ m_readoutToDiode

std::vector< std::vector<int> > InDetDD::PixelMultipleConnection1D::m_readoutToDiode
private

connection table readout -> diodes

Definition at line 79 of file PixelMultipleConnection1D.h.

◆ m_upperDiode

int InDetDD::PixelMultipleConnection1D::m_upperDiode
private

upper diode index to which it applies

Definition at line 76 of file PixelMultipleConnection1D.h.

◆ m_upperReadout

int InDetDD::PixelMultipleConnection1D::m_upperReadout
private

upper cell to which it applies

Definition at line 78 of file PixelMultipleConnection1D.h.


The documentation for this class was generated from the following files:
InDetDD::PixelMultipleConnection1D::set
void set(const int lowerIndex, const std::vector< int > &connections)
Definition: PixelMultipleConnection1D.cxx:39
InDetDD::PixelMultipleConnection1D::m_diodeGanged
std::vector< int > m_diodeGanged
connection table diode -> other diode.
Definition: PixelMultipleConnection1D.h:81
index
Definition: index.py:1
InDetDD::PixelMultipleConnection1D::m_diodeToReadout
std::vector< int > m_diodeToReadout
connection table diode -> readout
Definition: PixelMultipleConnection1D.h:80
InDetDD::PixelMultipleConnection1D::m_lowerReadout
int m_lowerReadout
lower cell to which it applies
Definition: PixelMultipleConnection1D.h:77
InDetDD::PixelMultipleConnection1D::readoutOfDiode
int readoutOfDiode(const int index) const
Return readout cell id of this diode, Must check outsideDiode first.
Definition: PixelMultipleConnection1D.h:116
lumiFormat.i
int i
Definition: lumiFormat.py:92
InDetDD::PixelMultipleConnection1D::connectedCell
int connectedCell(const int index, unsigned int number) const
Return the diode index corresponding the this readout.
Definition: PixelMultipleConnection1D.h:111
python.selection.number
number
Definition: selection.py:20
InDetDD::PixelMultipleConnection1D::m_upperReadout
int m_upperReadout
upper cell to which it applies
Definition: PixelMultipleConnection1D.h:78
DeMoScan.index
string index
Definition: DeMoScan.py:362
InDetDD::PixelMultipleConnection1D::m_upperDiode
int m_upperDiode
upper diode index to which it applies
Definition: PixelMultipleConnection1D.h:76
InDetDD::PixelMultipleConnection1D::m_readoutToDiode
std::vector< std::vector< int > > m_readoutToDiode
connection table readout -> diodes
Definition: PixelMultipleConnection1D.h:79
InDetDD::PixelMultipleConnection1D::outsideDiode
bool outsideDiode(const int cell) const
Check if the diode is in the range:
Definition: PixelMultipleConnection1D.h:100
InDetDD::PixelMultipleConnection1D::m_lowerDiode
int m_lowerDiode
lower diode index to which it applies
Definition: PixelMultipleConnection1D.h:75
InDetDD::PixelMultipleConnection1D::numberOfConnectedCells
int numberOfConnectedCells(const int index) const
Return the number of diodes that are connected to this readout cell, Must check outsideReadout first.
Definition: PixelMultipleConnection1D.h:106