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
mps_fire.i
i
Definition: mps_fire.py:428
L1RCTReceiverCard::crtNo
unsigned short crtNo
Definition: L1RCTReceiverCard.h:77
input
static const std::string input
Definition: EdmProvDump.cc:48
L1RCTReceiverCard::L1RCTReceiverCard
L1RCTReceiverCard()=delete
L1RCTReceiverCard::crateNumber
int crateNumber()
Definition: L1RCTReceiverCard.h:20
L1RCTReceiverCard
Definition: L1RCTReceiverCard.h:14
L1RCTReceiverCard::fillRegionSums
void fillRegionSums()
Definition: L1RCTReceiverCard.cc:200
L1RCTReceiverCard::fillInput
void fillInput(const std::vector< unsigned short > &input)
Definition: L1RCTReceiverCard.cc:71
L1RCTReceiverCard::cardNo
unsigned short cardNo
Definition: L1RCTReceiverCard.h:78
L1RCTReceiverCard::getRegion
L1RCTRegion * getRegion(int i)
Definition: L1RCTReceiverCard.h:53
L1RCTReceiverCard::getEtIn10BitsRegion
unsigned short getEtIn10BitsRegion(int i)
Definition: L1RCTReceiverCard.h:57
L1RCTReceiverCard::rctLookupTables_
const L1RCTLookupTables * rctLookupTables_
Definition: L1RCTReceiverCard.h:80
L1RCTReceiverCard::calcTauBit
unsigned short calcTauBit(L1RCTRegion region)
Definition: L1RCTReceiverCard.cc:161
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
L1RCTReceiverCard::getMuonBitRegion
unsigned short getMuonBitRegion(int i)
Definition: L1RCTReceiverCard.h:55
L1RCTReceiverCard::fillMuonBits
void fillMuonBits()
Definition: L1RCTReceiverCard.cc:227
L1RCTLookupTables
Definition: L1RCTLookupTables.h:11
L1RCTReceiverCard::tauBits
std::vector< unsigned short > tauBits
Definition: L1RCTReceiverCard.h:85
L1RCTReceiverCard::fileInput
void fileInput(char *filename)
Definition: L1RCTReceiverCard.cc:37
L1RCTReceiverCard::overFlowBits
std::vector< unsigned short > overFlowBits
Definition: L1RCTReceiverCard.h:83
L1RCTReceiverCard::calcMuonBit
unsigned short calcMuonBit(L1RCTRegion region)
Definition: L1RCTReceiverCard.cc:232
L1RCTReceiverCard::getOverFlowBitRegion
unsigned short getOverFlowBitRegion(int i)
Definition: L1RCTReceiverCard.h:56
L1RCTReceiverCard::printEdges
void printEdges()
Definition: L1RCTReceiverCard.h:63
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88271
L1RCTReceiverCard::getTauBitRegion
unsigned short getTauBitRegion(int i)
Definition: L1RCTReceiverCard.h:54
L1RCTReceiverCard::etIn10Bits
std::vector< unsigned short > etIn10Bits
Definition: L1RCTReceiverCard.h:82
L1RCTReceiverCard::randomInput
void randomInput()
Definition: L1RCTReceiverCard.cc:30
L1RCTReceiverCard::calcRegionSum
unsigned short calcRegionSum(L1RCTRegion region)
Definition: L1RCTReceiverCard.cc:207
L1RCTReceiverCard::fillTauBits
void fillTauBits()
Definition: L1RCTReceiverCard.cc:156
L1RCTReceiverCard::~L1RCTReceiverCard
~L1RCTReceiverCard()
Definition: L1RCTReceiverCard.cc:28
L1RCTReceiverCard::regions
std::vector< L1RCTRegion > regions
Definition: L1RCTReceiverCard.h:72
L1RCTReceiverCard::muonBits
std::vector< unsigned short > muonBits
Definition: L1RCTReceiverCard.h:84
L1RCTRegion.h
L1RCTRegion
Definition: L1RCTRegion.h:6
L1RCTReceiverCard::cardNumber
int cardNumber()
Definition: L1RCTReceiverCard.h:21
L1RCTReceiverCard::print
void print()
Definition: L1RCTReceiverCard.cc:242
L1RCTReceiverCard::towerToRegionMap
std::vector< unsigned short > towerToRegionMap(int towernum)
Definition: L1RCTReceiverCard.cc:100