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