CMS 3D CMS Logo

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