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 }
CSCTMBHeader2007::addCorrelatedLCT0
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override
Definition: CSCTMBHeader2007.cc:132
CSCTMBHeader2007::bits
struct CSCTMBHeader2007::@460 bits
CSCDMBHeader::l1a
unsigned l1a() const
Definition: CSCDMBHeader.h:39
CSCTMBHeader2007::addCorrelatedLCT1
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
Definition: CSCTMBHeader2007.cc:149
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
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::addALCT0
void addALCT0(const CSCALCTDigi &digi) override
Definition: CSCTMBHeader2007.cc:89
CSCTMBHeader2007::sizeInWords
unsigned short int sizeInWords() const override
Definition: CSCTMBHeader2007.h:36
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCTMBHeader2007::data
unsigned short * data() override
returns the first data word
Definition: CSCTMBHeader2007.h:40
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
CSCCLCTDigi::getBend
uint16_t getBend() const
Definition: CSCCLCTDigi.h:93
CSCDMBHeader.h
CSCCorrelatedLCTDigi::getBX0
uint16_t getBX0() const
Definition: CSCCorrelatedLCTDigi.h:134
CSCTMBHeader2007::addCLCT1
void addCLCT1(const CSCCLCTDigi &digi) override
Definition: CSCTMBHeader2007.cc:115
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
CSCTMBHeader2007::addALCT1
void addALCT1(const CSCALCTDigi &digi) override
Definition: CSCTMBHeader2007.cc:93
CSCCLCTDigi::getStrip
uint16_t getStrip() const
return halfstrip that goes from 0 to 31 in a (D)CFEB
Definition: CSCCLCTDigi.cc:157
CSCTMBHeader2007::CSCTMBHeader2007
CSCTMBHeader2007()
Definition: CSCTMBHeader2007.cc:5
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::print
void print(std::ostream &os) const override
Definition: CSCTMBHeader2007.cc:166
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCTMBHeader2007::CLCTDigis
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer) override
returns CLCT digis
Definition: CSCTMBHeader2007.cc:23
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
CSCTMBHeader2007.h
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:166
CSCCorrelatedLCTDigi::getPattern
uint16_t getPattern() const
Definition: CSCCorrelatedLCTDigi.cc:151
Exception
Definition: hltDiff.cc:245
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCTMBHeader2007::setEventInformation
void setEventInformation(const CSCDMBHeader &dmbHeader) override
Definition: CSCTMBHeader2007.cc:16
CSCCLCTDigi::getCFEB
uint16_t getCFEB() const
return Key CFEB ID
Definition: CSCCLCTDigi.h:117
Exception.h
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
CSCTMBHeader2007::addCLCT0
void addCLCT0(const CSCCLCTDigi &digi) override
Needed before data packing.
Definition: CSCTMBHeader2007.cc:97
CSCCorrelatedLCTDigi::isValid
bool isValid() const
return valid pattern bit
Definition: CSCCorrelatedLCTDigi.h:55
CSCCorrelatedLCTDigi::getQuality
uint16_t getQuality() const
return the Quality
Definition: CSCCorrelatedLCTDigi.h:58
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
CSCTMBHeader2007::CorrelatedLCTDigis
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const override
returns CorrelatedLCT digis
Definition: CSCTMBHeader2007.cc:52
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19