CMS 3D CMS Logo

L1RCTReceiverCard.h
Go to the documentation of this file.
1 #ifndef L1RCTReceiverCard_h
2 #define L1RCTReceiverCard_h
3 
5 #include <bitset>
6 #include <cstdlib>
7 #include <fstream>
8 #include <iostream>
9 #include <string>
10 #include <vector>
11 
12 class L1RCTLookupTables;
13 
15 
16 public:
18  const L1RCTLookupTables *rctLookupTables);
20 
21  // Information needed to identify cards
22  int crateNumber() { return crtNo; }
23  int cardNumber() { return cardNo; }
24 
25  // Takes in a 64 element vector of unsigned shorts.
26  // First layer is ecal the second is hcal.
27  // goes in order of (for crate 0,card 0)
28  // (Region 1) (Region 0)
29  // 29 25 21 17 13 09 05 01
30  // 30 26 22 18 14 10 06 02
31  // 31 27 23 19 15 11 07 03
32  // 32 28 24 20 16 12 08 04
33  //
34  // For card 6 of crate 0 it would look like
35  //
36  // 13 09 05 01
37  // 14 10 06 02
38  // 15 11 07 03
39  // 16 12 08 04
40  // 17 21 25 29
41  // 18 22 26 30
42  // 19 23 27 31
43  // 20 24 28 32
44  //
45  // In either case it is set up as so that 0-31 are the 8bit ecal energies
46  // plus the fine grain bit, and 32-63 are the 8bit hcal energies plus
47  // the muon bit.
48  void fillInput(const std::vector<unsigned short> &input);
49  void fillTauBits();
50  void fillRegionSums();
51  void fillMuonBits();
52 
53  // For each of the following functions the appropriate arguments are
54  // 0 or 1
55  L1RCTRegion *getRegion(int i) { return &regions.at(i); }
56  unsigned short getTauBitRegion(int i) { return tauBits.at(i); }
57  unsigned short getMuonBitRegion(int i) { return muonBits.at(i); }
58  unsigned short getOverFlowBitRegion(int i) { return overFlowBits.at(i); }
59  unsigned short getEtIn10BitsRegion(int i) { return etIn10Bits.at(i); }
60 
61  std::vector<unsigned short> towerToRegionMap(int towernum);
62 
63  void print();
64 
65  void printEdges() {
66  regions.at(0).printEdges();
67  regions.at(1).printEdges();
68  }
69 
70  void randomInput();
71  void fileInput(char *filename);
72 
73 private:
74  std::vector<L1RCTRegion> regions;
75 
76  unsigned short calcRegionSum(L1RCTRegion region);
77  unsigned short calcTauBit(L1RCTRegion region);
78  unsigned short calcMuonBit(L1RCTRegion region);
79  unsigned short crtNo;
80  unsigned short cardNo;
81 
83 
84  std::vector<unsigned short> etIn10Bits;
85  std::vector<unsigned short> overFlowBits;
86  std::vector<unsigned short> muonBits;
87  std::vector<unsigned short> tauBits;
88 
89  // No default constructor, no copy constructor,
90  // and no assignment operator
91  L1RCTReceiverCard() = delete;
92 };
93 #endif
L1RCTReceiverCard()=delete
unsigned short cardNo
unsigned short crtNo
void fillInput(const std::vector< unsigned short > &input)
unsigned short getMuonBitRegion(int i)
static std::string const input
Definition: EdmProvDump.cc:48
const L1RCTLookupTables * rctLookupTables_
std::vector< unsigned short > overFlowBits
unsigned short calcTauBit(L1RCTRegion region)
unsigned short getEtIn10BitsRegion(int i)
L1RCTRegion * getRegion(int i)
unsigned short getOverFlowBitRegion(int i)
std::vector< unsigned short > etIn10Bits
void fileInput(char *filename)
unsigned short calcMuonBit(L1RCTRegion region)
unsigned short getTauBitRegion(int i)
std::vector< unsigned short > muonBits
std::vector< unsigned short > tauBits
unsigned short calcRegionSum(L1RCTRegion region)
std::vector< unsigned short > towerToRegionMap(int towernum)
std::vector< L1RCTRegion > regions