CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
117 
118 void
120 {
121  int strip = digi.getStrip();
122  int cfeb = digi.getCFEB();
123  int bend = digi.getBend();
124  int pattern = digi.getPattern();
125  //hardwareStripNumbering(strip, cfeb, pattern, bend);
126  bits.clct1_valid = digi.isValid();
127  bits.clct1_quality = digi.getQuality();
128  bits.clct1_shape = pattern;
129  bits.clct1_bend = bend;
130  bits.clct1_key = strip;
131  bits.clct1_cfeb_low = (cfeb & 0x1);
132  bits.clct1_cfeb_high = (cfeb>>1);
133  bits.clct1_bxn = digi.getBX();
134  bits.bxnPreTrigger = digi.getFullBX();
135 }
136 
137 void
139 {
140  int halfStrip = digi.getStrip();
141  //hardwareHalfStripNumbering(halfStrip);
142 
143  bits.MPC_Muon0_vpf_ = digi.isValid();
144  bits.MPC_Muon0_wire_ = digi.getKeyWG();
145  bits.MPC_Muon0_clct_pattern_ = digi.getPattern();
146  bits.MPC_Muon0_quality_ = digi.getQuality();
147  bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip;
148  bits.MPC_Muon0_bend_ = digi.getBend();
149  bits.MPC_Muon0_SyncErr_ = digi.getSyncErr();
150  bits.MPC_Muon0_bx_ = digi.getBX();
151  bits.MPC_Muon0_bc0_ = digi.getBX0();
152  bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7;
153  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID()>>3) & 0x1;
154 }
155 
156 void
158 {
159  int halfStrip = digi.getStrip();
160  //hardwareHalfStripNumbering(halfStrip);
161 
162  bits.MPC_Muon1_vpf_ = digi.isValid();
163  bits.MPC_Muon1_wire_ = digi.getKeyWG();
164  bits.MPC_Muon1_clct_pattern_ = digi.getPattern();
165  bits.MPC_Muon1_quality_ = digi.getQuality();
166  bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip;
167  bits.MPC_Muon1_bend_ = digi.getBend();
168  bits.MPC_Muon1_SyncErr_ = digi.getSyncErr();
169  bits.MPC_Muon1_bx_ = digi.getBX();
170  bits.MPC_Muon1_bc0_ = digi.getBX0();
171  bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7;
172  bits.MPC_Muon1_cscid_bit4 = (digi.getCSCID()>>3) & 0x1;
173 }
174 
175 
176 void CSCTMBHeader2007::print(std::ostream & os) const
177 {
178  os << "...............TMB Header.................." << "\n";
179  os << std::hex << "BOC LINE " << bits.b0cline << " EOB " << bits.e0bline << "\n";
180  os << std::dec << "fifoMode = " << bits.fifoMode
181  << ", nTBins = " << bits.nTBins << "\n";
182 // os << "dumpCFEBs = " << dumpCFEBs << ", nHeaderFrames = "
183 // << nHeaderFrames << "\n";
184  os << "boardID = " << bits.boardID << ", cscID = " << bits.cscID << "\n";
185  os << "l1aNumber = " << bits.l1aNumber << ", bxnCount = " << bits.bxnCount << "\n";
186 // os << "preTrigTBins = " << preTrigTBins << ", nCFEBs = "<< nCFEBs<< " ";
187  os << "trigSourceVect = " << bits.trigSourceVect
188  << ", activeCFEBs = " << bits.activeCFEBs <<"\n";
189  os << "bxnPreTrigger = " << bits.bxnPreTrigger << "\n";
190  os << "tmbMatch = " << bits.tmbMatch << " alctOnly = " << bits.alctOnly
191  << " clctOnly = " << bits.clctOnly << "\n";
192 // << " alctMatchTime = " << alctMatchTime << " ";
193 // os << "hs_thresh = " << hs_thresh << ", ds_thresh = " << ds_thresh
194 // << " ";
195  os << "clct0_key = " << bits.clct0_key << " bits.clct0_shape = " << bits.clct0_shape
196  << " clct0_quality = " << bits.clct0_quality << "\n";
197 // os << "r_buf_nbusy = " << r_buf_nbusy << " ";
198 
199  os << "..................CLCT....................." << "\n";
200 
201 }
202 
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:33
int getStrip() const
return the key halfstrip from 0,159
unsigned l1a() const
Definition: CSCDMBHeader.cc:74
uint16_t getSyncErr() const
virtual void addCLCT1(const CSCCLCTDigi &digi)
int getQuality() const
return the 4 bit Correlated LCT Quality
int getBend() const
return bend
int getStrip() const
return halfstrip that goes from 0 to 31
Definition: CSCCLCTDigi.h:45
virtual void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi)
int getBend() const
return bend
Definition: CSCCLCTDigi.h:42
virtual void addALCT1(const CSCALCTDigi &digi)
virtual void addALCT0(const CSCALCTDigi &digi)
virtual std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const
returns CorrelatedLCT digis
virtual unsigned short * data()
returns the first data word
virtual void print(std::ostream &os) const
int getCFEB() const
return Key CFEB ID
Definition: CSCCLCTDigi.h:48
tuple result
Definition: query.py:137
int getBX() const
return BX
Definition: CSCCLCTDigi.h:51
uint16_t getCSCID() const
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
struct CSCTMBHeader2007::@284 bits
int getBX() const
return BX
uint16_t getBX0() const
unsigned bxn() const
Definition: CSCDMBHeader.cc:61
unsigned short int sizeInWords() const
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:36
bool isValid() const
return valid pattern bit
unsigned dmbID() const
Definition: CSCDMBHeader.cc:56
int getPattern() const
return pattern
virtual void addCLCT0(const CSCCLCTDigi &digi)
Needed before data packing.
virtual void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi)
virtual std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer)
returns CLCT digis
int getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:74
int getKeyWG() const
return the key wire group
virtual void setEventInformation(const CSCDMBHeader &dmbHeader)