CMS 3D CMS Logo

CSCTMBHeader2007.cc
Go to the documentation of this file.
4 
6 {
7  bzero(data(), sizeInWords()*2);
8  bits.nHeaderFrames = 42;
9  bits.e0bline = 0x6E0B;
10  bits.b0cline = 0xDB0C;
11  bits.nTBins = 7;
12  bits.nCFEBs = 5;
13 }
14 
15 
16 CSCTMBHeader2007::CSCTMBHeader2007(const unsigned short * buf)
17 {
18  memcpy(data(), buf, sizeInWords()*2);
19 }
20 
21 
23 {
24  bits.cscID = dmbHeader.dmbID();
25  bits.l1aNumber = dmbHeader.l1a();
26 // bits.bxnCount = dmbHeader.bxn();
27 }
28 
30 std::vector<CSCCLCTDigi> CSCTMBHeader2007::CLCTDigis(uint32_t idlayer)
31 {
32  std::vector<CSCCLCTDigi> result;
33  int strip = bits.clct0_key;
34  int cfeb = (bits.clct0_cfeb_low)|(bits.clct0_cfeb_high<<1);
35  int pattern = bits.clct0_shape;
36  int bend = bits.clct0_bend;
37  //offlineStripNumbering(strip, cfeb, pattern, bend);
38  CSCCLCTDigi digi0(bits.clct0_valid, bits.clct0_quality,
39  pattern, 1, bend, strip, cfeb, bits.clct0_bxn, 1, bits.bxnPreTrigger);
40  //digi0.setFullBX(bits.bxnPreTrigger);
41 
42  strip = bits.clct1_key;
43  cfeb = (bits.clct1_cfeb_low)|(bits.clct1_cfeb_high<<1);
44  pattern = bits.clct1_shape;
45  bend = bits.clct1_bend;
46  //offlineStripNumbering(strip, cfeb, pattern, bend);
47  CSCCLCTDigi digi1(bits.clct1_valid, bits.clct1_quality,
48  pattern, 1, bend, strip, cfeb, bits.clct1_bxn, 2, bits.bxnPreTrigger);
49  //digi1.setFullBX(bits.bxnPreTrigger);
50 
51  //if (digi0.isValid() && digi1.isValid()) swapCLCTs(digi0, digi1);
52 
53  result.push_back(digi0);
54  result.push_back(digi1);
55 
56 
57  return result;
58 }
59 
61 std::vector<CSCCorrelatedLCTDigi>
62 CSCTMBHeader2007::CorrelatedLCTDigis(uint32_t idlayer) const
63 {
64  std::vector<CSCCorrelatedLCTDigi> result;
66  int strip = bits.MPC_Muon0_halfstrip_clct_pattern;//this goes from 0-159
67  //offlineHalfStripNumbering(strip);
68  CSCCorrelatedLCTDigi digi(1, bits.MPC_Muon0_vpf_, bits.MPC_Muon0_quality_,
69  bits.MPC_Muon0_wire_, strip, bits.MPC_Muon0_clct_pattern_,
70  bits.MPC_Muon0_bend_, bits.MPC_Muon0_bx_, 0,
71  bits.MPC_Muon0_bc0_, bits.MPC_Muon0_SyncErr_,
72  bits.MPC_Muon0_cscid_low | (bits.MPC_Muon0_cscid_bit4<<3));
73  result.push_back(digi);
75  strip = bits.MPC_Muon1_halfstrip_clct_pattern;//this goes from 0-159
76  //offlineHalfStripNumbering(strip);
77  digi = CSCCorrelatedLCTDigi(2, bits.MPC_Muon1_vpf_, bits.MPC_Muon1_quality_,
78  bits.MPC_Muon1_wire_, strip, bits.MPC_Muon1_clct_pattern_,
79  bits.MPC_Muon1_bend_, bits.MPC_Muon1_bx_, 0,
80  bits.MPC_Muon1_bc0_, bits.MPC_Muon1_SyncErr_,
81  bits.MPC_Muon1_cscid_low | (bits.MPC_Muon1_cscid_bit4<<3));
82  result.push_back(digi);
83  return result;
84 }
85 
86 void
88 {
89  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
90 }
91 
92 
93 void
95 {
96  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
97 }
98 
99 void
101 {
102  int strip = digi.getStrip();
103  int cfeb = digi.getCFEB();
104  int bend = digi.getBend();
105  int pattern = digi.getPattern();
106  //hardwareStripNumbering(strip, cfeb, pattern, bend);
107  bits.clct0_valid = digi.isValid();
108  bits.clct0_quality = digi.getQuality();
109  bits.clct0_shape = pattern;
110  bits.clct0_bend = bend;
111  bits.clct0_key = strip;
112  bits.clct0_cfeb_low = (cfeb & 0x1);
113  bits.clct0_cfeb_high = (cfeb>>1);
114  bits.clct0_bxn = digi.getBX();
115  bits.bxnPreTrigger = digi.getFullBX();
116  bits.bxnCount = (digi.getFullBX() + 167) & 0xFFF;
117 }
118 
119 void
121 {
122  int strip = digi.getStrip();
123  int cfeb = digi.getCFEB();
124  int bend = digi.getBend();
125  int pattern = digi.getPattern();
126  //hardwareStripNumbering(strip, cfeb, pattern, bend);
127  bits.clct1_valid = digi.isValid();
128  bits.clct1_quality = digi.getQuality();
129  bits.clct1_shape = pattern;
130  bits.clct1_bend = bend;
131  bits.clct1_key = strip;
132  bits.clct1_cfeb_low = (cfeb & 0x1);
133  bits.clct1_cfeb_high = (cfeb>>1);
134  bits.clct1_bxn = digi.getBX();
135  bits.bxnPreTrigger = digi.getFullBX();
136 }
137 
138 void
140 {
141  int halfStrip = digi.getStrip();
142  //hardwareHalfStripNumbering(halfStrip);
143 
144  bits.MPC_Muon0_vpf_ = digi.isValid();
145  bits.MPC_Muon0_wire_ = digi.getKeyWG();
146  bits.MPC_Muon0_clct_pattern_ = digi.getPattern();
147  bits.MPC_Muon0_quality_ = digi.getQuality();
148  bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip;
149  bits.MPC_Muon0_bend_ = digi.getBend();
150  bits.MPC_Muon0_SyncErr_ = digi.getSyncErr();
151  bits.MPC_Muon0_bx_ = digi.getBX();
152  bits.MPC_Muon0_bc0_ = digi.getBX0();
153  bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7;
154  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID()>>3) & 0x1;
155 }
156 
157 void
159 {
160  int halfStrip = digi.getStrip();
161  //hardwareHalfStripNumbering(halfStrip);
162 
163  bits.MPC_Muon1_vpf_ = digi.isValid();
164  bits.MPC_Muon1_wire_ = digi.getKeyWG();
165  bits.MPC_Muon1_clct_pattern_ = digi.getPattern();
166  bits.MPC_Muon1_quality_ = digi.getQuality();
167  bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip;
168  bits.MPC_Muon1_bend_ = digi.getBend();
169  bits.MPC_Muon1_SyncErr_ = digi.getSyncErr();
170  bits.MPC_Muon1_bx_ = digi.getBX();
171  bits.MPC_Muon1_bc0_ = digi.getBX0();
172  bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7;
173  bits.MPC_Muon1_cscid_bit4 = (digi.getCSCID()>>3) & 0x1;
174 }
175 
176 
177 void CSCTMBHeader2007::print(std::ostream & os) const
178 {
179  os << "...............TMB Header.................." << "\n";
180  os << std::hex << "BOC LINE " << bits.b0cline << " EOB " << bits.e0bline << "\n";
181  os << std::dec << "fifoMode = " << bits.fifoMode
182  << ", nTBins = " << bits.nTBins << "\n";
183 // os << "dumpCFEBs = " << dumpCFEBs << ", nHeaderFrames = "
184 // << nHeaderFrames << "\n";
185  os << "boardID = " << bits.boardID << ", cscID = " << bits.cscID << "\n";
186  os << "l1aNumber = " << bits.l1aNumber << ", bxnCount = " << bits.bxnCount << "\n";
187 // os << "preTrigTBins = " << preTrigTBins << ", nCFEBs = "<< nCFEBs<< " ";
188  os << "trigSourceVect = " << bits.trigSourceVect
189  << ", activeCFEBs = " << bits.activeCFEBs <<"\n";
190  os << "bxnPreTrigger = " << bits.bxnPreTrigger << "\n";
191  os << "tmbMatch = " << bits.tmbMatch << " alctOnly = " << bits.alctOnly
192  << " clctOnly = " << bits.clctOnly << "\n";
193 // << " alctMatchTime = " << alctMatchTime << " ";
194 // os << "hs_thresh = " << hs_thresh << ", ds_thresh = " << ds_thresh
195 // << " ";
196  os << "clct0_key = " << bits.clct0_key << " bits.clct0_shape = " << bits.clct0_shape
197  << " clct0_quality = " << bits.clct0_quality << "\n";
198 // os << "r_buf_nbusy = " << r_buf_nbusy << " ";
199 
200  os << "..................CLCT....................." << "\n";
201 
202 }
203 
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:36
int getStrip() const
return the key halfstrip from 0,159
void print(std::ostream &os) const override
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
unsigned l1a() const
Definition: CSCDMBHeader.h:49
uint16_t getSyncErr() const
int getQuality() const
return the 4 bit Correlated LCT Quality
void addALCT0(const CSCALCTDigi &digi) override
int getBend() const
return bend
int getStrip() const
return halfstrip that goes from 0 to 31
Definition: CSCCLCTDigi.h:60
void addCLCT1(const CSCCLCTDigi &digi) override
int getBend() const
return bend
Definition: CSCCLCTDigi.h:54
int getCFEB() const
return Key CFEB ID
Definition: CSCCLCTDigi.h:66
struct CSCTMBHeader2007::@384 bits
int getBX() const
return BX
Definition: CSCCLCTDigi.h:72
unsigned short * data() override
returns the first data word
uint16_t getCSCID() const
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer) override
returns CLCT digis
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
unsigned short int sizeInWords() const override
int getBX() const
return BX
uint16_t getBX0() const
void addALCT1(const CSCALCTDigi &digi) override
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const override
returns CorrelatedLCT digis
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:42
bool isValid() const
return valid pattern bit
void setEventInformation(const CSCDMBHeader &dmbHeader) override
unsigned dmbID() const
Definition: CSCDMBHeader.h:46
int getPattern() const
return pattern
void addCLCT0(const CSCCLCTDigi &digi) override
Needed before data packing.
int getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:98
int getKeyWG() const
return the key wire group. counts from 0.
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override