CMS 3D CMS Logo

CSCTMBHeader2007.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.nTBins = 7;
11  bits.nCFEBs = 5;
12 }
13 
14 CSCTMBHeader2007::CSCTMBHeader2007(const unsigned short* buf) { memcpy(data(), buf, sizeInWords() * 2); }
15 
17  bits.cscID = dmbHeader.dmbID();
18  bits.l1aNumber = dmbHeader.l1a();
19 }
20 
22 std::vector<CSCCLCTDigi> CSCTMBHeader2007::CLCTDigis(uint32_t idlayer) {
23  std::vector<CSCCLCTDigi> result;
24  int strip = bits.clct0_key;
25  int cfeb = (bits.clct0_cfeb_low) | (bits.clct0_cfeb_high << 1);
26  int pattern = bits.clct0_shape;
27  int bend = bits.clct0_bend;
28  //offlineStripNumbering(strip, cfeb, pattern, bend);
29  CSCCLCTDigi digi0(
30  bits.clct0_valid, bits.clct0_quality, pattern, 1, bend, strip, cfeb, bits.clct0_bxn, 1, bits.bxnPreTrigger);
31 
32  strip = bits.clct1_key;
33  cfeb = (bits.clct1_cfeb_low) | (bits.clct1_cfeb_high << 1);
34  pattern = bits.clct1_shape;
35  bend = bits.clct1_bend;
36  //offlineStripNumbering(strip, cfeb, pattern, bend);
37  CSCCLCTDigi digi1(
38  bits.clct1_valid, bits.clct1_quality, pattern, 1, bend, strip, cfeb, bits.clct1_bxn, 2, bits.bxnPreTrigger);
39 
40  //if (digi0.isValid() && digi1.isValid()) swapCLCTs(digi0, digi1);
41 
42  result.push_back(digi0);
43  result.push_back(digi1);
44 
45  return result;
46 }
47 
49 std::vector<CSCCorrelatedLCTDigi> CSCTMBHeader2007::CorrelatedLCTDigis(uint32_t idlayer) const {
50  std::vector<CSCCorrelatedLCTDigi> result;
52  int strip = bits.MPC_Muon0_halfstrip_clct_pattern; //this goes from 0-159
53  //offlineHalfStripNumbering(strip);
54  CSCCorrelatedLCTDigi digi(1,
55  bits.MPC_Muon0_vpf_,
56  bits.MPC_Muon0_quality_,
57  bits.MPC_Muon0_wire_,
58  strip,
59  bits.MPC_Muon0_clct_pattern_,
60  bits.MPC_Muon0_bend_,
61  bits.MPC_Muon0_bx_,
62  0,
63  bits.MPC_Muon0_bc0_,
64  bits.MPC_Muon0_SyncErr_,
65  bits.MPC_Muon0_cscid_low | (bits.MPC_Muon0_cscid_bit4 << 3));
66  result.push_back(digi);
68  strip = bits.MPC_Muon1_halfstrip_clct_pattern; //this goes from 0-159
69  //offlineHalfStripNumbering(strip);
70  digi = CSCCorrelatedLCTDigi(2,
71  bits.MPC_Muon1_vpf_,
72  bits.MPC_Muon1_quality_,
73  bits.MPC_Muon1_wire_,
74  strip,
75  bits.MPC_Muon1_clct_pattern_,
76  bits.MPC_Muon1_bend_,
77  bits.MPC_Muon1_bx_,
78  0,
79  bits.MPC_Muon1_bc0_,
80  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 
87  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
88 }
89 
91  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
92 }
93 
95  int strip = digi.getStrip();
96  int cfeb = digi.getCFEB();
97  int bend = digi.getBend();
98  int pattern = digi.getPattern();
99  //hardwareStripNumbering(strip, cfeb, pattern, bend);
100  bits.clct0_valid = digi.isValid();
101  bits.clct0_quality = digi.getQuality();
102  bits.clct0_shape = pattern;
103  bits.clct0_bend = bend;
104  bits.clct0_key = strip;
105  bits.clct0_cfeb_low = (cfeb & 0x1);
106  bits.clct0_cfeb_high = (cfeb >> 1);
107  bits.clct0_bxn = digi.getBX();
108  bits.bxnPreTrigger = digi.getFullBX();
109  bits.bxnCount = (digi.getFullBX() + 167) & 0xFFF;
110 }
111 
113  int strip = digi.getStrip();
114  int cfeb = digi.getCFEB();
115  int bend = digi.getBend();
116  int pattern = digi.getPattern();
117  //hardwareStripNumbering(strip, cfeb, pattern, bend);
118  bits.clct1_valid = digi.isValid();
119  bits.clct1_quality = digi.getQuality();
120  bits.clct1_shape = pattern;
121  bits.clct1_bend = bend;
122  bits.clct1_key = strip;
123  bits.clct1_cfeb_low = (cfeb & 0x1);
124  bits.clct1_cfeb_high = (cfeb >> 1);
125  bits.clct1_bxn = digi.getBX();
126  bits.bxnPreTrigger = digi.getFullBX();
127 }
128 
130  int halfStrip = digi.getStrip();
131  //hardwareHalfStripNumbering(halfStrip);
132 
133  bits.MPC_Muon0_vpf_ = digi.isValid();
134  bits.MPC_Muon0_wire_ = digi.getKeyWG();
135  bits.MPC_Muon0_clct_pattern_ = digi.getPattern();
136  bits.MPC_Muon0_quality_ = digi.getQuality();
137  bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip;
138  bits.MPC_Muon0_bend_ = digi.getBend();
139  bits.MPC_Muon0_SyncErr_ = digi.getSyncErr();
140  bits.MPC_Muon0_bx_ = digi.getBX();
141  bits.MPC_Muon0_bc0_ = digi.getBX0();
142  bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7;
143  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
144 }
145 
147  int halfStrip = digi.getStrip();
148  //hardwareHalfStripNumbering(halfStrip);
149 
150  bits.MPC_Muon1_vpf_ = digi.isValid();
151  bits.MPC_Muon1_wire_ = digi.getKeyWG();
152  bits.MPC_Muon1_clct_pattern_ = digi.getPattern();
153  bits.MPC_Muon1_quality_ = digi.getQuality();
154  bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip;
155  bits.MPC_Muon1_bend_ = digi.getBend();
156  bits.MPC_Muon1_SyncErr_ = digi.getSyncErr();
157  bits.MPC_Muon1_bx_ = digi.getBX();
158  bits.MPC_Muon1_bc0_ = digi.getBX0();
159  bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7;
160  bits.MPC_Muon1_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
161 }
162 
163 void CSCTMBHeader2007::print(std::ostream& os) const {
164  os << "...............TMB Header.................."
165  << "\n";
166  os << std::hex << "BOC LINE " << bits.b0cline << " EOB " << bits.e0bline << "\n";
167  os << std::dec << "fifoMode = " << bits.fifoMode << ", nTBins = " << bits.nTBins << "\n";
168  os << "boardID = " << bits.boardID << ", cscID = " << bits.cscID << "\n";
169  os << "l1aNumber = " << bits.l1aNumber << ", bxnCount = " << bits.bxnCount << "\n";
170  os << "trigSourceVect = " << bits.trigSourceVect << ", activeCFEBs = " << bits.activeCFEBs << "\n";
171  os << "bxnPreTrigger = " << bits.bxnPreTrigger << "\n";
172  os << "tmbMatch = " << bits.tmbMatch << " alctOnly = " << bits.alctOnly << " clctOnly = " << bits.clctOnly << "\n";
173  os << "clct0_key = " << bits.clct0_key << " bits.clct0_shape = " << bits.clct0_shape
174  << " clct0_quality = " << bits.clct0_quality << "\n";
175  os << "..................CLCT....................."
176  << "\n";
177 }
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
unsigned short int sizeInWords() const override
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const override
returns CorrelatedLCT digis
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 addALCT0(const CSCALCTDigi &digi) override
void addCLCT1(const CSCCLCTDigi &digi) override
uint16_t getStrip() const
return halfstrip that goes from 0 to 31 in a (D)CFEB
Definition: CSCCLCTDigi.h:99
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:165
unsigned short * data() override
returns the first data word
uint16_t getBX() const
return BX
uint16_t getBend() const
Definition: CSCCLCTDigi.h:93
bool isValid() const
return valid pattern bit
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer) override
returns CLCT digis
void print(std::ostream &os) const override
struct CSCTMBHeader2007::@493 bits
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
unsigned l1a() const
Definition: CSCDMBHeader.h:39
uint16_t getSyncErr() const
void addALCT1(const CSCALCTDigi &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
uint16_t getCFEB() const
return Key CFEB ID
Definition: CSCCLCTDigi.h:117
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.
void setEventInformation(const CSCDMBHeader &dmbHeader) override
void addCLCT0(const CSCCLCTDigi &digi) override
for data packing
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override