CMS 3D CMS Logo

L1RCTReceiverCard.h
Go to the documentation of this file.
1 #ifndef L1RCTReceiverCard_h
2 #define L1RCTReceiverCard_h
3 
4 #include <cstdlib>
5 #include <fstream>
6 #include <iostream>
7 #include <vector>
8 #include <bitset>
9 #include <string>
11 
12 class L1RCTLookupTables;
13 
15 
16  public:
17 
18  L1RCTReceiverCard(int crateNumber, int cardNumber, 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
56  return &regions.at(i);
57  }
58  unsigned short getTauBitRegion(int i) {return tauBits.at(i);}
59  unsigned short getMuonBitRegion(int i) {return muonBits.at(i);}
60  unsigned short getOverFlowBitRegion(int i) {return overFlowBits.at(i);}
61  unsigned short getEtIn10BitsRegion(int i) {return etIn10Bits.at(i);}
62 
63  std::vector<unsigned short> towerToRegionMap(int towernum);
64 
65  void print();
66 
67  void printEdges(){
68  regions.at(0).printEdges();
69  regions.at(1).printEdges();
70  }
71 
72  void randomInput();
73  void fileInput(char* filename);
74 
75  private:
76 
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  //No default constructor, no copy constructor,
93  //and no assignment operator
94  L1RCTReceiverCard() = delete;
95 };
96 #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:45
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