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 ( )

Definition at line 6 of file L1RCTORCAMap.cc.

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

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>>(
17  7, std::vector<unsigned short>(64)));
18  hfData = std::vector<std::vector<unsigned short>>(
19  18, std::vector<unsigned short>(8));
20 }
std::vector< std::vector< std::vector< unsigned short > > > barrelData
Definition: L1RCTORCAMap.h:29
std::vector< unsigned short > combHD
Definition: L1RCTORCAMap.h:46
std::vector< unsigned short > rawHDFG
Definition: L1RCTORCAMap.h:43
std::vector< std::vector< unsigned short > > hfData
Definition: L1RCTORCAMap.h:30
std::vector< unsigned short > combEM
Definition: L1RCTORCAMap.h:45
std::vector< unsigned short > rawEMFG
Definition: L1RCTORCAMap.h:41
std::vector< unsigned short > rawHFET
Definition: L1RCTORCAMap.h:44
std::vector< unsigned short > rawEMET
Definition: L1RCTORCAMap.h:40
std::vector< unsigned short > rawHDET
Definition: L1RCTORCAMap.h:42

Member Function Documentation

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

Definition at line 70 of file L1RCTORCAMap.cc.

References stringResolutionProvider_cfi::et.

Referenced by combVec().

70  {
71  unsigned short newfg = fg << 8;
72  return newfg + et;
73 }
et
define resolution functions of each parameter
vector< unsigned short > L1RCTORCAMap::combVec ( const std::vector< unsigned short > &  et,
const std::vector< unsigned short > &  fg 
)

Definition at line 76 of file L1RCTORCAMap.cc.

References combine(), mps_fire::i, and createfilelist::int.

Referenced by readData().

77  {
78  std::vector<unsigned short> comb(56 * 72);
79  for (int i = 0; i < (int)et.size(); i++)
80  comb.at(i) = combine(et.at(i), fg.at(i));
81  return comb;
82 }
unsigned short combine(unsigned short et, unsigned short fg)
Definition: L1RCTORCAMap.cc:70
et
define resolution functions of each parameter
vector< std::vector< std::vector< unsigned short > > > L1RCTORCAMap::giveBarrel ( )

Definition at line 21 of file L1RCTORCAMap.cc.

References barrelData.

21  {
22  return barrelData;
23 }
std::vector< std::vector< std::vector< unsigned short > > > barrelData
Definition: L1RCTORCAMap.h:29
vector< std::vector< unsigned short > > L1RCTORCAMap::giveHF ( )

Definition at line 25 of file L1RCTORCAMap.cc.

References hfData.

25 { return hfData; }
std::vector< std::vector< unsigned short > > hfData
Definition: L1RCTORCAMap.h:30
vector< int > L1RCTORCAMap::highEtaMap ( int  eta,
int  phi 
)
private

Definition at line 182 of file L1RCTORCAMap.cc.

References PVValHelper::eta, and phi.

Referenced by orcamap().

182  {
183  int cardnum;
184  int towernum;
185  std::vector<int> returnVec(2);
186  if (eta < 8) {
187  if (phi < 4) {
188  cardnum = 0;
189  towernum = eta * 4 + phi;
190  } else {
191  cardnum = 1;
192  towernum = eta * 4 + (phi - 4);
193  }
194  } else if (eta < 16) {
195  if (phi < 4) {
196  cardnum = 2;
197  towernum = (eta - 8) * 4 + phi;
198  } else {
199  cardnum = 3;
200  towernum = (eta - 8) * 4 + (phi - 4);
201  }
202  } else if (eta < 24) {
203  if (phi < 4) {
204  cardnum = 4;
205  towernum = (eta - 16) * 4 + phi;
206  } else {
207  cardnum = 5;
208  towernum = (eta - 16) * 4 + (phi - 4);
209  }
210  } else {
211  cardnum = 6;
212  if (phi < 4)
213  towernum = (27 - eta) * 4 + phi;
214  else
215  towernum = (27 - eta) * 4 + phi + 12;
216  }
217 
218  returnVec.at(0) = cardnum;
219  returnVec.at(1) = towernum;
220  return returnVec;
221 }
vector< int > L1RCTORCAMap::lowEtaMap ( int  eta,
int  phi 
)
private

Definition at line 123 of file L1RCTORCAMap.cc.

References PVValHelper::eta.

Referenced by orcamap().

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

Definition at line 36 of file L1RCTORCAMap.cc.

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

Referenced by readData().

36  {
37  std::vector<int> indices;
38  for (int phi = 0; phi < 72; phi++) {
39  for (int eta = 0; eta < 56; eta++) {
40  indices = orcamap(eta, phi);
41  (barrelData.at(indices.at(0))).at(indices.at(1)).at(indices.at(2)) =
42  combEM.at(phi * 56 + eta);
43  (barrelData.at(indices.at(0))).at(indices.at(1)).at(indices.at(2) + 32) =
44  combHD.at(phi * 56 + eta);
45  }
46  }
47 }
std::vector< std::vector< std::vector< unsigned short > > > barrelData
Definition: L1RCTORCAMap.h:29
std::vector< unsigned short > combHD
Definition: L1RCTORCAMap.h:46
std::vector< int > orcamap(int eta, int phi)
Definition: L1RCTORCAMap.cc:84
std::vector< unsigned short > combEM
Definition: L1RCTORCAMap.h:45
void L1RCTORCAMap::makeHFData ( )

Definition at line 26 of file L1RCTORCAMap.cc.

References hfData, mps_fire::i, and rawHFET.

Referenced by readData().

26  {
27  std::vector<unsigned short> crate(16);
28  for (int i = 0; i < 9; i++) {
29  for (int j = 0; j < 16; j++) {
30  crate.at(j) = rawHFET.at(16 * i + j);
31  }
32  hfData.at(i) = crate;
33  }
34 }
std::vector< std::vector< unsigned short > > hfData
Definition: L1RCTORCAMap.h:30
std::vector< unsigned short > rawHFET
Definition: L1RCTORCAMap.h:44
vector< int > L1RCTORCAMap::orcamap ( int  eta,
int  phi 
)

Definition at line 84 of file L1RCTORCAMap.cc.

References highEtaMap(), mps_fire::i, and lowEtaMap().

Referenced by makeBarrelData().

84  {
85  int crateNum(20);
86  std::vector<int> cardTower(2, 0);
87  std::vector<int> returnVec(3, 0);
88  int modEta = eta % 28;
89  int modPhi = phi % 8;
90  if (phi < 8)
91  crateNum = 0;
92  else if (phi < 16)
93  crateNum = 1;
94  else if (phi < 24)
95  crateNum = 2;
96  else if (phi < 32)
97  crateNum = 3;
98  else if (phi < 40)
99  crateNum = 4;
100  else if (phi < 48)
101  crateNum = 5;
102  else if (phi < 56)
103  crateNum = 6;
104  else if (phi < 64)
105  crateNum = 7;
106  else if (phi < 72)
107  crateNum = 8;
108 
109  if (eta < 28)
110  cardTower = lowEtaMap(modEta, modPhi);
111  else {
112  cardTower = highEtaMap(modEta, modPhi);
113  crateNum = crateNum + 9;
114  }
115 
116  returnVec.at(0) = crateNum;
117  for (int i = 0; i < 2; i++) {
118  returnVec.at(i + 1) = cardTower.at(i);
119  }
120  return returnVec;
121 }
std::vector< int > highEtaMap(int eta, int phi)
std::vector< int > lowEtaMap(int eta, int phi)
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 49 of file L1RCTORCAMap.cc.

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

53  {
54  for (int i = 0; i < 4032; i++) {
55  rawEMET.at(i) = emet.at(i);
56  rawHDET.at(i) = hdet.at(i);
57  rawEMFG.at(i) = emfg.at(i);
58  rawHDFG.at(i) = hdfg.at(i);
59  }
60  for (int i = 0; i < 144; i++)
61  rawHFET.at(i) = hfet.at(i);
62 
65 
67  makeHFData();
68 }
std::vector< unsigned short > combHD
Definition: L1RCTORCAMap.h:46
void makeBarrelData()
Definition: L1RCTORCAMap.cc:36
std::vector< unsigned short > rawHDFG
Definition: L1RCTORCAMap.h:43
std::vector< unsigned short > combEM
Definition: L1RCTORCAMap.h:45
std::vector< unsigned short > rawEMFG
Definition: L1RCTORCAMap.h:41
std::vector< unsigned short > combVec(const std::vector< unsigned short > &et, const std::vector< unsigned short > &fg)
Definition: L1RCTORCAMap.cc:76
std::vector< unsigned short > rawHFET
Definition: L1RCTORCAMap.h:44
std::vector< unsigned short > rawEMET
Definition: L1RCTORCAMap.h:40
std::vector< unsigned short > rawHDET
Definition: L1RCTORCAMap.h:42
void makeHFData()
Definition: L1RCTORCAMap.cc:26

Member Data Documentation

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

Definition at line 29 of file L1RCTORCAMap.h.

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

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

Definition at line 45 of file L1RCTORCAMap.h.

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

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

Definition at line 46 of file L1RCTORCAMap.h.

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

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

Definition at line 30 of file L1RCTORCAMap.h.

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

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

Definition at line 40 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

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

Definition at line 41 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

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

Definition at line 42 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

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

Definition at line 43 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

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

Definition at line 44 of file L1RCTORCAMap.h.

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