CMS 3D CMS Logo

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