CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1RCT.h
Go to the documentation of this file.
1 #ifndef L1RCT_h
2 #define L1RCT_h
3 
4 #include <vector>
5 #include <bitset>
6 #include <iostream>
7 #include <iomanip>
8 #include <string>
9 
12 
17 
18 class L1RCTLookupTables;
19 
20 class L1RCT {
21 
22  public:
23 
24  L1RCT(const L1RCTLookupTables* rctLookupTables);
25 
26  //Organize input for consumption by the cards
27  void input();
28 
29  //For testing accept external input
30  void input(const std::vector<std::vector<std::vector<unsigned short> > >& barrelIn,
31  const std::vector<std::vector<unsigned short> >& hfIn);
32 
33  //Should send commands to all crates to send commands to all RCs to
34  //process the input data and then send it on to the EICs and then
35  //to the JSCs
36  void processEvent();
37 
38  void fileInput(const char* filename); // added "const" also in .cc
39 
40  void digiInput(const EcalTrigPrimDigiCollection& ecalCollection,
41  const HcalTrigPrimDigiCollection& hcalCollection);
42 
43  void randomInput();
44 
45  void print();
46  void printCrate(int i){
47  crates.at(i).print();
48  }
49  void printJSC(int i){
50  crates.at(i).printJSC();
51  }
52  void printJSC(){
53  for(int i=0;i<18;i++){
54  std::cout << "JSC for Crate " << i << std::endl;
55  crates.at(i).printJSC();
56  }
57  }
58  void printRC(int i, int j){
59  crates.at(i).printRC(j);
60  }
61  void printEIC(int i, int j){
62  crates.at(i).printEIC(j);
63  }
64  void printEICEdges(int i, int j){
65  crates.at(i).printEICEdges(j);
66  }
67 
69 
71 
72  std::vector<unsigned short> getJetRegions(unsigned crate){
73  return crates.at(crate).getJetRegions();
74  }
75 
76  std::vector<L1CaloRegion> getRegions(unsigned crate);
77 
78  unsigned short ecalCompressedET(int crate, int card, int tower)
79  {return barrel.at(crate).at(card).at(tower) / 2;}
80  unsigned short ecalFineGrainBit(int crate, int card, int tower)
81  {return barrel.at(crate).at(card).at(tower) & 1;}
82  unsigned short hcalCompressedET(int crate, int card, int tower)
83  {return barrel.at(crate).at(card).at(tower+32) / 2;}
84  unsigned short hcalFineGrainBit(int crate, int card, int tower)
85  {return barrel.at(crate).at(card).at(tower+32) & 1;}
86  unsigned short hfCompressedET(int crate, int tower)
87  {return hf.at(crate).at(tower) / 2;}
88  unsigned short hfFineGrainBit(int crate, int tower)
89  {return hf.at(crate).at(tower) & 1;}
90 
91  private:
92 
93  L1RCT(); // Do not implement this
94 
96 
97  //Helper methods called by constructor
98  //Set all the neighbors properly.
99  //Will make use of the internal neighborMap
100  void makeCrates();
101  void configureCards();
102  void shareNeighbors();
103 
105 
106  //Helper class containing information to set all the neighbors for
107  //the receiver cards. We will use the methods
108  //north,south,west,east,se,sw,ne,nw,which each take in the
109  //indices of the region in question and then return the indices
110  //of the region that is the corresponding neighbor to be used.
112 
113  //Vector of all 18 crates.
114  //Will follow numbering convention listed
115  //in the CaloTrigger Tower Mapping
116  //So 0->8 are eta -5 -> 0
117  //While 9-17 are eta 0 -> 5
118  //Crate i and crate i+9 are next to each other
119  std::vector<L1RCTCrate> crates;
120 
121  //Data for processing is organized into the crates and cards
122  //in two multilayered vectors of vectors.
123  //The first is of the actual barrel information.
124  //18 crates -> 7 RCs -> 64 unsigned shorts per RC
125  //so it should be a std::vector<std::vector<std::vector<unsigned short> > >
126  //The second is of the HF regions which is just of type
127  //std::vector<std::vector<unsigned short> >
128  std::vector<std::vector<std::vector<unsigned short> > > barrel;
129  std::vector<std::vector<unsigned short> > hf;
130 
131 };
132 
133 #endif
std::vector< std::vector< unsigned short > > hf
Definition: L1RCT.h:129
int i
Definition: DBlmapReader.cc:9
std::vector< L1CaloEmCand > L1CaloEmCollection
std::vector< unsigned short > getJetRegions(unsigned crate)
Definition: L1RCT.h:72
void printCrate(int i)
Definition: L1RCT.h:46
unsigned short hcalCompressedET(int crate, int card, int tower)
Definition: L1RCT.h:82
unsigned short hfCompressedET(int crate, int tower)
Definition: L1RCT.h:86
std::vector< L1CaloRegion > getRegions(unsigned crate)
Definition: L1RCT.cc:366
void printRC(int i, int j)
Definition: L1RCT.h:58
unsigned short hcalFineGrainBit(int crate, int card, int tower)
Definition: L1RCT.h:84
std::vector< L1RCTCrate > crates
Definition: L1RCT.h:119
L1CaloEmCollection getNonisolatedEGObjects(unsigned crate)
Definition: L1RCT.cc:352
void randomInput()
Definition: L1RCT.cc:220
void makeCrates()
Definition: L1RCT.cc:48
unsigned short ecalFineGrainBit(int crate, int card, int tower)
Definition: L1RCT.h:80
unsigned short ecalCompressedET(int crate, int card, int tower)
Definition: L1RCT.h:78
L1CaloEmCollection getIsolatedEGObjects(unsigned crate)
Definition: L1RCT.cc:335
int j
Definition: DBlmapReader.cc:9
unsigned short hfFineGrainBit(int crate, int tower)
Definition: L1RCT.h:88
void printJSC()
Definition: L1RCT.h:52
void print()
Definition: L1RCT.cc:326
void printEIC(int i, int j)
Definition: L1RCT.h:61
void configureCards()
void input()
Definition: L1RCT.cc:66
L1RCTNeighborMap neighborMap
Definition: L1RCT.h:111
void printJSC(int i)
Definition: L1RCT.h:49
void processEvent()
Definition: L1RCT.cc:36
void fileInput(const char *filename)
Definition: L1RCT.cc:85
void digiInput(const EcalTrigPrimDigiCollection &ecalCollection, const HcalTrigPrimDigiCollection &hcalCollection)
Definition: L1RCT.cc:116
L1RCTRegion empty
Definition: L1RCT.h:104
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:121
void shareNeighbors()
Definition: L1RCT.cc:243
Definition: L1RCT.h:20
const L1RCTLookupTables * rctLookupTables_
Definition: L1RCT.h:95
void printEICEdges(int i, int j)
Definition: L1RCT.h:64
std::vector< std::vector< std::vector< unsigned short > > > barrel
Definition: L1RCT.h:128