CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1RCTORCAMap Class Reference

#include <L1RCTORCAMap.h>

Public Member Functions

unsigned short combine (unsigned short et, unsigned short fg)
 
std::vector< unsigned short > combVec (const std::vector< unsigned short > &et, const std::vector< unsigned short > &fg)
 
std::vector< std::vector< std::vector< unsigned short > > > giveBarrel ()
 
std::vector< std::vector< unsigned short > > giveHF ()
 
 L1RCTORCAMap ()
 
void makeBarrelData ()
 
void makeHFData ()
 
std::vector< int > orcamap (int eta, int phi)
 
void readData (const std::vector< unsigned > &emet, const std::vector< unsigned > &hdet, const std::vector< bool > &emfg, const std::vector< bool > &hdfg, const std::vector< unsigned > &hfet)
 

Private Member Functions

std::vector< int > highEtaMap (int eta, int phi)
 
std::vector< int > lowEtaMap (int eta, int phi)
 

Private Attributes

std::vector< std::vector< std::vector< unsigned short > > > barrelData
 
std::vector< unsigned short > combEM
 
std::vector< unsigned short > combHD
 
std::vector< std::vector< unsigned short > > hfData
 
std::vector< unsigned short > rawEMET
 
std::vector< unsigned short > rawEMFG
 
std::vector< unsigned short > rawHDET
 
std::vector< unsigned short > rawHDFG
 
std::vector< unsigned short > rawHFET
 

Detailed Description

Definition at line 6 of file L1RCTORCAMap.h.

Constructor & Destructor Documentation

◆ L1RCTORCAMap()

L1RCTORCAMap::L1RCTORCAMap ( )

Definition at line 6 of file L1RCTORCAMap.cc.

6  {
7  rawEMET = std::vector<unsigned short>(56 * 72);
8  rawHDET = std::vector<unsigned short>(56 * 72);
9  rawEMFG = std::vector<unsigned short>(56 * 72);
10  rawHDFG = std::vector<unsigned short>(56 * 72);
11  rawHFET = std::vector<unsigned short>(8 * 18);
12  combEM = std::vector<unsigned short>(56 * 72);
13  combHD = std::vector<unsigned short>(56 * 72);
14 
15  barrelData = std::vector<std::vector<std::vector<unsigned short>>>(
16  18, std::vector<std::vector<unsigned short>>(7, std::vector<unsigned short>(64)));
17  hfData = std::vector<std::vector<unsigned short>>(18, std::vector<unsigned short>(8));
18 }

References barrelData, combEM, combHD, hfData, rawEMET, rawEMFG, rawHDET, rawHDFG, and rawHFET.

Member Function Documentation

◆ combine()

unsigned short L1RCTORCAMap::combine ( unsigned short  et,
unsigned short  fg 
)

Definition at line 64 of file L1RCTORCAMap.cc.

64  {
65  unsigned short newfg = fg << 8;
66  return newfg + et;
67 }

References EgHLTOffHistBins_cfi::et.

Referenced by combVec().

◆ combVec()

vector< unsigned short > L1RCTORCAMap::combVec ( const std::vector< unsigned short > &  et,
const std::vector< unsigned short > &  fg 
)

Definition at line 69 of file L1RCTORCAMap.cc.

70  {
71  std::vector<unsigned short> comb(56 * 72);
72  for (int i = 0; i < (int)et.size(); i++)
73  comb.at(i) = combine(et.at(i), fg.at(i));
74  return comb;
75 }

References bookConverter::comb, combine(), EgHLTOffHistBins_cfi::et, mps_fire::i, and createfilelist::int.

Referenced by readData().

◆ giveBarrel()

vector< std::vector< std::vector< unsigned short > > > L1RCTORCAMap::giveBarrel ( )

Definition at line 19 of file L1RCTORCAMap.cc.

19 { return barrelData; }

References barrelData.

◆ giveHF()

vector< std::vector< unsigned short > > L1RCTORCAMap::giveHF ( )

Definition at line 21 of file L1RCTORCAMap.cc.

21 { return hfData; }

References hfData.

◆ highEtaMap()

vector< int > L1RCTORCAMap::highEtaMap ( int  eta,
int  phi 
)
private

Definition at line 175 of file L1RCTORCAMap.cc.

175  {
176  int cardnum;
177  int towernum;
178  std::vector<int> returnVec(2);
179  if (eta < 8) {
180  if (phi < 4) {
181  cardnum = 0;
182  towernum = eta * 4 + phi;
183  } else {
184  cardnum = 1;
185  towernum = eta * 4 + (phi - 4);
186  }
187  } else if (eta < 16) {
188  if (phi < 4) {
189  cardnum = 2;
190  towernum = (eta - 8) * 4 + phi;
191  } else {
192  cardnum = 3;
193  towernum = (eta - 8) * 4 + (phi - 4);
194  }
195  } else if (eta < 24) {
196  if (phi < 4) {
197  cardnum = 4;
198  towernum = (eta - 16) * 4 + phi;
199  } else {
200  cardnum = 5;
201  towernum = (eta - 16) * 4 + (phi - 4);
202  }
203  } else {
204  cardnum = 6;
205  if (phi < 4)
206  towernum = (27 - eta) * 4 + phi;
207  else
208  towernum = (27 - eta) * 4 + phi + 12;
209  }
210 
211  returnVec.at(0) = cardnum;
212  returnVec.at(1) = towernum;
213  return returnVec;
214 }

References PVValHelper::eta, and phi.

Referenced by orcamap().

◆ lowEtaMap()

vector< int > L1RCTORCAMap::lowEtaMap ( int  eta,
int  phi 
)
private

Definition at line 116 of file L1RCTORCAMap.cc.

116  {
117  int cardnum = 0;
118  int towernum = 0;
119  std::vector<int> returnVec(2);
120  if (eta < 4) {
121  cardnum = 6;
122  if (phi < 4)
123  towernum = (3 - eta) * 4 + phi;
124  else
125  towernum = eta * 4 + phi + 12;
126  } else if (eta < 12) {
127  if (phi < 4) {
128  cardnum = 4;
129  if (eta < 8)
130  towernum = (7 - eta) * 4 + phi + 16;
131  else
132  towernum = (11 - eta) * 4 + phi;
133  } else {
134  cardnum = 5;
135  if (eta < 8)
136  towernum = (7 - eta) * 4 + (phi - 4) + 16;
137  else
138  towernum = (11 - eta) * 4 + (phi - 4);
139  }
140  } else if (eta < 20) {
141  if (phi < 4) {
142  cardnum = 2;
143  if (eta < 16)
144  towernum = (15 - eta) * 4 + phi + 16;
145  else
146  towernum = (19 - eta) * 4 + phi;
147  } else {
148  cardnum = 3;
149  if (eta < 16)
150  towernum = (15 - eta) * 4 + (phi - 4) + 16;
151  else
152  towernum = (19 - eta) * 4 + (phi - 4);
153  }
154  } else if (eta < 28) {
155  if (phi < 4) {
156  cardnum = 0;
157  if (eta < 24)
158  towernum = (23 - eta) * 4 + phi + 16;
159  else
160  towernum = (27 - eta) * 4 + phi;
161  } else {
162  cardnum = 1;
163  if (eta < 24)
164  towernum = (23 - eta) * 4 + (phi - 4) + 16;
165  else
166  towernum = (27 - eta) * 4 + (phi - 4);
167  }
168  }
169 
170  returnVec.at(0) = cardnum;
171  returnVec.at(1) = towernum;
172  return returnVec;
173 }

References PVValHelper::eta, and phi.

Referenced by orcamap().

◆ makeBarrelData()

void L1RCTORCAMap::makeBarrelData ( )

Definition at line 32 of file L1RCTORCAMap.cc.

32  {
33  std::vector<int> indices;
34  for (int phi = 0; phi < 72; phi++) {
35  for (int eta = 0; eta < 56; eta++) {
36  indices = orcamap(eta, phi);
37  (barrelData.at(indices.at(0))).at(indices.at(1)).at(indices.at(2)) = combEM.at(phi * 56 + eta);
38  (barrelData.at(indices.at(0))).at(indices.at(1)).at(indices.at(2) + 32) = combHD.at(phi * 56 + eta);
39  }
40  }
41 }

References barrelData, combEM, combHD, PVValHelper::eta, bTagCombinedSVVariables_cff::indices, orcamap(), and phi.

Referenced by readData().

◆ makeHFData()

void L1RCTORCAMap::makeHFData ( )

Definition at line 22 of file L1RCTORCAMap.cc.

22  {
23  std::vector<unsigned short> crate(16);
24  for (int i = 0; i < 9; i++) {
25  for (int j = 0; j < 16; j++) {
26  crate.at(j) = rawHFET.at(16 * i + j);
27  }
28  hfData.at(i) = crate;
29  }
30 }

References hfData, mps_fire::i, dqmiolumiharvest::j, and rawHFET.

Referenced by readData().

◆ orcamap()

vector< int > L1RCTORCAMap::orcamap ( int  eta,
int  phi 
)

Definition at line 77 of file L1RCTORCAMap.cc.

77  {
78  int crateNum(20);
79  std::vector<int> cardTower(2, 0);
80  std::vector<int> returnVec(3, 0);
81  int modEta = eta % 28;
82  int modPhi = phi % 8;
83  if (phi < 8)
84  crateNum = 0;
85  else if (phi < 16)
86  crateNum = 1;
87  else if (phi < 24)
88  crateNum = 2;
89  else if (phi < 32)
90  crateNum = 3;
91  else if (phi < 40)
92  crateNum = 4;
93  else if (phi < 48)
94  crateNum = 5;
95  else if (phi < 56)
96  crateNum = 6;
97  else if (phi < 64)
98  crateNum = 7;
99  else if (phi < 72)
100  crateNum = 8;
101 
102  if (eta < 28)
103  cardTower = lowEtaMap(modEta, modPhi);
104  else {
105  cardTower = highEtaMap(modEta, modPhi);
106  crateNum = crateNum + 9;
107  }
108 
109  returnVec.at(0) = crateNum;
110  for (int i = 0; i < 2; i++) {
111  returnVec.at(i + 1) = cardTower.at(i);
112  }
113  return returnVec;
114 }

References PVValHelper::eta, highEtaMap(), mps_fire::i, lowEtaMap(), and phi.

Referenced by makeBarrelData().

◆ readData()

void L1RCTORCAMap::readData ( const std::vector< unsigned > &  emet,
const std::vector< unsigned > &  hdet,
const std::vector< bool > &  emfg,
const std::vector< bool > &  hdfg,
const std::vector< unsigned > &  hfet 
)

Definition at line 43 of file L1RCTORCAMap.cc.

47  {
48  for (int i = 0; i < 4032; i++) {
49  rawEMET.at(i) = emet.at(i);
50  rawHDET.at(i) = hdet.at(i);
51  rawEMFG.at(i) = emfg.at(i);
52  rawHDFG.at(i) = hdfg.at(i);
53  }
54  for (int i = 0; i < 144; i++)
55  rawHFET.at(i) = hfet.at(i);
56 
59 
61  makeHFData();
62 }

References combEM, combHD, combVec(), mps_fire::i, makeBarrelData(), makeHFData(), rawEMET, rawEMFG, rawHDET, rawHDFG, and rawHFET.

Member Data Documentation

◆ barrelData

std::vector<std::vector<std::vector<unsigned short> > > L1RCTORCAMap::barrelData
private

Definition at line 28 of file L1RCTORCAMap.h.

Referenced by giveBarrel(), L1RCTORCAMap(), and makeBarrelData().

◆ combEM

std::vector<unsigned short> L1RCTORCAMap::combEM
private

Definition at line 44 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), makeBarrelData(), and readData().

◆ combHD

std::vector<unsigned short> L1RCTORCAMap::combHD
private

Definition at line 45 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), makeBarrelData(), and readData().

◆ hfData

std::vector<std::vector<unsigned short> > L1RCTORCAMap::hfData
private

Definition at line 29 of file L1RCTORCAMap.h.

Referenced by giveHF(), L1RCTORCAMap(), and makeHFData().

◆ rawEMET

std::vector<unsigned short> L1RCTORCAMap::rawEMET
private

Definition at line 39 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

◆ rawEMFG

std::vector<unsigned short> L1RCTORCAMap::rawEMFG
private

Definition at line 40 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

◆ rawHDET

std::vector<unsigned short> L1RCTORCAMap::rawHDET
private

Definition at line 41 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

◆ rawHDFG

std::vector<unsigned short> L1RCTORCAMap::rawHDFG
private

Definition at line 42 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

◆ rawHFET

std::vector<unsigned short> L1RCTORCAMap::rawHFET
private

Definition at line 43 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), makeHFData(), and readData().

bTagCombinedSVVariables_cff.indices
indices
Definition: bTagCombinedSVVariables_cff.py:67
bookConverter.comb
comb
Definition: bookConverter.py:145
mps_fire.i
i
Definition: mps_fire.py:355
L1RCTORCAMap::orcamap
std::vector< int > orcamap(int eta, int phi)
Definition: L1RCTORCAMap.cc:77
L1RCTORCAMap::combEM
std::vector< unsigned short > combEM
Definition: L1RCTORCAMap.h:44
L1RCTORCAMap::rawEMFG
std::vector< unsigned short > rawEMFG
Definition: L1RCTORCAMap.h:40
L1RCTORCAMap::makeBarrelData
void makeBarrelData()
Definition: L1RCTORCAMap.cc:32
L1RCTORCAMap::rawHFET
std::vector< unsigned short > rawHFET
Definition: L1RCTORCAMap.h:43
L1RCTORCAMap::rawHDET
std::vector< unsigned short > rawHDET
Definition: L1RCTORCAMap.h:41
L1RCTORCAMap::makeHFData
void makeHFData()
Definition: L1RCTORCAMap.cc:22
L1RCTORCAMap::combVec
std::vector< unsigned short > combVec(const std::vector< unsigned short > &et, const std::vector< unsigned short > &fg)
Definition: L1RCTORCAMap.cc:69
PVValHelper::eta
Definition: PVValidationHelpers.h:69
L1RCTORCAMap::barrelData
std::vector< std::vector< std::vector< unsigned short > > > barrelData
Definition: L1RCTORCAMap.h:28
createfilelist.int
int
Definition: createfilelist.py:10
L1RCTORCAMap::rawEMET
std::vector< unsigned short > rawEMET
Definition: L1RCTORCAMap.h:39
L1RCTORCAMap::highEtaMap
std::vector< int > highEtaMap(int eta, int phi)
Definition: L1RCTORCAMap.cc:175
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
L1RCTORCAMap::rawHDFG
std::vector< unsigned short > rawHDFG
Definition: L1RCTORCAMap.h:42
DDAxes::phi
L1RCTORCAMap::hfData
std::vector< std::vector< unsigned short > > hfData
Definition: L1RCTORCAMap.h:29
L1RCTORCAMap::combine
unsigned short combine(unsigned short et, unsigned short fg)
Definition: L1RCTORCAMap.cc:64
L1RCTORCAMap::combHD
std::vector< unsigned short > combHD
Definition: L1RCTORCAMap.h:45
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
L1RCTORCAMap::lowEtaMap
std::vector< int > lowEtaMap(int eta, int phi)
Definition: L1RCTORCAMap.cc:116