CMS 3D CMS Logo

CSCTMBHeader2006.cc
Go to the documentation of this file.
4 
6  bzero(data(), sizeInWords() * 2);
7  bits.nHeaderFrames = 26;
8  bits.e0bline = 0x6E0B;
9  bits.b0cline = 0x6B0C;
10  bits.nTBins = 7;
11  bits.nCFEBs = 5;
12 }
13 
14 CSCTMBHeader2006::CSCTMBHeader2006(const unsigned short* buf) { memcpy(&bits, 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> CSCTMBHeader2006::CLCTDigis(uint32_t idlayer) {
24  std::vector<CSCCLCTDigi> result;
27  int shape = 0;
28  int type = 0;
29 
30  if (bits.firmRevCode < 3769) { //3769 is may 25 2007 - date of firmware with halfstrip only patterns
31  shape = bits.clct0_shape;
32  type = bits.clct0_strip_type;
33  } else { //new firmware only halfstrip pattern => stripType==1 and shape is 4 bits
34  shape = (bits.clct0_strip_type << 3) + bits.clct0_shape;
35  type = 1;
36  }
37  int strip = bits.clct0_key;
38  int cfeb = (bits.clct0_cfeb_low) | (bits.clct0_cfeb_high << 1);
39  int bend = bits.clct0_bend;
40  //offlineStripNumbering(strip, cfeb, shape, bend);
41 
42  CSCCLCTDigi digi0(
43  bits.clct0_valid, bits.clct0_quality, shape, type, bend, strip, cfeb, bits.clct0_bxn, 1, bits.bxnPreTrigger);
44  //digi0.setFullBX(bits.bxnPreTrigger);
45  result.push_back(digi0);
46 
48  if (bits.firmRevCode < 3769) {
49  shape = bits.clct1_shape;
50  type = bits.clct1_strip_type;
51  } else {
52  shape = (bits.clct1_strip_type << 3) + bits.clct1_shape;
53  type = 1;
54  }
55 
56  strip = bits.clct1_key;
57  cfeb = (bits.clct1_cfeb_low) | (bits.clct1_cfeb_high << 1);
58  bend = bits.clct1_bend;
59  //offlineStripNumbering(strip, cfeb, shape, bend);
60  CSCCLCTDigi digi1(
61  bits.clct1_valid, bits.clct1_quality, shape, type, bend, strip, cfeb, bits.clct1_bxn, 2, bits.bxnPreTrigger);
62  //digi1.setFullBX(bits.bxnPreTrigger);
63  result.push_back(digi1);
64  return result;
65 }
66 
68 std::vector<CSCCorrelatedLCTDigi> CSCTMBHeader2006::CorrelatedLCTDigis(uint32_t idlayer) const {
69  std::vector<CSCCorrelatedLCTDigi> result;
71  int strip = bits.MPC_Muon0_halfstrip_clct_pattern; //this goes from 0-159
72  //offlineHalfStripNumbering(strip);
73  CSCCorrelatedLCTDigi digi(1,
74  bits.MPC_Muon0_vpf_,
75  bits.MPC_Muon0_quality_,
76  bits.MPC_Muon0_wire_,
77  strip,
78  bits.MPC_Muon0_clct_pattern_,
79  bits.MPC_Muon0_bend_,
80  bits.MPC_Muon0_bx_,
81  0,
82  bits.MPC_Muon0_bc0_,
83  bits.MPC_Muon0_SyncErr_,
84  bits.MPC_Muon0_cscid_low | (bits.MPC_Muon0_cscid_bit4 << 3));
85  result.push_back(digi);
87  strip = bits.MPC_Muon1_halfstrip_clct_pattern; //this goes from 0-159
88  //offlineHalfStripNumbering(strip);
89  digi = CSCCorrelatedLCTDigi(2,
90  bits.MPC_Muon1_vpf_,
91  bits.MPC_Muon1_quality_,
92  bits.MPC_Muon1_wire_,
93  strip,
94  bits.MPC_Muon1_clct_pattern_,
95  bits.MPC_Muon1_bend_,
96  bits.MPC_Muon1_bx_,
97  0,
98  bits.MPC_Muon1_bc0_,
99  bits.MPC_Muon1_SyncErr_,
100  bits.MPC_Muon1_cscid_low | (bits.MPC_Muon1_cscid_bit4 << 3));
101  result.push_back(digi);
102  return result;
103 }
104 
106  throw cms::Exception("In CSC TMBHeaderFormat 2006, ALCTs belong in ALCT header");
107 }
108 
110  throw cms::Exception("In CSC TMBHeaderFormat 2006, ALCTs belong in ALCT header");
111 }
112 
114  int strip = digi.getStrip();
115  int cfeb = digi.getCFEB();
116  int bend = digi.getBend();
117  int pattern = digi.getPattern();
118  //hardwareStripNumbering(strip, cfeb, pattern, bend);
119  bits.clct0_valid = digi.isValid();
120  bits.clct0_quality = digi.getQuality();
121  bits.clct0_shape = pattern;
122  bits.clct0_strip_type = digi.getStripType();
123  bits.clct0_bend = bend;
124  bits.clct0_key = strip;
125  bits.clct0_cfeb_low = (cfeb & 0x1);
126  bits.clct0_cfeb_high = (cfeb >> 1);
127  bits.clct0_bxn = digi.getBX();
128  bits.bxnPreTrigger = digi.getFullBX();
129 }
130 
132  int strip = digi.getStrip();
133  int cfeb = digi.getCFEB();
134  int bend = digi.getBend();
135  int pattern = digi.getPattern();
136  //hardwareStripNumbering(strip, cfeb, pattern, bend);
137  bits.clct1_valid = digi.isValid();
138  bits.clct1_quality = digi.getQuality();
139  bits.clct1_shape = pattern;
140  bits.clct1_strip_type = digi.getStripType();
141  bits.clct1_bend = bend;
142  bits.clct1_key = strip;
143  bits.clct1_cfeb_low = (cfeb & 0x1);
144  bits.clct1_cfeb_high = (cfeb >> 1);
145  bits.clct1_bxn = digi.getBX();
146  bits.bxnPreTrigger = digi.getFullBX();
147 }
148 
150  int halfStrip = digi.getStrip();
151  //hardwareHalfStripNumbering(halfStrip);
152 
153  bits.MPC_Muon0_vpf_ = digi.isValid();
154  bits.MPC_Muon0_wire_ = digi.getKeyWG();
155  bits.MPC_Muon0_clct_pattern_ = digi.getPattern();
156  bits.MPC_Muon0_quality_ = digi.getQuality();
157  bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip;
158  bits.MPC_Muon0_bend_ = digi.getBend();
159  bits.MPC_Muon0_SyncErr_ = digi.getSyncErr();
160  bits.MPC_Muon0_bx_ = digi.getBX();
161  bits.MPC_Muon0_bc0_ = digi.getBX0();
162  bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7;
163  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
164 }
165 
167  int halfStrip = digi.getStrip();
168  //hardwareHalfStripNumbering(halfStrip);
169 
170  bits.MPC_Muon1_vpf_ = digi.isValid();
171  bits.MPC_Muon1_wire_ = digi.getKeyWG();
172  bits.MPC_Muon1_clct_pattern_ = digi.getPattern();
173  bits.MPC_Muon1_quality_ = digi.getQuality();
174  bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip;
175  bits.MPC_Muon1_bend_ = digi.getBend();
176  bits.MPC_Muon1_SyncErr_ = digi.getSyncErr();
177  bits.MPC_Muon1_bx_ = digi.getBX();
178  bits.MPC_Muon1_bc0_ = digi.getBX0();
179  bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7;
180  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
181 }
182 
183 void CSCTMBHeader2006::print(std::ostream& os) const {
184  os << "...............TMB Header.................."
185  << "\n";
186  os << std::hex << "BOC LINE " << bits.b0cline << " EOB " << bits.e0bline << "\n";
187  os << std::dec << "fifoMode = " << bits.fifoMode << ", nTBins = " << bits.nTBins << "\n";
188  os << "dumpCFEBs = " << bits.dumpCFEBs << ", nHeaderFrames = " << bits.nHeaderFrames << "\n";
189  os << "boardID = " << bits.boardID << ", cscID = " << bits.cscID << "\n";
190  os << "l1aNumber = " << bits.l1aNumber << ", bxnCount = " << bits.bxnCount << "\n";
191  os << "preTrigTBins = " << bits.preTrigTBins << ", nCFEBs = " << bits.nCFEBs << "\n";
192  os << "trigSourceVect = " << bits.trigSourceVect << ", activeCFEBs = " << bits.activeCFEBs << "\n";
193  os << "bxnPreTrigger = " << bits.bxnPreTrigger << "\n";
194  os << "tmbMatch = " << bits.tmbMatch << " alctOnly = " << bits.alctOnly << " clctOnly = " << bits.clctOnly
195  << " alctMatchTime = " << bits.alctMatchTime << "\n";
196  os << "hs_thresh = " << bits.hs_thresh << ", ds_thresh = " << bits.ds_thresh << "\n";
197  os << ".clct0_key = " << bits.clct0_key << " clct0_shape = " << bits.clct0_shape
198  << " clct0_quality = " << bits.clct0_quality << "\n";
199  os << "r_buf_nbusy = " << bits.r_buf_nbusy << "\n";
200  os << "Firmware Rev code " << bits.firmRevCode << "\n";
201  os << "..................CLCT....................." << std::endl;
202 }
203 
204 //unsigned short * data() = 0;
CSCTMBHeader2006::addALCT1
void addALCT1(const CSCALCTDigi &digi) override
Definition: CSCTMBHeader2006.cc:109
CSCDMBHeader::l1a
unsigned l1a() const
Definition: CSCDMBHeader.h:39
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
CSCTMBHeader2006::addALCT0
void addALCT0(const CSCALCTDigi &digi) override
Definition: CSCTMBHeader2006.cc:105
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
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:91
CSCTMBHeader2006::addCorrelatedLCT1
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
Definition: CSCTMBHeader2006.cc:166
CSCDMBHeader.h
CSCCorrelatedLCTDigi::getBX0
uint16_t getBX0() const
Definition: CSCCorrelatedLCTDigi.h:127
CSCCLCTDigi::getFullBX
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:163
CSCCorrelatedLCTDigi::getBend
uint16_t getBend() const
return left/right bending
Definition: CSCCorrelatedLCTDigi.h:108
CSCCLCTDigi::getStrip
uint16_t getStrip() const
return halfstrip that goes from 0 to 31 in a (D)CFEB
Definition: CSCCLCTDigi.cc:159
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
CSCCLCTDigi::getStripType
uint16_t getStripType() const
return striptype
Definition: CSCCLCTDigi.h:83
CSCTMBHeader2006::setEventInformation
void setEventInformation(const CSCDMBHeader &dmbHeader) override
Definition: CSCTMBHeader2006.cc:16
CSCCorrelatedLCTDigi::getCSCID
uint16_t getCSCID() const
Definition: CSCCorrelatedLCTDigi.h:126
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
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCCLCTDigi::getBX
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:121
CSCTMBHeader2006::addCLCT0
void addCLCT0(const CSCCLCTDigi &digi) override
for data packing
Definition: CSCTMBHeader2006.cc:113
CSCTMBHeader2006::CSCTMBHeader2006
CSCTMBHeader2006()
Definition: CSCTMBHeader2006.cc:5
CSCTMBHeader2006::addCLCT1
void addCLCT1(const CSCCLCTDigi &digi) override
Definition: CSCTMBHeader2006.cc:131
CSCTMBHeader2006::bits
struct CSCTMBHeader2006::@454 bits
CSCDMBHeader
Definition: CSCDMBHeader.h:15
CSCCorrelatedLCTDigi::getSyncErr
uint16_t getSyncErr() const
Definition: CSCCorrelatedLCTDigi.h:128
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:160
CSCCorrelatedLCTDigi::getPattern
uint16_t getPattern() const
Definition: CSCCorrelatedLCTDigi.cc:138
Exception
Definition: hltDiff.cc:246
CSCTMBHeader2006::print
void print(std::ostream &os) const override
Definition: CSCTMBHeader2006.cc:183
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCCLCTDigi::getCFEB
uint16_t getCFEB() const
return Key CFEB ID
Definition: CSCCLCTDigi.h:115
Exception.h
CSCTMBHeader2006::sizeInWords
unsigned short int sizeInWords() const override
Definition: CSCTMBHeader2006.h:36
CSCDMBHeader::dmbID
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
mps_fire.result
result
Definition: mps_fire.py:311
CSCTMBHeader2006::CLCTDigis
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer) override
returns CLCT digis
Definition: CSCTMBHeader2006.cc:23
CSCCLCTDigi::getPattern
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.cc:88
CSCCorrelatedLCTDigi::getBX
uint16_t getBX() const
return BX
Definition: CSCCorrelatedLCTDigi.h:111
CSCTMBHeader2006::CorrelatedLCTDigis
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const override
returns CorrelatedLCT digis
Definition: CSCTMBHeader2006.cc:68
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
CSCTMBHeader2006::data
unsigned short * data() override
returns the first data word
Definition: CSCTMBHeader2006.h:40
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
CSCTMBHeader2006.h
CSCTMBHeader2006::addCorrelatedLCT0
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override
Definition: CSCTMBHeader2006.cc:149