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  // bits.bxnCount = dmbHeader.bxn();
20 }
21 
23 std::vector<CSCCLCTDigi> CSCTMBHeader2007::CLCTDigis(uint32_t idlayer) {
24  std::vector<CSCCLCTDigi> result;
25  int strip = bits.clct0_key;
26  int cfeb = (bits.clct0_cfeb_low) | (bits.clct0_cfeb_high << 1);
27  int pattern = bits.clct0_shape;
28  int bend = bits.clct0_bend;
29  //offlineStripNumbering(strip, cfeb, pattern, bend);
30  CSCCLCTDigi digi0(
31  bits.clct0_valid, bits.clct0_quality, pattern, 1, bend, strip, cfeb, bits.clct0_bxn, 1, bits.bxnPreTrigger);
32  //digi0.setFullBX(bits.bxnPreTrigger);
33 
34  strip = bits.clct1_key;
35  cfeb = (bits.clct1_cfeb_low) | (bits.clct1_cfeb_high << 1);
36  pattern = bits.clct1_shape;
37  bend = bits.clct1_bend;
38  //offlineStripNumbering(strip, cfeb, pattern, bend);
39  CSCCLCTDigi digi1(
40  bits.clct1_valid, bits.clct1_quality, pattern, 1, bend, strip, cfeb, bits.clct1_bxn, 2, bits.bxnPreTrigger);
41  //digi1.setFullBX(bits.bxnPreTrigger);
42 
43  //if (digi0.isValid() && digi1.isValid()) swapCLCTs(digi0, digi1);
44 
45  result.push_back(digi0);
46  result.push_back(digi1);
47 
48  return result;
49 }
50 
52 std::vector<CSCCorrelatedLCTDigi> CSCTMBHeader2007::CorrelatedLCTDigis(uint32_t idlayer) const {
53  std::vector<CSCCorrelatedLCTDigi> result;
55  int strip = bits.MPC_Muon0_halfstrip_clct_pattern; //this goes from 0-159
56  //offlineHalfStripNumbering(strip);
57  CSCCorrelatedLCTDigi digi(1,
58  bits.MPC_Muon0_vpf_,
59  bits.MPC_Muon0_quality_,
60  bits.MPC_Muon0_wire_,
61  strip,
62  bits.MPC_Muon0_clct_pattern_,
63  bits.MPC_Muon0_bend_,
64  bits.MPC_Muon0_bx_,
65  0,
66  bits.MPC_Muon0_bc0_,
67  bits.MPC_Muon0_SyncErr_,
68  bits.MPC_Muon0_cscid_low | (bits.MPC_Muon0_cscid_bit4 << 3));
69  result.push_back(digi);
71  strip = bits.MPC_Muon1_halfstrip_clct_pattern; //this goes from 0-159
72  //offlineHalfStripNumbering(strip);
73  digi = CSCCorrelatedLCTDigi(2,
74  bits.MPC_Muon1_vpf_,
75  bits.MPC_Muon1_quality_,
76  bits.MPC_Muon1_wire_,
77  strip,
78  bits.MPC_Muon1_clct_pattern_,
79  bits.MPC_Muon1_bend_,
80  bits.MPC_Muon1_bx_,
81  0,
82  bits.MPC_Muon1_bc0_,
83  bits.MPC_Muon1_SyncErr_,
84  bits.MPC_Muon1_cscid_low | (bits.MPC_Muon1_cscid_bit4 << 3));
85  result.push_back(digi);
86  return result;
87 }
88 
90  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
91 }
92 
94  throw cms::Exception("In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
95 }
96 
98  int strip = digi.getStrip();
99  int cfeb = digi.getCFEB();
100  int bend = digi.getBend();
101  int pattern = digi.getPattern();
102  //hardwareStripNumbering(strip, cfeb, pattern, bend);
103  bits.clct0_valid = digi.isValid();
104  bits.clct0_quality = digi.getQuality();
105  bits.clct0_shape = pattern;
106  bits.clct0_bend = bend;
107  bits.clct0_key = strip;
108  bits.clct0_cfeb_low = (cfeb & 0x1);
109  bits.clct0_cfeb_high = (cfeb >> 1);
110  bits.clct0_bxn = digi.getBX();
111  bits.bxnPreTrigger = digi.getFullBX();
112  bits.bxnCount = (digi.getFullBX() + 167) & 0xFFF;
113 }
114 
116  int strip = digi.getStrip();
117  int cfeb = digi.getCFEB();
118  int bend = digi.getBend();
119  int pattern = digi.getPattern();
120  //hardwareStripNumbering(strip, cfeb, pattern, bend);
121  bits.clct1_valid = digi.isValid();
122  bits.clct1_quality = digi.getQuality();
123  bits.clct1_shape = pattern;
124  bits.clct1_bend = bend;
125  bits.clct1_key = strip;
126  bits.clct1_cfeb_low = (cfeb & 0x1);
127  bits.clct1_cfeb_high = (cfeb >> 1);
128  bits.clct1_bxn = digi.getBX();
129  bits.bxnPreTrigger = digi.getFullBX();
130 }
131 
133  int halfStrip = digi.getStrip();
134  //hardwareHalfStripNumbering(halfStrip);
135 
136  bits.MPC_Muon0_vpf_ = digi.isValid();
137  bits.MPC_Muon0_wire_ = digi.getKeyWG();
138  bits.MPC_Muon0_clct_pattern_ = digi.getPattern();
139  bits.MPC_Muon0_quality_ = digi.getQuality();
140  bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip;
141  bits.MPC_Muon0_bend_ = digi.getBend();
142  bits.MPC_Muon0_SyncErr_ = digi.getSyncErr();
143  bits.MPC_Muon0_bx_ = digi.getBX();
144  bits.MPC_Muon0_bc0_ = digi.getBX0();
145  bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7;
146  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
147 }
148 
150  int halfStrip = digi.getStrip();
151  //hardwareHalfStripNumbering(halfStrip);
152 
153  bits.MPC_Muon1_vpf_ = digi.isValid();
154  bits.MPC_Muon1_wire_ = digi.getKeyWG();
155  bits.MPC_Muon1_clct_pattern_ = digi.getPattern();
156  bits.MPC_Muon1_quality_ = digi.getQuality();
157  bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip;
158  bits.MPC_Muon1_bend_ = digi.getBend();
159  bits.MPC_Muon1_SyncErr_ = digi.getSyncErr();
160  bits.MPC_Muon1_bx_ = digi.getBX();
161  bits.MPC_Muon1_bc0_ = digi.getBX0();
162  bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7;
163  bits.MPC_Muon1_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
164 }
165 
166 void CSCTMBHeader2007::print(std::ostream& os) const {
167  os << "...............TMB Header.................."
168  << "\n";
169  os << std::hex << "BOC LINE " << bits.b0cline << " EOB " << bits.e0bline << "\n";
170  os << std::dec << "fifoMode = " << bits.fifoMode << ", nTBins = " << bits.nTBins << "\n";
171  // os << "dumpCFEBs = " << dumpCFEBs << ", nHeaderFrames = "
172  // << nHeaderFrames << "\n";
173  os << "boardID = " << bits.boardID << ", cscID = " << bits.cscID << "\n";
174  os << "l1aNumber = " << bits.l1aNumber << ", bxnCount = " << bits.bxnCount << "\n";
175  // os << "preTrigTBins = " << preTrigTBins << ", nCFEBs = "<< nCFEBs<< " ";
176  os << "trigSourceVect = " << bits.trigSourceVect << ", activeCFEBs = " << bits.activeCFEBs << "\n";
177  os << "bxnPreTrigger = " << bits.bxnPreTrigger << "\n";
178  os << "tmbMatch = " << bits.tmbMatch << " alctOnly = " << bits.alctOnly << " clctOnly = " << bits.clctOnly << "\n";
179  // << " alctMatchTime = " << alctMatchTime << " ";
180  // os << "hs_thresh = " << hs_thresh << ", ds_thresh = " << ds_thresh
181  // << " ";
182  os << "clct0_key = " << bits.clct0_key << " bits.clct0_shape = " << bits.clct0_shape
183  << " clct0_quality = " << bits.clct0_quality << "\n";
184  // os << "r_buf_nbusy = " << r_buf_nbusy << " ";
185 
186  os << "..................CLCT....................."
187  << "\n";
188 }
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 print(std::ostream &os) const override
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
unsigned l1a() const
Definition: CSCDMBHeader.h:39
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:65
void addCLCT1(const CSCCLCTDigi &digi) override
int getBend() const
return bend
Definition: CSCCLCTDigi.h:59
int getCFEB() const
return Key CFEB ID
Definition: CSCCLCTDigi.h:71
int getBX() const
return BX
Definition: CSCCLCTDigi.h:77
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:35
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:47
bool isValid() const
return valid pattern bit
void setEventInformation(const CSCDMBHeader &dmbHeader) override
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
int getPattern() const
return pattern
void addCLCT0(const CSCCLCTDigi &digi) override
Needed before data packing.
struct CSCTMBHeader2007::@419 bits
int getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:103
int getKeyWG() const
return the key wire group. counts from 0.
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override