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);
27  int strip = halfstrip % 32;
28  int cfeb = halfstrip / 32;
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  //digi0.setFullBX(bits.bxnPreTrigger);
36 
37  halfstrip = bits.clct1_key_low + (bits.clct1_key_high << 7);
38  strip = halfstrip % 32;
39  cfeb = halfstrip / 32;
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  //digi1.setFullBX(bits.bxnPreTrigger);
47  result.push_back(digi0);
48  result.push_back(digi1);
49  return result;
50 }
51 
53 std::vector<CSCCorrelatedLCTDigi> CSCTMBHeader2013::CorrelatedLCTDigis(uint32_t idlayer) const {
54  std::vector<CSCCorrelatedLCTDigi> result;
56  int strip = bits.MPC_Muon0_halfstrip_clct_pattern; //this goes from 0-159
57  //offlineHalfStripNumbering(strip);
58  CSCCorrelatedLCTDigi digi(1,
59  bits.MPC_Muon0_vpf_,
60  bits.MPC_Muon0_quality_,
61  bits.MPC_Muon0_wire_,
62  strip,
63  bits.MPC_Muon0_clct_pattern_,
64  bits.MPC_Muon0_bend_,
65  bits.MPC_Muon0_bx_,
66  0,
67  bits.MPC_Muon0_bc0_,
68  bits.MPC_Muon0_SyncErr_,
69  bits.MPC_Muon0_cscid_low | (bits.MPC_Muon0_cscid_bit4 << 3));
70  result.push_back(digi);
72  strip = bits.MPC_Muon1_halfstrip_clct_pattern; //this goes from 0-159
73  //offlineHalfStripNumbering(strip);
74  digi = CSCCorrelatedLCTDigi(2,
75  bits.MPC_Muon1_vpf_,
76  bits.MPC_Muon1_quality_,
77  bits.MPC_Muon1_wire_,
78  strip,
79  bits.MPC_Muon1_clct_pattern_,
80  bits.MPC_Muon1_bend_,
81  bits.MPC_Muon1_bx_,
82  0,
83  bits.MPC_Muon1_bc0_,
84  bits.MPC_Muon1_SyncErr_,
85  bits.MPC_Muon1_cscid_low | (bits.MPC_Muon1_cscid_bit4 << 3));
86  result.push_back(digi);
87  return result;
88 }
89 
91  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
92 }
93 
95  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
96 }
97 
99  int halfStrip = digi.getKeyStrip();
100  int pattern = digi.getPattern();
101  //int bend = digi.getBend();
102  //hardwareStripNumbering(strip, cfeb, pattern, bend);
103  bits.clct0_valid = digi.isValid();
104  bits.clct0_quality = digi.getQuality();
105  bits.clct0_shape = pattern;
106  // first 7 bits of halfstrip
107  bits.clct0_key_low = halfStrip & (0x7F);
108  // most-significant (8th) bit
109  bits.clct0_key_high = (halfStrip >> 7) & (0x1);
110  bits.clct_bxn = digi.getBX();
111  bits.bxnPreTrigger = digi.getFullBX();
112  bits.bxnCount = (digi.getFullBX() + 167) & 0xFFF;
113 }
114 
116  int halfStrip = digi.getKeyStrip();
117  int pattern = digi.getPattern();
118  //int bend = digi.getBend();
119  //hardwareStripNumbering(strip, cfeb, pattern, bend);
120  bits.clct1_valid = digi.isValid();
121  bits.clct1_quality = digi.getQuality();
122  bits.clct1_shape = pattern;
123  // first 7 bits of halfstrip
124  bits.clct1_key_low = halfStrip & (0x7F);
125  // most-significant (8th) bit
126  bits.clct1_key_high = (halfStrip >> 7) & (0x1);
127  // There is just one BX field common for CLCT0 and CLCT1 (since both
128  // are latched at the same BX); set it in addCLCT0().
129  //bits.clct_bxn = digi.getBX();
130  bits.bxnPreTrigger = digi.getFullBX();
131 }
132 
134  int halfStrip = digi.getStrip();
135  //hardwareHalfStripNumbering(halfStrip);
136 
137  bits.MPC_Muon0_vpf_ = digi.isValid();
138  bits.MPC_Muon0_wire_ = digi.getKeyWG();
139  bits.MPC_Muon0_clct_pattern_ = digi.getPattern();
140  bits.MPC_Muon0_quality_ = digi.getQuality();
141  bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip;
142  bits.MPC_Muon0_bend_ = digi.getBend();
143  bits.MPC_Muon0_SyncErr_ = digi.getSyncErr();
144  bits.MPC_Muon0_bx_ = digi.getBX();
145  bits.MPC_Muon0_bc0_ = digi.getBX0();
146  bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7;
147  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
148 }
149 
151  int halfStrip = digi.getStrip();
152  //hardwareHalfStripNumbering(halfStrip);
153 
154  bits.MPC_Muon1_vpf_ = digi.isValid();
155  bits.MPC_Muon1_wire_ = digi.getKeyWG();
156  bits.MPC_Muon1_clct_pattern_ = digi.getPattern();
157  bits.MPC_Muon1_quality_ = digi.getQuality();
158  bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip;
159  bits.MPC_Muon1_bend_ = digi.getBend();
160  bits.MPC_Muon1_SyncErr_ = digi.getSyncErr();
161  bits.MPC_Muon1_bx_ = digi.getBX();
162  bits.MPC_Muon1_bc0_ = digi.getBX0();
163  bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7;
164  bits.MPC_Muon1_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
165 }
166 
167 void CSCTMBHeader2013::print(std::ostream& os) const {
168  os << "...............TMB Header.................."
169  << "\n";
170  os << std::hex << "BOC LINE " << bits.b0cline << " EOB " << bits.e0bline << "\n";
171  os << std::dec << "fifoMode = " << bits.fifoMode << ", nTBins = " << bits.nTBins << "\n";
172  // os << "dumpCFEBs = " << dumpCFEBs << ", nHeaderFrames = "
173  // << nHeaderFrames << "\n";
174  os << "boardID = " << bits.boardID << ", cscID = " << bits.cscID << "\n";
175  os << "l1aNumber = " << bits.l1aNumber << ", bxnCount = " << bits.bxnCount << "\n";
176  // os << "preTrigTBins = " << preTrigTBins << ", nCFEBs = "<< nCFEBs<< " ";
177  os << "trigSourceVect = " << bits.trigSourceVect
178  << ", activeCFEBs = " << (bits.activeCFEBs | (bits.activeCFEBs_2 << 5))
179  << ", readCFEBs = " << (bits.readCFEBs | (bits.readCFEBs_2 << 5)) << "\n";
180  os << "bxnPreTrigger = " << bits.bxnPreTrigger << "\n";
181  os << "tmbMatch = " << bits.tmbMatch << " alctOnly = " << bits.alctOnly << " clctOnly = " << bits.clctOnly << "\n";
182  // << " alctMatchTime = " << alctMatchTime << " ";
183  // os << "hs_thresh = " << hs_thresh << ", ds_thresh = " << ds_thresh
184  // << " ";
185  // os << "clct0_key = " << bits.clct0_key
186  os << " bits.clct0_shape = " << bits.clct0_shape << " clct0_quality = " << bits.clct0_quality << "\n";
187  // os << "r_buf_nbusy = " << r_buf_nbusy << " ";
188 
189  os << "..................CLCT....................."
190  << "\n";
191 }
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:41
int getStrip() const
return the key halfstrip from 0,159
void addCLCT1(const CSCCLCTDigi &digi) override
unsigned l1a24() const
Definition: CSCDMBHeader.h:40
uint16_t getSyncErr() const
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
int getQuality() const
return the 4 bit Correlated LCT Quality
int getBend() const
return bend
void addALCT1(const CSCALCTDigi &digi) override
int getBX() const
return BX
Definition: CSCCLCTDigi.h:77
unsigned short int sizeInWords() const override
uint16_t getCSCID() const
void addCLCT0(const CSCCLCTDigi &digi) override
Needed before data packing.
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:35
unsigned short * data() override
returns the first data word
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override
int getBX() const
return BX
uint16_t getBX0() const
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer) override
returns CLCT digis
struct CSCTMBHeader2013::@423 bits
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:47
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const override
returns CorrelatedLCT digis
bool isValid() const
return valid pattern bit
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
void setEventInformation(const CSCDMBHeader &dmbHeader) override
int getPattern() const
return pattern
void addALCT0(const CSCALCTDigi &digi) override
int getKeyStrip() const
Definition: CSCCLCTDigi.h:94
int getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:103
int getKeyWG() const
return the key wire group. counts from 0.
void print(std::ostream &os) const override