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 }
CSCTMBHeader2007_rev0x50c3::CSCTMBHeader2007_rev0x50c3
CSCTMBHeader2007_rev0x50c3()
Definition: CSCTMBHeader2007_rev0x50c3.cc:5
CSCTMBHeader2007_rev0x50c3::CorrelatedLCTDigis
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const override
returns CorrelatedLCT digis
Definition: CSCTMBHeader2007_rev0x50c3.cc:55
CSCTMBHeader2007_rev0x50c3::data
unsigned short * data() override
returns the first data word
Definition: CSCTMBHeader2007_rev0x50c3.h:40
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCTMBHeader2007_rev0x50c3.h
CSCCorrelatedLCTDigi::getStrip
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
Definition: CSCCorrelatedLCTDigi.cc:72
CSCCorrelatedLCTDigi::getKeyWG
uint16_t getKeyWG() const
return the key wire group. counts from 0.
Definition: CSCCorrelatedLCTDigi.h:61
CSCTMBHeader2007_rev0x50c3::setEventInformation
void setEventInformation(const CSCDMBHeader &dmbHeader) override
Definition: CSCTMBHeader2007_rev0x50c3.cc:19
CSCDMBHeader::l1a24
unsigned l1a24() const
Definition: CSCDMBHeader.h:40
CSCCLCTDigi::getKeyStrip
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:131
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCTMBHeader2007_rev0x50c3::addALCT1
void addALCT1(const CSCALCTDigi &digi) override
Definition: CSCTMBHeader2007_rev0x50c3.cc:96
CSCCLCTDigi::getQuality
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:56
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
CSCTMBHeader2007_rev0x50c3::CLCTDigis
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer) override
returns CLCT digis
Definition: CSCTMBHeader2007_rev0x50c3.cc:26
CSCDMBHeader.h
CSCCorrelatedLCTDigi::getBX0
uint16_t getBX0() const
Definition: CSCCorrelatedLCTDigi.h:134
CSCTMBHeader2007_rev0x50c3::sizeInWords
unsigned short int sizeInWords() const override
Definition: CSCTMBHeader2007_rev0x50c3.h:36
CSCCLCTDigi::getFullBX
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:165
CSCCorrelatedLCTDigi::getBend
uint16_t getBend() const
Definition: CSCCorrelatedLCTDigi.h:115
CSCCorrelatedLCTDigi::getCSCID
uint16_t getCSCID() const
Definition: CSCCorrelatedLCTDigi.h:133
CSCCLCTDigi::isValid
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCTMBHeader2007_rev0x50c3::addCorrelatedLCT0
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override
Definition: CSCTMBHeader2007_rev0x50c3.cc:135
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCCLCTDigi::getBX
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:123
CSCDMBHeader
Definition: CSCDMBHeader.h:15
CSCCorrelatedLCTDigi::getSyncErr
uint16_t getSyncErr() const
Definition: CSCCorrelatedLCTDigi.h:135
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:166
CSCCorrelatedLCTDigi::getPattern
uint16_t getPattern() const
Definition: CSCCorrelatedLCTDigi.cc:151
CSCTMBHeader2007_rev0x50c3::print
void print(std::ostream &os) const override
Definition: CSCTMBHeader2007_rev0x50c3.cc:169
Exception
Definition: hltDiff.cc:245
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCTMBHeader2007_rev0x50c3::bits
struct CSCTMBHeader2007_rev0x50c3::@478 bits
CSCTMBHeader2007_rev0x50c3::addCorrelatedLCT1
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
Definition: CSCTMBHeader2007_rev0x50c3.cc:152
Exception.h
CSCTMBHeader2007_rev0x50c3::addALCT0
void addALCT0(const CSCALCTDigi &digi) override
Definition: CSCTMBHeader2007_rev0x50c3.cc:92
CSCDMBHeader::dmbID
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
mps_fire.result
result
Definition: mps_fire.py:311
CSCCLCTDigi::getPattern
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.cc:88
CSCCorrelatedLCTDigi::getBX
uint16_t getBX() const
return BX
Definition: CSCCorrelatedLCTDigi.h:118
CSCCorrelatedLCTDigi::isValid
bool isValid() const
return valid pattern bit
Definition: CSCCorrelatedLCTDigi.h:55
CSCTMBHeader2007_rev0x50c3::addCLCT1
void addCLCT1(const CSCCLCTDigi &digi) override
Definition: CSCTMBHeader2007_rev0x50c3.cc:116
CSCCorrelatedLCTDigi::getQuality
uint16_t getQuality() const
return the Quality
Definition: CSCCorrelatedLCTDigi.h:58
CSCTMBHeader2007_rev0x50c3::addCLCT0
void addCLCT0(const CSCCLCTDigi &digi) override
Needed before data packing.
Definition: CSCTMBHeader2007_rev0x50c3.cc:100
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19