CMS 3D CMS Logo

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