CMS 3D CMS Logo

CSCTMBHeader2007_rev0x50c3.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 = 0x50c3;
11  bits.nTBins = 12;
12  bits.nCFEBs = 5;
13 }
14 
16  memcpy(data(), buf, sizeInWords() * 2);
17 }
18 
20  bits.cscID = dmbHeader.dmbID();
21  bits.l1aNumber = dmbHeader.l1a24() & 0xFFF;
22 }
23 
25 std::vector<CSCCLCTDigi> CSCTMBHeader2007_rev0x50c3::CLCTDigis(uint32_t idlayer) {
26  std::vector<CSCCLCTDigi> result;
27  int halfstrip = bits.clct0_key_low + (bits.clct0_key_high << 7);
29  int cfeb = halfstrip / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
30  int pattern = bits.clct0_shape;
31  int bend = pattern & 0x1;
32 
33  //offlineStripNumbering(strip, cfeb, pattern, bend);
34  CSCCLCTDigi digi0(
35  bits.clct0_valid, bits.clct0_quality, pattern, 1, bend, strip, cfeb, bits.clct_bxn, 1, bits.bxnPreTrigger);
36 
37  halfstrip = bits.clct1_key_low + (bits.clct1_key_high << 7);
39  cfeb = halfstrip / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
40  pattern = bits.clct1_shape;
41  bend = pattern & 0x1;
42 
43  //offlineStripNumbering(strip, cfeb, pattern, bend);
44  CSCCLCTDigi digi1(
45  bits.clct1_valid, bits.clct1_quality, pattern, 1, bend, strip, cfeb, bits.clct_bxn, 2, bits.bxnPreTrigger);
46  result.push_back(digi0);
47  result.push_back(digi1);
48  return result;
49 }
50 
52 std::vector<CSCCorrelatedLCTDigi> CSCTMBHeader2007_rev0x50c3::CorrelatedLCTDigis(uint32_t idlayer) const {
53  std::vector<CSCCorrelatedLCTDigi> result;
55  int strip = bits.MPC_Muon0_halfstrip_clct_pattern; //this goes from 0-159
56  //offlineHalfStripNumbering(strip);
57  CSCCorrelatedLCTDigi digi(1,
58  bits.MPC_Muon0_vpf_,
59  bits.MPC_Muon0_quality_,
60  bits.MPC_Muon0_wire_,
61  strip,
62  bits.MPC_Muon0_clct_pattern_,
63  bits.MPC_Muon0_bend_,
64  bits.MPC_Muon0_bx_,
65  0,
66  bits.MPC_Muon0_bc0_,
67  bits.MPC_Muon0_SyncErr_,
68  bits.MPC_Muon0_cscid_low | (bits.MPC_Muon0_cscid_bit4 << 3));
69  result.push_back(digi);
71  strip = bits.MPC_Muon1_halfstrip_clct_pattern; //this goes from 0-159
72  //offlineHalfStripNumbering(strip);
73  digi = CSCCorrelatedLCTDigi(2,
74  bits.MPC_Muon1_vpf_,
75  bits.MPC_Muon1_quality_,
76  bits.MPC_Muon1_wire_,
77  strip,
78  bits.MPC_Muon1_clct_pattern_,
79  bits.MPC_Muon1_bend_,
80  bits.MPC_Muon1_bx_,
81  0,
82  bits.MPC_Muon1_bc0_,
83  bits.MPC_Muon1_SyncErr_,
84  bits.MPC_Muon1_cscid_low | (bits.MPC_Muon1_cscid_bit4 << 3));
85  result.push_back(digi);
86  return result;
87 }
88 
90  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
91 }
92 
94  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
95 }
96 
98  int halfStrip = digi.getKeyStrip();
99  int pattern = digi.getPattern();
100  //int bend = digi.getBend();
101  //hardwareStripNumbering(strip, cfeb, pattern, bend);
102  bits.clct0_valid = digi.isValid();
103  bits.clct0_quality = digi.getQuality();
104  bits.clct0_shape = pattern;
105  // first 7 bits of halfstrip
106  bits.clct0_key_low = halfStrip & (0x7F);
107  // most-significant (8th) bit
108  bits.clct0_key_high = (halfStrip >> 7) & (0x1);
109  bits.clct_bxn = digi.getBX();
110  bits.bxnPreTrigger = digi.getFullBX();
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  bits.bxnCount = (digi.getFullBX() + 167) & 0xFFF;
130 }
131 
133  int halfStrip = digi.getStrip();
134  //hardwareHalfStripNumbering(halfStrip);
135 
136  bits.MPC_Muon0_vpf_ = digi.isValid();
137  bits.MPC_Muon0_wire_ = digi.getKeyWG();
138  bits.MPC_Muon0_clct_pattern_ = digi.getPattern();
139  bits.MPC_Muon0_quality_ = digi.getQuality();
140  bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip;
141  bits.MPC_Muon0_bend_ = digi.getBend();
142  bits.MPC_Muon0_SyncErr_ = digi.getSyncErr();
143  bits.MPC_Muon0_bx_ = digi.getBX();
144  bits.MPC_Muon0_bc0_ = digi.getBX0();
145  bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7;
146  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
147 }
148 
150  int halfStrip = digi.getStrip();
151  //hardwareHalfStripNumbering(halfStrip);
152 
153  bits.MPC_Muon1_vpf_ = digi.isValid();
154  bits.MPC_Muon1_wire_ = digi.getKeyWG();
155  bits.MPC_Muon1_clct_pattern_ = digi.getPattern();
156  bits.MPC_Muon1_quality_ = digi.getQuality();
157  bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip;
158  bits.MPC_Muon1_bend_ = digi.getBend();
159  bits.MPC_Muon1_SyncErr_ = digi.getSyncErr();
160  bits.MPC_Muon1_bx_ = digi.getBX();
161  bits.MPC_Muon1_bc0_ = digi.getBX0();
162  bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7;
163  bits.MPC_Muon1_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
164 }
165 
166 void CSCTMBHeader2007_rev0x50c3::print(std::ostream& os) const {
167  os << "...............TMB Header.................."
168  << "\n";
169  os << std::hex << "BOC LINE " << bits.b0cline << " EOB " << bits.e0bline << "\n";
170  os << std::dec << "fifoMode = " << bits.fifoMode << ", nTBins = " << bits.nTBins << "\n";
171  os << "boardID = " << bits.boardID << ", cscID = " << bits.cscID << "\n";
172  os << "l1aNumber = " << bits.l1aNumber << ", bxnCount = " << bits.bxnCount << "\n";
173  os << "trigSourceVect = " << bits.trigSourceVect << ", activeCFEBs = " << bits.activeCFEBs << "\n";
174  os << "bxnPreTrigger = " << bits.bxnPreTrigger << "\n";
175  os << "tmbMatch = " << bits.tmbMatch << " alctOnly = " << bits.alctOnly << " clctOnly = " << bits.clctOnly << "\n";
176  os << " bits.clct0_shape = " << bits.clct0_shape << " clct0_quality = " << bits.clct0_quality << "\n";
177  os << "..................CLCT....................."
178  << "\n";
179 }
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
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:107
void print(std::ostream &os) const override
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
void addALCT0(const CSCALCTDigi &digi) override
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:165
void addCLCT1(const CSCCLCTDigi &digi) override
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const override
returns CorrelatedLCT digis
void addCLCT0(const CSCCLCTDigi &digi) override
for data packing
uint16_t getBX() const
return BX
bool isValid() const
return valid pattern bit
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
uint16_t getSyncErr() const
unsigned short * data() override
returns the first data word
uint16_t getQuality() const
return the Quality
struct CSCTMBHeader2007_rev0x50c3::@491 bits
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
void setEventInformation(const CSCDMBHeader &dmbHeader) override
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:123
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:62
uint16_t getKeyWG() const
return the key wire group. counts from 0.
unsigned l1a24() const
Definition: CSCDMBHeader.h:40
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer) override
returns CLCT digis
void addALCT1(const CSCALCTDigi &digi) override
unsigned short int sizeInWords() const override