CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CSCCLCTData Class Reference

#include <CSCCLCTData.h>

Public Member Functions

void add (const CSCComparatorDigi &digi, int layer)
 TODO for packing. Doesn't do flipping yet. More...
 
void add (const CSCComparatorDigi &digi, const CSCDetId &id)
 TODO for packing. Doesn't do flipping yet. More...
 
bool bitValue (int cfeb, int tbin, int layer, int distrip)
 
bool check () const
 
std::vector< CSCComparatorDigicomparatorDigis (int layer)
 layers count from one More...
 
std::vector< CSCComparatorDigicomparatorDigis (uint32_t idlayer, unsigned icfeb)
 layers count from one More...
 
 CSCCLCTData (const CSCTMBHeader *tmbHeader)
 
 CSCCLCTData (int ncfebs, int ntbins, int firmware_version=2007)
 
 CSCCLCTData (int ncfebs, int ntbins, const unsigned short *e0bbuf, int firmware_version=2007)
 
unsigned short * data ()
 
CSCCLCTDataWorddataWord (int iline) const
 
CSCCLCTDataWorddataWord (int cfeb, int tbin, int layer) const
 
void dump () const
 
int nlines () const
 
int sizeInWords () const
 in 16-bit words More...
 

Static Public Member Functions

static void selfTest ()
 
static void setDebug (const bool value)
 

Private Member Functions

void zero ()
 

Private Attributes

int ncfebs_
 
int ntbins_
 
int size_
 
unsigned short theData [7 *6 *32]
 
int theFirmwareVersion
 

Static Private Attributes

static std::atomic< bool > debug {false}
 

Detailed Description

Definition at line 26 of file CSCCLCTData.h.

Constructor & Destructor Documentation

CSCCLCTData::CSCCLCTData ( const CSCTMBHeader tmbHeader)
explicit

Definition at line 17 of file CSCCLCTData.cc.

References CSCTMBHeader::FirmwareVersion(), nlines(), NULL, size_, theFirmwareVersion, and zero().

18  : ncfebs_(tmbHeader->NCFEBs()), ntbins_(tmbHeader->NTBins())
19 {
20  if (tmbHeader != NULL) theFirmwareVersion = tmbHeader->FirmwareVersion();
21  else theFirmwareVersion = 2007;
22  size_ = nlines();
23  zero();
24 }
uint16_t NTBins() const
Definition: CSCTMBHeader.h:79
int nlines() const
Definition: CSCCLCTData.h:47
#define NULL
Definition: scimark2.h:8
uint16_t NCFEBs() const
Definition: CSCTMBHeader.h:82
int theFirmwareVersion
Definition: CSCCLCTData.h:97
int FirmwareVersion() const
Definition: CSCTMBHeader.h:38
void zero()
Definition: CSCCLCTData.cc:49
CSCCLCTData::CSCCLCTData ( int  ncfebs,
int  ntbins,
int  firmware_version = 2007 
)

Definition at line 27 of file CSCCLCTData.cc.

References nlines(), size_, and zero().

28  : ncfebs_(ncfebs), ntbins_(ntbins), theFirmwareVersion(firmware_version)
29 {
30  size_ = nlines();
31  zero();
32 }
int nlines() const
Definition: CSCCLCTData.h:47
int theFirmwareVersion
Definition: CSCCLCTData.h:97
void zero()
Definition: CSCCLCTData.cc:49
CSCCLCTData::CSCCLCTData ( int  ncfebs,
int  ntbins,
const unsigned short *  e0bbuf,
int  firmware_version = 2007 
)

Definition at line 37 of file CSCCLCTData.cc.

References nlines(), size_, and theData.

38  : ncfebs_(ncfebs), ntbins_(ntbins), theFirmwareVersion(firmware_version)
39 {
40  // add two more for odd ntbins, plus one for the e0c
41  // Oct 2004 Rick: e0c line belongs to CSCTMBTrailer
42  size_ = (nlines()%2==1)? nlines()+2 : nlines();
43 
44  memcpy(theData, buf, size_*2);
45 
46 }
int nlines() const
Definition: CSCCLCTData.h:47
unsigned short theData[7 *6 *32]
Definition: CSCCLCTData.h:96
int theFirmwareVersion
Definition: CSCCLCTData.h:97

Member Function Documentation

void CSCCLCTData::add ( const CSCComparatorDigi digi,
int  layer 
)

TODO for packing. Doesn't do flipping yet.

!!! Do we need to introduce format version here to accomodate 7 CFEBs

Definition at line 222 of file CSCCLCTData.cc.

References assert(), dataWord(), CSCComparatorDigi::getComparator(), CSCComparatorDigi::getStrip(), CSCComparatorDigi::getTimeBinsOn(), ntbins_, and CSCCLCTDataWord::set().

Referenced by CSCEventData::add(), counter.Counter::register(), and selfTest().

223 {
224  //FIXME do flipping
225  int strip = digi.getStrip();
226  int halfStrip = (strip-1)*2 + digi.getComparator();
227  int cfeb = (strip-1)/16;
228  int distrip = ((strip-1)%16) / 2;
229 
230 
231  // assert(distrip < 8 && cfeb < 6 && halfStrip < 161);
233  assert(distrip < 8 && cfeb < 8 && halfStrip < 225);
234 
235  std::vector<int> timeBinsOn = digi.getTimeBinsOn();
236  for (std::vector<int>::const_iterator tbinItr = timeBinsOn.begin();
237  tbinItr != timeBinsOn.end(); ++tbinItr)
238  {
239  int tbin = *tbinItr;
240  if (tbin >= 0 && tbin < ntbins_-2)
241  {
242  // First triad bit indicates the presence of the hit
243  dataWord(cfeb, tbin, layer).set(distrip, true);
244  // Second bit indicates which of the two strips contains the hit
245  if (strip%2 == 0)
246  dataWord(cfeb, tbin+1, layer).set(distrip, true);
247  // Third bit indicates whether the hit is located on the left or on the
248  // right side of the strip.
249  if (digi.getComparator())
250  dataWord(cfeb, tbin+2, layer).set(distrip, true);
251 
252  }
253  }
254 }
int getStrip() const
Get the strip number.
void set(int distrip, bool value)
@ not right! doesn&#39;t set zero
Definition: CSCCLCTData.h:18
assert(m_qm.get())
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:54
int getComparator() const
Get Comparator readings.
std::vector< int > getTimeBinsOn() const
void CSCCLCTData::add ( const CSCComparatorDigi digi,
const CSCDetId id 
)

TODO for packing. Doesn't do flipping yet.

!!! Do we need to introduce format version here to accomodate 7 CFEBs

Definition at line 259 of file CSCCLCTData.cc.

References assert(), dataWord(), CSCDetId::endcap(), CSCComparatorDigi::getComparator(), CSCComparatorDigi::getStrip(), CSCComparatorDigi::getTimeBinsOn(), CSCDetId::layer(), ntbins_, CSCDetId::ring(), CSCCLCTDataWord::set(), CSCDetId::station(), theFirmwareVersion, and SurfaceOrientation::zplus.

Referenced by counter.Counter::register().

260 {
261 
262  static const bool doStripSwapping = true;
263  bool me1a = (cid.station()==1) && (cid.ring()==4);
264  bool zplus = (cid.endcap() == 1);
265  bool me1b = (cid.station()==1) && (cid.ring()==1);
266 // bool me11 = (cid.station()==1) && ((cid.ring()==1) || (cid.ring()==4));
267 
268  unsigned layer = cid.layer();
269 
270 
271  int strip = digi.getStrip();
272  int halfstrip = (strip-1)*2 + digi.getComparator();
273  int cfeb = (strip-1)/16;
274  int distrip = ((strip-1)%16) / 2;
275  int bit2 = (strip-1)%2;
276  int bit3 = digi.getComparator();
277 
278 
279 
280  // assert(distrip < 8 && cfeb < 6 && halfStrip < 161);
282  if (theFirmwareVersion >= 2013) {
283  assert(distrip < 8 && cfeb < 8 && halfstrip < 225);
284  } else {
285  assert(distrip < 8 && cfeb < 6 && halfstrip < 161);
286  }
287 
288  // Lets try to do ME11 strip flipping
289  if (doStripSwapping)
290  {
291 
292  if (theFirmwareVersion >= 2013)
293  {
294  if ( (me1a || (me1b && (cfeb > 3))) && zplus )
295  {
296  distrip = 7-distrip; // 0-7 -> 7-0
297  cfeb = 10 - cfeb;
298  bit2 = ((31-(halfstrip%32))%4)/2;
299  bit3 = ((31-(halfstrip%32))%4)%2;
300 
301  }
302  if ( me1b && !zplus && (cfeb<4))
303  {
304  distrip = 7-distrip;
305  cfeb = 3 - cfeb;
306  bit2 = ((31-(halfstrip%32))%4)/2;
307  bit3 = ((31-(halfstrip%32))%4)%2;
308 
309 
310  }
311  }
312  else
313  {
314  // if ( me1a ) { cfeb_corr = 0; } // reset 4 to 0
315  if ( (me1a || (me1b && (cfeb > 3))) && zplus )
316  {
317  distrip = 7-distrip; // 0-7 -> 7-0
318  bit2 = ((31-(halfstrip%32))%4)/2;
319  bit3 = ((31-(halfstrip%32))%4)%2;
320  }
321  if ( me1b && !zplus && (cfeb<4))
322  {
323  distrip = 7-distrip;
324  cfeb = 3 - cfeb;
325  bit2 = ((31-(halfstrip%32))%4)/2;
326  bit3 = ((31-(halfstrip%32))%4)%2;
327 
328 
329  }
330  }
331  }
332 
333 
334  std::vector<int> timeBinsOn = digi.getTimeBinsOn();
335  for (std::vector<int>::const_iterator tbinItr = timeBinsOn.begin();
336  tbinItr != timeBinsOn.end();
337  ++tbinItr)
338  {
339  int tbin = *tbinItr;
340  if (tbin >= 0 && tbin < ntbins_-2)
341  {
342  // First triad bit indicates the presence of the hit
343  dataWord(cfeb, tbin, layer).set(distrip, true);
344  // Second bit indicates which of the two strips contains the hit
345  // if (strip%2 == 0)
346  if (bit2)
347  dataWord(cfeb, tbin+1, layer).set(distrip, true);
348  // Third bit indicates whether the hit is located on the left or on the
349  // right side of the strip.
350  // if (digi.getComparator())
351  if (bit3)
352  dataWord(cfeb, tbin+2, layer).set(distrip, true);
353 
354  }
355  }
356 }
int getStrip() const
Get the strip number.
void set(int distrip, bool value)
@ not right! doesn&#39;t set zero
Definition: CSCCLCTData.h:18
assert(m_qm.get())
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:54
int getComparator() const
Get Comparator readings.
std::vector< int > getTimeBinsOn() const
int theFirmwareVersion
Definition: CSCCLCTData.h:97
bool CSCCLCTData::bitValue ( int  cfeb,
int  tbin,
int  layer,
int  distrip 
)
inline

Definition at line 68 of file CSCCLCTData.h.

References dataWord(), and CSCCLCTDataWord::value().

Referenced by comparatorDigis().

68  {
69  return dataWord(cfeb, tbin, layer).value(distrip);
70  }
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:54
bool value(int distrip)
Definition: CSCCLCTData.h:16
bool CSCCLCTData::check ( ) const

first do some checks

Definition at line 359 of file CSCCLCTData.cc.

References CSCCLCTDataWord::cfeb_, dataWord(), debug, LogTrace, ncfebs_, ntbins_, mps_fire::result, and CSCCLCTDataWord::tbin_.

Referenced by cscdqm::EventProcessor::processCSC(), and CSCTMBData::UnpackTMB().

360 {
361  bool result = true;
362  for (int cfeb = 0; cfeb < ncfebs_; ++cfeb)
363  {
364  for (int tbin = 0; tbin < ntbins_; ++tbin)
365  {
366  for (int layer = 1; layer <= 6; ++layer)
367  {
369  const CSCCLCTDataWord & word = dataWord(cfeb, tbin, layer);
370  bool wordIsGood = (word.tbin_ == tbin) && (word.cfeb_ == cfeb);
371  result = result && wordIsGood;
372  if (!wordIsGood && debug)
373  {
374  LogTrace("CSCCLCTData|CSCRawToDigi") << "Bad CLCT data in layer " << layer
375  << " expect CFEB " << cfeb << " tbin " << tbin;
376  LogTrace("CSCCLCTData|CSCRawToDigi") << " See " << word.cfeb_ << " "
377  << word.tbin_;
378  }
379  }
380  }
381  }
382  if (!result) LogTrace("CSCCLCTData|CSCRawToDigi") << "++ Bad CLCT Data ++ ";
383  return result;
384 }
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:54
unsigned short cfeb_
Definition: CSCCLCTData.h:21
tuple result
Definition: mps_fire.py:83
static std::atomic< bool > debug
Definition: CSCCLCTData.h:90
#define LogTrace(id)
unsigned short tbin_
Definition: CSCCLCTData.h:20
std::vector< CSCComparatorDigi > CSCCLCTData::comparatorDigis ( int  layer)

layers count from one

Definition at line 206 of file CSCCLCTData.cc.

References assert(), ncfebs_, and mps_fire::result.

Referenced by cscdqm::EventProcessor::processCSC(), and selfTest().

207 {
208  //returns comparators for one layer for all cfebs
209  std::vector<CSCComparatorDigi> result;
210  assert(layer>0 && layer<= 6);
211 
212  for (int cfeb = 0; cfeb < ncfebs_; ++cfeb)
213  {
214  std::vector<CSCComparatorDigi> oneCfebDigi = comparatorDigis(layer,cfeb);
215  result.insert(result.end(), oneCfebDigi.begin(), oneCfebDigi.end());
216  }
217 
218  return result;
219 }
assert(m_qm.get())
tuple result
Definition: mps_fire.py:83
std::vector< CSCComparatorDigi > comparatorDigis(int layer)
layers count from one
Definition: CSCCLCTData.cc:206
std::vector< CSCComparatorDigi > CSCCLCTData::comparatorDigis ( uint32_t  idlayer,
unsigned  icfeb 
)

layers count from one

first do some checks

what is actually stored in comparator digis are 0/1 for left/right halfstrip for each strip

constructing four bitted words for tbits on

Definition at line 65 of file CSCCLCTData.cc.

References assert(), bitValue(), CSCCLCTDataWord::cfeb_, dataWord(), debug, CSCDetId::endcap(), CSCDetId::layer(), LogTrace, ntbins_, convertSQLitetoXML_cfg::output, mps_fire::result, CSCDetId::ring(), CSCDetId::station(), CSCCLCTDataWord::tbin_, theFirmwareVersion, and SurfaceOrientation::zplus.

66 {
67  static const bool doStripSwapping = true;
68  bool me1a = (CSCDetId::station(idlayer)==1) && (CSCDetId::ring(idlayer)==4);
69  bool zplus = (CSCDetId::endcap(idlayer) == 1);
70  bool me1b = (CSCDetId::station(idlayer)==1) && (CSCDetId::ring(idlayer)==1);
71 // bool me11 = (CSCDetId::station(idlayer)==1) && ((CSCDetId::ring(idlayer)==1) || (CSCDetId::ring(idlayer)==4));
72  unsigned layer = CSCDetId::layer(idlayer);
73 
74 
75 
76  //looking for comp output on layer
77  std::vector<CSCComparatorDigi> result;
78  assert(layer>0 && layer<= 6);
79  // this is pretty sparse data, so I wish we could check the
80  // data word by word, not bit by bit, but I don't see how to
81  // do the time sequencing that way.
82  for (int distrip = 0; distrip < 8; ++distrip)
83  {
84  uint16_t tbinbitsS0HS0=0;
85  uint16_t tbinbitsS0HS1=0;
86  uint16_t tbinbitsS1HS0=0;
87  uint16_t tbinbitsS1HS1=0;
88  for (int tbin = 0; tbin < ntbins_-2; ++tbin)
89  {
90  if (bitValue(cfeb, tbin, layer, distrip))
91  {
93  CSCCLCTDataWord word = dataWord(cfeb, tbin, layer);
94  assert(word.tbin_ == tbin);
95  assert(word.cfeb_ == cfeb);
96  // we have a hit. The next two time samples
97  // are the other two bits in the triad
98  int bit2 = bitValue(cfeb, tbin+1, layer, distrip);
99  int bit3 = bitValue(cfeb, tbin+2, layer, distrip);
100  // should count from zero
101  int chamberDistrip = distrip + cfeb*8;
102  int HalfStrip = 4*chamberDistrip + bit2*2 + bit3;
103  int output = 4 + bit2*2 + bit3;
104  /*
105  * Handles distrip logic; comparator output is for pairs of strips:
106  * hit bin dec
107  * x--- 100 4
108  * -x-- 101 5
109  * --x- 110 6
110  * ---x 111 7
111  *
112  */
113 
114  if (debug)
115  LogTrace ("CSCCLCTData|CSCRawToDigi")
116  << "fillComparatorOutputs: layer = "
117  << layer << " timebin = " << tbin
118  << " cfeb = " << cfeb << " distrip = " << chamberDistrip
119  << " HalfStrip = " << HalfStrip
120  << " Output " << output << std::endl;
122 
124  if (output==4) tbinbitsS0HS0=tbinbitsS0HS0+(1<<tbin);
125  if (output==5) tbinbitsS0HS1=tbinbitsS0HS1+(1<<tbin);
126  if (output==6) tbinbitsS1HS0=tbinbitsS1HS0+(1<<tbin);
127  if (output==7) tbinbitsS1HS1=tbinbitsS1HS1+(1<<tbin);
128 
129  tbin += 2;
130  }
131  }//end of loop over time bins
132  //we do not have to check over the last couple of time bins if there are no hits since
133  //comparators take 3 time bins
134 
135  // Store digis each of possible four halfstrips for given distrip:
136  if (tbinbitsS0HS0 || tbinbitsS0HS1 || tbinbitsS1HS0 || tbinbitsS1HS1)
137  {
138  unsigned int cfeb_corr = cfeb;
139  unsigned int distrip_corr = distrip;
140 
141  if (doStripSwapping)
142  {
143  // Fix ordering of strips and CFEBs in ME1/1.
144  // SV, 27/05/08: keep CFEB=4 for ME1/a until CLCT trigger logic
145  // stops combining it with the info from the other 4 CFEBs (ME1/b).
146  //
147  if (theFirmwareVersion >= 2013)
148  {
149  if ( me1a && zplus )
150  {
151  distrip_corr = 7-distrip; // 0-7 -> 7-0
152  cfeb_corr = 10-cfeb;
153  }
154  if ( me1b && !zplus )
155  {
156  distrip_corr = 7-distrip;
157  cfeb_corr = 3-cfeb;
158  }
159  }
160  else
161  {
162  // if ( me1a ) { cfeb_corr = 0; } // reset 4 to 0
163  if ( me1a && zplus )
164  {
165  distrip_corr = 7-distrip; // 0-7 -> 7-0
166  }
167  if ( me1b && !zplus )
168  {
169  distrip_corr = 7-distrip;
170  cfeb_corr = 3-cfeb;
171  }
172  }
173  }
174 
175 
176  int strip = 16*cfeb_corr + 2*distrip_corr + 1;
177 
178  if (debug)
179  LogTrace ("CSCCLCTData|CSCRawToDigi")
180  << "fillComparatorOutputs: cfeb_corr = " << cfeb_corr
181  << " distrip_corr = " << distrip_corr << " strip = " << strip;
182 
183  if (doStripSwapping && (( me1a && zplus ) || ( me1b && !zplus )))
184  {
185  // Half-strips need to be flipped too.
186  if (tbinbitsS1HS1) result.push_back(CSCComparatorDigi(strip, 0, tbinbitsS1HS1));
187  if (tbinbitsS1HS0) result.push_back(CSCComparatorDigi(strip, 1, tbinbitsS1HS0));
188  if (tbinbitsS0HS1) result.push_back(CSCComparatorDigi(strip+1, 0, tbinbitsS0HS1));
189  if (tbinbitsS0HS0) result.push_back(CSCComparatorDigi(strip+1, 1, tbinbitsS0HS0));
190  }
191  else
192  {
193  if (tbinbitsS0HS0) result.push_back(CSCComparatorDigi(strip, 0, tbinbitsS0HS0));
194  if (tbinbitsS0HS1) result.push_back(CSCComparatorDigi(strip, 1, tbinbitsS0HS1));
195  if (tbinbitsS1HS0) result.push_back(CSCComparatorDigi(strip+1, 0, tbinbitsS1HS0));
196  if (tbinbitsS1HS1) result.push_back(CSCComparatorDigi(strip+1, 1, tbinbitsS1HS1));
197  }
198  //uh oh ugly ugly ugly!
199  }
200  }//end of loop over distrips
201  return result;
202 }
assert(m_qm.get())
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:54
unsigned short cfeb_
Definition: CSCCLCTData.h:21
int layer() const
Definition: CSCDetId.h:61
tuple result
Definition: mps_fire.py:83
int endcap() const
Definition: CSCDetId.h:93
bool bitValue(int cfeb, int tbin, int layer, int distrip)
Definition: CSCCLCTData.h:68
int theFirmwareVersion
Definition: CSCCLCTData.h:97
static std::atomic< bool > debug
Definition: CSCCLCTData.h:90
#define LogTrace(id)
int ring() const
Definition: CSCDetId.h:75
unsigned short tbin_
Definition: CSCCLCTData.h:20
int station() const
Definition: CSCDetId.h:86
unsigned short* CSCCLCTData::data ( )
inline

Definition at line 44 of file CSCCLCTData.h.

References theData.

Referenced by cuy.FindIssue::__init__(), and CSCTMBData::pack().

44 {return theData;}
unsigned short theData[7 *6 *32]
Definition: CSCCLCTData.h:96
CSCCLCTDataWord& CSCCLCTData::dataWord ( int  iline) const
inline

Definition at line 54 of file CSCCLCTData.h.

References assert(), ztail::d, ntuplemaker::iline, nlines(), alignCSCRings::s, and theData.

Referenced by add(), bitValue(), check(), comparatorDigis(), dataWord(), and zero().

54  {
55 #ifdef ASSERTS
56  assert(iline < nlines());
57 #endif
58  union dataPtr { const unsigned short * s; CSCCLCTDataWord * d; } mptr;
59  mptr.s = theData+iline;
60  return *(mptr.d);
61  }
int nlines() const
Definition: CSCCLCTData.h:47
assert(m_qm.get())
unsigned short theData[7 *6 *32]
Definition: CSCCLCTData.h:96
tuple d
Definition: ztail.py:151
CSCCLCTDataWord& CSCCLCTData::dataWord ( int  cfeb,
int  tbin,
int  layer 
) const
inline

Definition at line 63 of file CSCCLCTData.h.

References dataWord(), ntuplemaker::iline, and ntbins_.

63  {
64  int iline = (layer-1) + tbin*6 + cfeb*6*ntbins_;
65  return dataWord(iline);
66  }
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:54
void CSCCLCTData::dump ( void  ) const

Definition at line 387 of file CSCCLCTData.cc.

References i, size_, and theData.

388 {
389  for (int i=0; i<size_; i++)
390  {
391  printf("%04x %04x %04x %04x\n", theData[i+3], theData[i+2], theData[i+1], theData[i]);
392  i+=3;
393  }
394 }
int i
Definition: DBlmapReader.cc:9
unsigned short theData[7 *6 *32]
Definition: CSCCLCTData.h:96
int CSCCLCTData::nlines ( ) const
inline

Definition at line 47 of file CSCCLCTData.h.

References ncfebs_, and ntbins_.

Referenced by CSCCLCTData(), and dataWord().

47 { return ncfebs_*ntbins_*6; }
void CSCCLCTData::selfTest ( )
static

Definition at line 397 of file CSCCLCTData.cc.

References add(), assert(), and comparatorDigis().

398 {
399  CSCCLCTData clctData(5, 16);
400  // aim for output 4 in 5th time bin, = 0000000000010000
401  CSCComparatorDigi comparatorDigi1(1, 0, 0x10);
402  // aim for output 5 in 6th time bin, = 0000 0000 0010 0000
403  CSCComparatorDigi comparatorDigi2(39, 1, 0x20);
404  // aim for output 7 in 7th time bin, = 000 0000 0100 0000
405  CSCComparatorDigi comparatorDigi3(80, 1, 0x40);
406 
407  clctData.add(comparatorDigi1,1);
408  clctData.add(comparatorDigi2,4);
409  clctData.add(comparatorDigi3,6);
410 
411  CSCDetId layer1(1,4,1,2,1);
412  CSCDetId layer4(1,4,1,2,4);
413  CSCDetId layer6(1,4,1,2,6);
414 
415  std::vector<CSCComparatorDigi> digis1 = clctData.comparatorDigis(1);
416  std::vector<CSCComparatorDigi> digis2 = clctData.comparatorDigis(4);
417  std::vector<CSCComparatorDigi> digis3 = clctData.comparatorDigis(6);
418 
419  assert(digis1.size() == 1);
420  assert(digis2.size() == 1);
421  assert(digis3.size() == 1);
422 
423  assert(digis1[0].getStrip() == 1);
424  assert(digis1[0].getComparator() == 0);
425  assert(digis1[0].getTimeBin() == 4);
426 
427  assert(digis2[0].getStrip() == 39);
428  assert(digis2[0].getComparator() == 1);
429  assert(digis2[0].getTimeBin() == 5);
430 
431  assert(digis3[0].getStrip() == 80);
432  assert(digis3[0].getComparator() == 1);
433  assert(digis3[0].getTimeBin() == 6);
434 }
assert(m_qm.get())
static void CSCCLCTData::setDebug ( const bool  value)
inlinestatic

turns on/off debug flag for this class

Definition at line 35 of file CSCCLCTData.h.

References debug, and relativeConstraints::value.

Referenced by CSCDCCUnpacker::CSCDCCUnpacker().

35 {debug = value;};
static std::atomic< bool > debug
Definition: CSCCLCTData.h:90
int CSCCLCTData::sizeInWords ( ) const
inline

in 16-bit words

Definition at line 46 of file CSCCLCTData.h.

References size_.

Referenced by CSCTMBData::CSCTMBData(), CSCTMBData::pack(), and CSCTMBData::UnpackTMB().

46 { return size_;}
void CSCCLCTData::zero ( )
private

Definition at line 49 of file CSCCLCTData.cc.

References dataWord(), ncfebs_, and ntbins_.

Referenced by CSCCLCTData().

50 {
51  for (int ifeb = 0; ifeb < ncfebs_; ++ifeb)
52  {
53  for (int tbin = 0; tbin < ntbins_; ++tbin)
54  {
55  for (int layer = 1; layer <= 6; ++layer)
56  {
57  dataWord(ifeb, tbin, layer) = CSCCLCTDataWord(ifeb, tbin, 0);
58  }
59  }
60  }
61 
62 }
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:54

Member Data Documentation

std::atomic< bool > CSCCLCTData::debug {false}
staticprivate
int CSCCLCTData::ncfebs_
private

Definition at line 93 of file CSCCLCTData.h.

Referenced by check(), comparatorDigis(), nlines(), and zero().

int CSCCLCTData::ntbins_
private

Definition at line 94 of file CSCCLCTData.h.

Referenced by add(), check(), comparatorDigis(), dataWord(), nlines(), and zero().

int CSCCLCTData::size_
private

Definition at line 95 of file CSCCLCTData.h.

Referenced by CSCCLCTData(), dump(), and sizeInWords().

unsigned short CSCCLCTData::theData[7 *6 *32]
private

Definition at line 96 of file CSCCLCTData.h.

Referenced by CSCCLCTData(), data(), dataWord(), and dump().

int CSCCLCTData::theFirmwareVersion
private

Definition at line 97 of file CSCCLCTData.h.

Referenced by add(), comparatorDigis(), and CSCCLCTData().