CMS 3D CMS Logo

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