CMS 3D CMS Logo

CSCTMBHeader2013.cc
Go to the documentation of this file.
4 
6  bzero(data(), sizeInWords() * 2);
7  bits.nHeaderFrames = 42;
8  bits.e0bline = 0x6E0B;
9  bits.b0cline = 0xDB0C;
10  bits.firmRevCode = 0x7a76;
11  bits.nTBins = 12;
12  bits.nCFEBs = 5;
13 }
14 
15 CSCTMBHeader2013::CSCTMBHeader2013(const unsigned short* buf) { memcpy(data(), buf, sizeInWords() * 2); }
16 
18  bits.cscID = dmbHeader.dmbID();
19  bits.l1aNumber = dmbHeader.l1a24() & 0xFFF;
20  // bits.bxnCount = dmbHeader.bxn12();
21 }
22 
24 std::vector<CSCCLCTDigi> CSCTMBHeader2013::CLCTDigis(uint32_t idlayer) {
25  std::vector<CSCCLCTDigi> result;
26  int halfstrip = bits.clct0_key_low + (bits.clct0_key_high << 7);
28  int cfeb = halfstrip / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
29  int pattern = bits.clct0_shape;
30  int bend = pattern & 0x1;
31 
32  //offlineStripNumbering(strip, cfeb, pattern, bend);
33  CSCCLCTDigi digi0(
34  bits.clct0_valid, bits.clct0_quality, pattern, 1, bend, strip, cfeb, bits.clct_bxn, 1, bits.bxnPreTrigger);
35 
36  halfstrip = bits.clct1_key_low + (bits.clct1_key_high << 7);
38  cfeb = halfstrip / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
39  pattern = bits.clct1_shape;
40  bend = pattern & 0x1;
41 
42  //offlineStripNumbering(strip, cfeb, pattern, bend);
43  CSCCLCTDigi digi1(
44  bits.clct1_valid, bits.clct1_quality, pattern, 1, bend, strip, cfeb, bits.clct_bxn, 2, bits.bxnPreTrigger);
45  result.push_back(digi0);
46  result.push_back(digi1);
47  return result;
48 }
49 
51 std::vector<CSCCorrelatedLCTDigi> CSCTMBHeader2013::CorrelatedLCTDigis(uint32_t idlayer) const {
52  std::vector<CSCCorrelatedLCTDigi> result;
54  int strip = bits.MPC_Muon0_halfstrip_clct_pattern; //this goes from 0-159
55  //offlineHalfStripNumbering(strip);
56  CSCCorrelatedLCTDigi digi(1,
57  bits.MPC_Muon0_vpf_,
58  bits.MPC_Muon0_quality_,
59  bits.MPC_Muon0_wire_,
60  strip,
61  bits.MPC_Muon0_clct_pattern_,
62  bits.MPC_Muon0_bend_,
63  bits.MPC_Muon0_bx_,
64  0,
65  bits.MPC_Muon0_bc0_,
66  bits.MPC_Muon0_SyncErr_,
67  bits.MPC_Muon0_cscid_low | (bits.MPC_Muon0_cscid_bit4 << 3));
68  result.push_back(digi);
70  strip = bits.MPC_Muon1_halfstrip_clct_pattern; //this goes from 0-159
71  //offlineHalfStripNumbering(strip);
72  digi = CSCCorrelatedLCTDigi(2,
73  bits.MPC_Muon1_vpf_,
74  bits.MPC_Muon1_quality_,
75  bits.MPC_Muon1_wire_,
76  strip,
77  bits.MPC_Muon1_clct_pattern_,
78  bits.MPC_Muon1_bend_,
79  bits.MPC_Muon1_bx_,
80  0,
81  bits.MPC_Muon1_bc0_,
82  bits.MPC_Muon1_SyncErr_,
83  bits.MPC_Muon1_cscid_low | (bits.MPC_Muon1_cscid_bit4 << 3));
84  result.push_back(digi);
85  return result;
86 }
87 
89  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
90 }
91 
93  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
94 }
95 
97  int halfStrip = digi.getKeyStrip();
98  int pattern = digi.getPattern();
99  //int bend = digi.getBend();
100  //hardwareStripNumbering(strip, cfeb, pattern, bend);
101  bits.clct0_valid = digi.isValid();
102  bits.clct0_quality = digi.getQuality();
103  bits.clct0_shape = pattern;
104  // first 7 bits of halfstrip
105  bits.clct0_key_low = halfStrip & (0x7F);
106  // most-significant (8th) bit
107  bits.clct0_key_high = (halfStrip >> 7) & (0x1);
108  bits.clct_bxn = digi.getBX();
109  bits.bxnPreTrigger = digi.getFullBX();
110  bits.bxnCount = (digi.getFullBX() + 167) & 0xFFF;
111 }
112 
114  int halfStrip = digi.getKeyStrip();
115  int pattern = digi.getPattern();
116  //int bend = digi.getBend();
117  //hardwareStripNumbering(strip, cfeb, pattern, bend);
118  bits.clct1_valid = digi.isValid();
119  bits.clct1_quality = digi.getQuality();
120  bits.clct1_shape = pattern;
121  // first 7 bits of halfstrip
122  bits.clct1_key_low = halfStrip & (0x7F);
123  // most-significant (8th) bit
124  bits.clct1_key_high = (halfStrip >> 7) & (0x1);
125  // There is just one BX field common for CLCT0 and CLCT1 (since both
126  // are latched at the same BX); set it in addCLCT0().
127  //bits.clct_bxn = digi.getBX();
128  bits.bxnPreTrigger = digi.getFullBX();
129 }
130 
132  int halfStrip = digi.getStrip();
133  //hardwareHalfStripNumbering(halfStrip);
134 
135  bits.MPC_Muon0_vpf_ = digi.isValid();
136  bits.MPC_Muon0_wire_ = digi.getKeyWG();
137  bits.MPC_Muon0_clct_pattern_ = digi.getPattern();
138  bits.MPC_Muon0_quality_ = digi.getQuality();
139  bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip;
140  bits.MPC_Muon0_bend_ = digi.getBend();
141  bits.MPC_Muon0_SyncErr_ = digi.getSyncErr();
142  bits.MPC_Muon0_bx_ = digi.getBX();
143  bits.MPC_Muon0_bc0_ = digi.getBX0();
144  bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7;
145  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
146 }
147 
149  int halfStrip = digi.getStrip();
150  //hardwareHalfStripNumbering(halfStrip);
151 
152  bits.MPC_Muon1_vpf_ = digi.isValid();
153  bits.MPC_Muon1_wire_ = digi.getKeyWG();
154  bits.MPC_Muon1_clct_pattern_ = digi.getPattern();
155  bits.MPC_Muon1_quality_ = digi.getQuality();
156  bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip;
157  bits.MPC_Muon1_bend_ = digi.getBend();
158  bits.MPC_Muon1_SyncErr_ = digi.getSyncErr();
159  bits.MPC_Muon1_bx_ = digi.getBX();
160  bits.MPC_Muon1_bc0_ = digi.getBX0();
161  bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7;
162  bits.MPC_Muon1_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
163 }
164 
165 void CSCTMBHeader2013::print(std::ostream& os) const {
166  os << "...............TMB Header.................."
167  << "\n";
168  os << std::hex << "BOC LINE " << bits.b0cline << " EOB " << bits.e0bline << "\n";
169  os << std::dec << "fifoMode = " << bits.fifoMode << ", nTBins = " << bits.nTBins << "\n";
170  os << "boardID = " << bits.boardID << ", cscID = " << bits.cscID << "\n";
171  os << "l1aNumber = " << bits.l1aNumber << ", bxnCount = " << bits.bxnCount << "\n";
172  os << "trigSourceVect = " << bits.trigSourceVect
173  << ", activeCFEBs = " << (bits.activeCFEBs | (bits.activeCFEBs_2 << 5))
174  << ", readCFEBs = " << (bits.readCFEBs | (bits.readCFEBs_2 << 5)) << "\n";
175  os << "bxnPreTrigger = " << bits.bxnPreTrigger << "\n";
176  os << "tmbMatch = " << bits.tmbMatch << " alctOnly = " << bits.alctOnly << " clctOnly = " << bits.clctOnly << "\n";
177  os << " bits.clct0_shape = " << bits.clct0_shape << " clct0_quality = " << bits.clct0_quality << "\n";
178 
179  os << "..................CLCT....................."
180  << "\n";
181 }
void addCLCT1(const CSCCLCTDigi &digi) override
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
uint16_t getPattern() const
return the Run-2 pattern ID
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:56
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:107
void print(std::ostream &os) const override
void addALCT1(const CSCALCTDigi &digi) override
struct CSCTMBHeader2013::@499 bits
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:165
uint16_t getBX() const
return BX
bool isValid() const
return valid pattern bit
void addCLCT0(const CSCCLCTDigi &digi) override
for data packing
unsigned short * data() override
returns the first data word
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
uint16_t getSyncErr() const
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override
uint16_t getQuality() const
return the Quality
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer) override
returns CLCT digis
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:123
unsigned short int sizeInWords() const override
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:62
uint16_t getKeyWG() const
return the key wire group. counts from 0.
void setEventInformation(const CSCDMBHeader &dmbHeader) override
unsigned l1a24() const
Definition: CSCDMBHeader.h:40
void addALCT0(const CSCALCTDigi &digi) override
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const override
returns CorrelatedLCT digis