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