CMS 3D CMS Logo

Functions | Variables
ecalDccMap.h File Reference
#include <iostream>

Go to the source code of this file.

Functions

int abOfDcc (int iDCC)
 
int dccIndex (int iDet, int i, int j)
 
int dccIndexOfRU (int iDet, int i, int j)
 
int dccPhiIndex (int iDet, int i, int j)
 
int dccPhiIndexOfRU (int iDet, int i, int j)
 
template<class T >
T mod (const T &a, const T &b)
 

Variables

static const char endcapDccMap [401]
 

Function Documentation

◆ abOfDcc()

int abOfDcc ( int  iDCC)
inline

Definition at line 103 of file ecalDccMap.h.

103  {
104  if (iDCC < 0 || iDCC > 54)
105  return -1;
106  if (iDCC < 9) { //EE-
107  return iDCC / 3;
108  } else if (iDCC < 27) { //EB-
109  //an EB AB is made of 6 DCCs,
110  //first EB- AB is numbered 3
111  //and "1st" DCC of AB 3 is DCC 26
112  //(AB 3 made of DCCs 26,9,10,11,12,13):
113  return 3 + mod(iDCC - 26, 18) / 6;
114  } else if (iDCC < 45) { //EB+
115  //an EB AB is made of 6 DCCs,
116  //first EB+ AB is numbered 6
117  //and "1st" DCC of AB6 is DCC 44
118  //(AB 6 made of DCCs 44,27,28,29,30,31):
119  return 6 + mod(iDCC - 44, 18) / 6;
120  } else { //EE+
121  //AB numbering starts at DCC=45 and runs along phi in increasing phi
122  //first EE+ AB is numbered 9:
123  return 9 + (iDCC - 45) / 3;
124  }
125 }

References mod().

◆ dccIndex()

int dccIndex ( int  iDet,
int  i,
int  j 
)
inline

Gets the index of the DCC reading a crystal

Parameters
iDet0 for EE-, 1 for EB, 2 for EE+
iiEta or iX
jiPhi or iY
Returns
DCC index between 0 and 53

Definition at line 63 of file ecalDccMap.h.

63  {
64  if (iDet == 1) { //barrel
65  //a SM is 85 crystal long:
66  int iEtaSM = i / 85;
67  //a SM is 20 crystal wide:
68  int iPhiSM = (j + 10) / 20;
69  //DCC numbers start at 9 in the barrel and there 18 DCC/SM
70  return 9 + 18 * iEtaSM + iPhiSM;
71  }
72  int iPhi = dccPhiIndex(iDet, i, j);
73  if (iPhi < 0)
74  return -1;
75  //34 DCCs in barrel and 8 in EE-=>in EE+ DCC numbering starts at 45,
76  //iDet/2 is 0 for EE- and 1 for EE+:
77  return iPhi + iDet / 2 * 45;
78 }

References dccPhiIndex(), mps_fire::i, and dqmiolumiharvest::j.

◆ dccIndexOfRU()

int dccIndexOfRU ( int  iDet,
int  i,
int  j 
)
inline

Gets the index of the DCC reading a crystal

Parameters
iDet0 for EE-, 1 for EB, 2 for EE+
iiEta (staring at eta=-1.48) or iX
jiPhi or iY
Returns
DCC index between 0 and 53

Definition at line 86 of file ecalDccMap.h.

86  {
87  if (iDet == 1) { //barrel
88  //a SM is 17 RU long:
89  int iEtaSM = i / 17;
90  //a SM is 4 RU wide:
91  int iPhiSM = (j + 2) / 4;
92  //DCC numbers start at 9 in the barrel and there 18 DCC/SM
93  return 9 + 18 * iEtaSM + iPhiSM;
94  }
95  int iPhi = dccPhiIndexOfRU(iDet, i, j);
96  if (iPhi < 0)
97  return -1;
98  //34 DCCs in barrel and 8 in EE-=>in EE+ DCC numbering starts at 45,
99  //iDet/2 is 0 for EE- and 1 for EE+:
100  return iPhi + iDet / 2 * 45;
101 }

References dccPhiIndexOfRU(), mps_fire::i, and dqmiolumiharvest::j.

◆ dccPhiIndex()

int dccPhiIndex ( int  iDet,
int  i,
int  j 
)
inline

Gets the phi index of the DCC reading a crystal

Parameters
iDet0 for EE-, 1 for EB, 2 for EE+
iiEta or iX
jiPhi or iY
Returns
DCC phi index between 0 and 8 for EE and between 0 and 17 for EB

Definition at line 55 of file ecalDccMap.h.

55 { return dccPhiIndexOfRU(iDet, i / 5, j / 5); }

References dccPhiIndexOfRU(), mps_fire::i, and dqmiolumiharvest::j.

◆ dccPhiIndexOfRU()

int dccPhiIndexOfRU ( int  iDet,
int  i,
int  j 
)
inline

Gets the phi index of the DCC reading a RU (SC or TT)

Parameters
iDet0 for EE-, 1 for EB, 2 for EE+
iiEta or iX
jiPhi or iY
Returns
DCC phi index between 0 and 8 for EE and between 0 and 17 for EB

Definition at line 38 of file ecalDccMap.h.

38  {
39  if (iDet == 1) { //barrel
40  //iEta=i, iPhi=j
41  //phi edge of a SM is 4 TT
42  return (j + 2) / 4;
43  }
44  char flag = endcapDccMap[i + j * 20];
45  return (flag == ' ') ? -1 : (flag - '0');
46 }

References endcapDccMap, RemoveAddSevLevel::flag, mps_fire::i, and dqmiolumiharvest::j.

◆ mod()

template<class T >
T mod ( const T a,
const T b 
)

Definition at line 4 of file ecalDccMap.h.

4  {
5  T c = a % b;
6  return c < 0 ? c + b : c;
7 }

References a, b, and c.

Variable Documentation

◆ endcapDccMap

const char endcapDccMap[401]
static
Initial value:
= {
" 777777 "
" 666777777888 "
" 66667777778888 "
" 6666667777888888 "
" 666666677778888888 "
" 566666677778888880 "
" 555666667788888000 "
"55555566677888000000"
"555555566 880000000"
"55555555 00000000"
"55555554 10000000"
"554444444 111111100"
"44444444332211111111"
" 444444333222111111 "
" 444443333222211111 "
" 444433333222221111 "
" 4443333322222111 "
" 43333332222221 "
" 333333222222 "
" 333222 "}

Definition at line 9 of file ecalDccMap.h.

Referenced by dccPhiIndexOfRU().

mps_fire.i
i
Definition: mps_fire.py:428
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
dccPhiIndex
int dccPhiIndex(int iDet, int i, int j)
Definition: ecalDccMap.h:55
b
double b
Definition: hdecay.h:118
dccPhiIndexOfRU
int dccPhiIndexOfRU(int iDet, int i, int j)
Definition: ecalDccMap.h:38
a
double a
Definition: hdecay.h:119
T
long double T
Definition: Basic3DVectorLD.h:48
endcapDccMap
static const char endcapDccMap[401]
Definition: ecalDccMap.h:9
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117