CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (std::vector< unsigned short > et, 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 (std::vector< unsigned > emet, std::vector< unsigned > hdet, std::vector< bool > emfg, std::vector< bool > hdfg, 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> > >(18,std::vector<std::vector<unsigned short> >(7,
16  std::vector<unsigned short>(64)));
17  hfData = std::vector<std::vector<unsigned short> >(18,std::vector<unsigned short>(8));
18 
19 }
std::vector< std::vector< std::vector< unsigned short > > > barrelData
Definition: L1RCTORCAMap.h:30
std::vector< unsigned short > combHD
Definition: L1RCTORCAMap.h:47
std::vector< unsigned short > rawHDFG
Definition: L1RCTORCAMap.h:44
std::vector< std::vector< unsigned short > > hfData
Definition: L1RCTORCAMap.h:31
std::vector< unsigned short > combEM
Definition: L1RCTORCAMap.h:46
std::vector< unsigned short > rawEMFG
Definition: L1RCTORCAMap.h:42
std::vector< unsigned short > rawHFET
Definition: L1RCTORCAMap.h:45
std::vector< unsigned short > rawEMET
Definition: L1RCTORCAMap.h:41
std::vector< unsigned short > rawHDET
Definition: L1RCTORCAMap.h:43

Member Function Documentation

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

Definition at line 67 of file L1RCTORCAMap.cc.

Referenced by combVec().

67  {
68  unsigned short newfg = fg << 8;
69  return newfg + et;
70 }
vector< unsigned short > L1RCTORCAMap::combVec ( std::vector< unsigned short >  et,
std::vector< unsigned short >  fg 
)

Definition at line 72 of file L1RCTORCAMap.cc.

References bookConverter::comb, combine(), and i.

Referenced by readData().

73  {
74  std::vector<unsigned short> comb(56*72);
75  for(int i = 0; i<(int)et.size(); i++)
76  comb.at(i) = combine(et.at(i),fg.at(i));
77  return comb;
78 }
int i
Definition: DBlmapReader.cc:9
unsigned short combine(unsigned short et, unsigned short fg)
Definition: L1RCTORCAMap.cc:67
dictionary comb
vector< std::vector< std::vector< unsigned short > > > L1RCTORCAMap::giveBarrel ( )

Definition at line 20 of file L1RCTORCAMap.cc.

References barrelData.

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

Definition at line 24 of file L1RCTORCAMap.cc.

References hfData.

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

Definition at line 186 of file L1RCTORCAMap.cc.

References eta(), and phi.

Referenced by orcamap().

186  {
187  int cardnum;
188  int towernum;
189  std::vector<int> returnVec(2);
190  if(eta < 8){
191  if(phi < 4){
192  cardnum = 0;
193  towernum = eta*4+phi;
194  }
195  else{
196  cardnum = 1;
197  towernum = eta*4+(phi-4);
198  }
199  }
200  else if(eta < 16){
201  if(phi < 4){
202  cardnum = 2;
203  towernum = (eta-8)*4+phi;
204  }
205  else{
206  cardnum = 3;
207  towernum = (eta-8)*4+(phi-4);
208  }
209  }
210  else if(eta < 24){
211  if(phi < 4){
212  cardnum = 4;
213  towernum = (eta-16)*4+phi;
214  }
215  else{
216  cardnum = 5;
217  towernum = (eta-16)*4+(phi-4);
218  }
219  }
220  else{
221  cardnum = 6;
222  if(phi < 4)
223  towernum = (27-eta)*4+phi;
224  else
225  towernum = (27-eta)*4+phi+12;
226  }
227 
228  returnVec.at(0)=cardnum;
229  returnVec.at(1)=towernum;
230  return returnVec;
231 }
T eta() const
Definition: DDAxes.h:10
vector< int > L1RCTORCAMap::lowEtaMap ( int  eta,
int  phi 
)
private

Definition at line 120 of file L1RCTORCAMap.cc.

References eta().

Referenced by orcamap().

120  {
121  int cardnum = 0;
122  int towernum = 0;
123  std::vector<int> returnVec(2);
124  if(eta < 4){
125  cardnum = 6;
126  if(phi < 4)
127  towernum = (3-eta)*4 + phi;
128  else
129  towernum = eta*4 + phi + 12;
130  }
131  else if(eta <12){
132  if(phi < 4){
133  cardnum = 4;
134  if(eta < 8)
135  towernum = (7-eta)*4+phi+16;
136  else
137  towernum = (11-eta)*4+phi;
138  }
139  else{
140  cardnum = 5;
141  if(eta < 8)
142  towernum = (7-eta)*4+(phi-4)+16;
143  else
144  towernum = (11-eta)*4+(phi-4);
145  }
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  }
155  else{
156  cardnum = 3;
157  if(eta < 16)
158  towernum = (15-eta)*4+(phi-4)+16;
159  else
160  towernum = (19-eta)*4+(phi-4);
161  }
162  }
163  else if(eta < 28){
164  if(phi < 4){
165  cardnum = 0;
166  if(eta < 24)
167  towernum = (23-eta)*4+phi+16;
168  else
169  towernum = (27-eta)*4+phi;
170  }
171  else{
172  cardnum = 1;
173  if(eta < 24)
174  towernum = (23-eta)*4+(phi-4)+16;
175  else
176  towernum = (27-eta)*4+(phi-4);
177  }
178  }
179 
180  returnVec.at(0) = cardnum;
181  returnVec.at(1) = towernum;
182  return returnVec;
183 }
T eta() const
Definition: DDAxes.h:10
void L1RCTORCAMap::makeBarrelData ( )

Definition at line 37 of file L1RCTORCAMap.cc.

References asciidump::at, barrelData, combEM, combHD, eta(), errorMatrix2Lands::indices, orcamap(), and phi.

Referenced by readData().

37  {
38  std::vector<int> indices;
39  for(int phi = 0; phi<72;phi++){
40  for(int eta = 0; eta<56;eta++){
41  indices = orcamap(eta,phi);
42  (barrelData.at(indices.at(0))).at(indices.at(1)).at(indices.at(2)) = combEM.at(phi*56 + eta);
43  (barrelData.at(indices.at(0))).at(indices.at(1)).at(indices.at(2)+32) = combHD.at(phi*56 + eta);
44  }
45  }
46 }
std::vector< std::vector< std::vector< unsigned short > > > barrelData
Definition: L1RCTORCAMap.h:30
std::vector< unsigned short > combHD
Definition: L1RCTORCAMap.h:47
T eta() const
std::vector< int > orcamap(int eta, int phi)
Definition: L1RCTORCAMap.cc:80
std::vector< unsigned short > combEM
Definition: L1RCTORCAMap.h:46
list at
Definition: asciidump.py:428
Definition: DDAxes.h:10
void L1RCTORCAMap::makeHFData ( )

Definition at line 27 of file L1RCTORCAMap.cc.

References hfData, i, j, and rawHFET.

Referenced by readData().

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

Definition at line 80 of file L1RCTORCAMap.cc.

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

Referenced by makeBarrelData().

80  {
81  int crateNum(20);
82  std::vector<int> cardTower(2,0);
83  std::vector<int> returnVec(3,0);
84  int modEta = eta%28;
85  int modPhi = phi%8;
86  if(phi < 8)
87  crateNum = 0;
88  else if( phi < 16)
89  crateNum = 1;
90  else if( phi < 24)
91  crateNum = 2;
92  else if( phi < 32)
93  crateNum = 3;
94  else if( phi < 40)
95  crateNum = 4;
96  else if( phi < 48)
97  crateNum = 5;
98  else if( phi < 56)
99  crateNum = 6;
100  else if( phi < 64)
101  crateNum = 7;
102  else if( phi < 72)
103  crateNum = 8;
104 
105  if(eta < 28)
106  cardTower = lowEtaMap(modEta,modPhi);
107  else {
108  cardTower = highEtaMap(modEta,modPhi);
109  crateNum = crateNum + 9;
110  }
111 
112  returnVec.at(0) = crateNum;
113  for(int i =0; i<2; i++){
114  returnVec.at(i+1) = cardTower.at(i);
115  }
116  return returnVec;
117 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > highEtaMap(int eta, int phi)
T eta() const
std::vector< int > lowEtaMap(int eta, int phi)
Definition: DDAxes.h:10
void L1RCTORCAMap::readData ( std::vector< unsigned >  emet,
std::vector< unsigned >  hdet,
std::vector< bool >  emfg,
std::vector< bool >  hdfg,
std::vector< unsigned >  hfet 
)

Definition at line 48 of file L1RCTORCAMap.cc.

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

50  {
51  for(int i = 0; i<4032; i++){
52  rawEMET.at(i) = emet.at(i);
53  rawHDET.at(i) = hdet.at(i);
54  rawEMFG.at(i) = emfg.at(i);
55  rawHDFG.at(i) = hdfg.at(i);
56  }
57  for(int i = 0; i<144; i++)
58  rawHFET.at(i) = hfet.at(i);
59 
62 
64  makeHFData();
65 }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned short > combVec(std::vector< unsigned short > et, std::vector< unsigned short > fg)
Definition: L1RCTORCAMap.cc:72
std::vector< unsigned short > combHD
Definition: L1RCTORCAMap.h:47
void makeBarrelData()
Definition: L1RCTORCAMap.cc:37
std::vector< unsigned short > rawHDFG
Definition: L1RCTORCAMap.h:44
std::vector< unsigned short > combEM
Definition: L1RCTORCAMap.h:46
std::vector< unsigned short > rawEMFG
Definition: L1RCTORCAMap.h:42
std::vector< unsigned short > rawHFET
Definition: L1RCTORCAMap.h:45
std::vector< unsigned short > rawEMET
Definition: L1RCTORCAMap.h:41
std::vector< unsigned short > rawHDET
Definition: L1RCTORCAMap.h:43
void makeHFData()
Definition: L1RCTORCAMap.cc:27

Member Data Documentation

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

Definition at line 30 of file L1RCTORCAMap.h.

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

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

Definition at line 46 of file L1RCTORCAMap.h.

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

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

Definition at line 47 of file L1RCTORCAMap.h.

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

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

Definition at line 31 of file L1RCTORCAMap.h.

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

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

Definition at line 41 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

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

Definition at line 42 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

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

Definition at line 43 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

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

Definition at line 44 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

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

Definition at line 45 of file L1RCTORCAMap.h.

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