CMS 3D CMS Logo

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 24 of file CSCCLCTData.h.

Constructor & Destructor Documentation

CSCCLCTData::CSCCLCTData ( const CSCTMBHeader tmbHeader)
explicit

Definition at line 16 of file CSCCLCTData.cc.

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

16  : ncfebs_(tmbHeader->NCFEBs()), ntbins_(tmbHeader->NTBins()) {
17  if (tmbHeader != nullptr)
18  theFirmwareVersion = tmbHeader->FirmwareVersion();
19  else
20  theFirmwareVersion = 2007;
21  size_ = nlines();
22  zero();
23 }
uint16_t NTBins() const
Definition: CSCTMBHeader.h:56
int nlines() const
Definition: CSCCLCTData.h:42
uint16_t NCFEBs() const
Definition: CSCTMBHeader.h:57
int theFirmwareVersion
Definition: CSCCLCTData.h:91
int FirmwareVersion() const
Definition: CSCTMBHeader.h:34
void zero()
Definition: CSCCLCTData.cc:40
CSCCLCTData::CSCCLCTData ( int  ncfebs,
int  ntbins,
int  firmware_version = 2007 
)

Definition at line 25 of file CSCCLCTData.cc.

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

26  : ncfebs_(ncfebs), ntbins_(ntbins), theFirmwareVersion(firmware_version) {
27  size_ = nlines();
28  zero();
29 }
int nlines() const
Definition: CSCCLCTData.h:42
int theFirmwareVersion
Definition: CSCCLCTData.h:91
void zero()
Definition: CSCCLCTData.cc:40
CSCCLCTData::CSCCLCTData ( int  ncfebs,
int  ntbins,
const unsigned short *  e0bbuf,
int  firmware_version = 2007 
)

Definition at line 31 of file CSCCLCTData.cc.

References nlines(), size_, and theData.

32  : ncfebs_(ncfebs), ntbins_(ntbins), theFirmwareVersion(firmware_version) {
33  // add two more for odd ntbins, plus one for the e0c
34  // Oct 2004 Rick: e0c line belongs to CSCTMBTrailer
35  size_ = (nlines() % 2 == 1) ? nlines() + 2 : nlines();
36 
37  memcpy(theData, buf, size_ * 2);
38 }
int nlines() const
Definition: CSCCLCTData.h:42
unsigned short theData[7 *6 *32]
Definition: CSCCLCTData.h:90
int theFirmwareVersion
Definition: CSCCLCTData.h:91

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 191 of file CSCCLCTData.cc.

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

Referenced by CSCEventData::add(), counter.Counter::register(), SequenceTypes.Task::remove(), SequenceTypes.Task::replace(), and selfTest().

191  {
192  //FIXME do flipping
193  int strip = digi.getStrip();
194  int halfStrip = (strip - 1) * 2 + digi.getComparator();
195  int cfeb = (strip - 1) / 16;
196  int distrip = ((strip - 1) % 16) / 2;
197 
198  // assert(distrip < 8 && cfeb < 6 && halfStrip < 161);
200  assert(distrip < 8 && cfeb < 8 && halfStrip < 225);
201 
202  std::vector<int> timeBinsOn = digi.getTimeBinsOn();
203  for (std::vector<int>::const_iterator tbinItr = timeBinsOn.begin(); tbinItr != timeBinsOn.end(); ++tbinItr) {
204  int tbin = *tbinItr;
205  if (tbin >= 0 && tbin < ntbins_ - 2) {
206  // First triad bit indicates the presence of the hit
207  dataWord(cfeb, tbin, layer).set(distrip, true);
208  // Second bit indicates which of the two strips contains the hit
209  if (strip % 2 == 0)
210  dataWord(cfeb, tbin + 1, layer).set(distrip, true);
211  // Third bit indicates whether the hit is located on the left or on the
212  // right side of the strip.
213  if (digi.getComparator())
214  dataWord(cfeb, tbin + 2, layer).set(distrip, true);
215  }
216  }
217 }
int getStrip() const
Get the strip number. Counts from 1.
void set(int distrip, bool value)
@ not right! doesn&#39;t set zero
Definition: CSCCLCTData.h:16
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:49
int getComparator() const
Get Comparator readings. Can be 0 or 1.
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 222 of file CSCCLCTData.cc.

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

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

222  {
223  static const bool doStripSwapping = true;
224  bool me1a = (cid.station() == 1) && (cid.ring() == 4);
225  bool zplus = (cid.endcap() == 1);
226  bool me1b = (cid.station() == 1) && (cid.ring() == 1);
227  // bool me11 = (cid.station()==1) && ((cid.ring()==1) || (cid.ring()==4));
228 
229  unsigned layer = cid.layer();
230 
231  int strip = digi.getStrip();
232  int halfstrip = (strip - 1) * 2 + digi.getComparator();
233  int cfeb = (strip - 1) / 16;
234  int distrip = ((strip - 1) % 16) / 2;
235  int bit2 = (strip - 1) % 2;
236  int bit3 = digi.getComparator();
237 
238  // assert(distrip < 8 && cfeb < 6 && halfStrip < 161);
240  if (theFirmwareVersion >= 2013) {
241  assert(distrip < 8 && cfeb < 8 && halfstrip < 225);
242  } else {
243  assert(distrip < 8 && cfeb < 6 && halfstrip < 161);
244  }
245 
246  // Lets try to do ME11 strip flipping
247  if (doStripSwapping) {
248  if (theFirmwareVersion >= 2013) {
249  if ((me1a || (me1b && (cfeb > 3))) && zplus) {
250  distrip = 7 - distrip; // 0-7 -> 7-0
251  cfeb = 10 - cfeb;
252  bit2 = ((31 - (halfstrip % 32)) % 4) / 2;
253  bit3 = ((31 - (halfstrip % 32)) % 4) % 2;
254  }
255  if (me1b && !zplus && (cfeb < 4)) {
256  distrip = 7 - distrip;
257  cfeb = 3 - cfeb;
258  bit2 = ((31 - (halfstrip % 32)) % 4) / 2;
259  bit3 = ((31 - (halfstrip % 32)) % 4) % 2;
260  }
261  } else {
262  // if ( me1a ) { cfeb_corr = 0; } // reset 4 to 0
263  if ((me1a || (me1b && (cfeb > 3))) && zplus) {
264  distrip = 7 - distrip; // 0-7 -> 7-0
265  bit2 = ((31 - (halfstrip % 32)) % 4) / 2;
266  bit3 = ((31 - (halfstrip % 32)) % 4) % 2;
267  }
268  if (me1b && !zplus && (cfeb < 4)) {
269  distrip = 7 - distrip;
270  cfeb = 3 - cfeb;
271  bit2 = ((31 - (halfstrip % 32)) % 4) / 2;
272  bit3 = ((31 - (halfstrip % 32)) % 4) % 2;
273  }
274  }
275  }
276 
277  std::vector<int> timeBinsOn = digi.getTimeBinsOn();
278  for (std::vector<int>::const_iterator tbinItr = timeBinsOn.begin(); tbinItr != timeBinsOn.end(); ++tbinItr) {
279  int tbin = *tbinItr;
280  if (tbin >= 0 && tbin < ntbins_ - 2) {
281  // First triad bit indicates the presence of the hit
282  dataWord(cfeb, tbin, layer).set(distrip, true);
283  // Second bit indicates which of the two strips contains the hit
284  // if (strip%2 == 0)
285  if (bit2)
286  dataWord(cfeb, tbin + 1, layer).set(distrip, true);
287  // Third bit indicates whether the hit is located on the left or on the
288  // right side of the strip.
289  // if (digi.getComparator())
290  if (bit3)
291  dataWord(cfeb, tbin + 2, layer).set(distrip, true);
292  }
293  }
294 }
int getStrip() const
Get the strip number. Counts from 1.
void set(int distrip, bool value)
@ not right! doesn&#39;t set zero
Definition: CSCCLCTData.h:16
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:49
int getComparator() const
Get Comparator readings. Can be 0 or 1.
std::vector< int > getTimeBinsOn() const
int theFirmwareVersion
Definition: CSCCLCTData.h:91
bool CSCCLCTData::bitValue ( int  cfeb,
int  tbin,
int  layer,
int  distrip 
)
inline

Definition at line 66 of file CSCCLCTData.h.

References RPCNoise_example::check, debug, and FrontierConditions_GlobalTag_cff::dump.

Referenced by comparatorDigis().

66 { return dataWord(cfeb, tbin, layer).value(distrip); }
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:49
bool value(int distrip)
Definition: CSCCLCTData.h:14
bool CSCCLCTData::check ( ) const

first do some checks

Definition at line 296 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().

296  {
297  bool result = true;
298  for (int cfeb = 0; cfeb < ncfebs_; ++cfeb) {
299  for (int tbin = 0; tbin < ntbins_; ++tbin) {
300  for (int layer = 1; layer <= 6; ++layer) {
302  const CSCCLCTDataWord& word = dataWord(cfeb, tbin, layer);
303  bool wordIsGood = (word.tbin_ == tbin) && (word.cfeb_ == cfeb);
304  result = result && wordIsGood;
305  if (!wordIsGood && debug) {
306  LogTrace("CSCCLCTData|CSCRawToDigi")
307  << "Bad CLCT data in layer " << layer << " expect CFEB " << cfeb << " tbin " << tbin;
308  LogTrace("CSCCLCTData|CSCRawToDigi") << " See " << word.cfeb_ << " " << word.tbin_;
309  }
310  }
311  }
312  }
313  if (!result)
314  LogTrace("CSCCLCTData|CSCRawToDigi") << "++ Bad CLCT Data ++ ";
315  return result;
316 }
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:49
unsigned short cfeb_
Definition: CSCCLCTData.h:19
uint64_t word
static std::atomic< bool > debug
Definition: CSCCLCTData.h:84
#define LogTrace(id)
unsigned short tbin_
Definition: CSCCLCTData.h:18
std::vector< CSCComparatorDigi > CSCCLCTData::comparatorDigis ( int  layer)

layers count from one

Definition at line 178 of file CSCCLCTData.cc.

References ncfebs_, and mps_fire::result.

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

178  {
179  //returns comparators for one layer for all cfebs
180  std::vector<CSCComparatorDigi> result;
181  assert(layer > 0 && layer <= 6);
182 
183  for (int cfeb = 0; cfeb < ncfebs_; ++cfeb) {
184  std::vector<CSCComparatorDigi> oneCfebDigi = comparatorDigis(layer, cfeb);
185  result.insert(result.end(), oneCfebDigi.begin(), oneCfebDigi.end());
186  }
187 
188  return result;
189 }
std::vector< CSCComparatorDigi > comparatorDigis(int layer)
layers count from one
Definition: CSCCLCTData.cc:178
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 50 of file CSCCLCTData.cc.

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

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

Definition at line 39 of file CSCCLCTData.h.

Referenced by CSCTMBData::pack().

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

Definition at line 49 of file CSCCLCTData.h.

References ztail::d, ntuplemaker::iline, and alignCSCRings::s.

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

49  {
50 #ifdef ASSERTS
51  assert(iline < nlines());
52 #endif
53  union dataPtr {
54  const unsigned short *s;
56  } mptr;
57  mptr.s = theData + iline;
58  return *(mptr.d);
59  }
int nlines() const
Definition: CSCCLCTData.h:42
unsigned short theData[7 *6 *32]
Definition: CSCCLCTData.h:90
d
Definition: ztail.py:151
CSCCLCTDataWord& CSCCLCTData::dataWord ( int  cfeb,
int  tbin,
int  layer 
) const
inline

Definition at line 61 of file CSCCLCTData.h.

References ntuplemaker::iline.

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

Definition at line 318 of file CSCCLCTData.cc.

References mps_fire::i, size_, and theData.

318  {
319  for (int i = 0; i < size_; i++) {
320  printf("%04x %04x %04x %04x\n", theData[i + 3], theData[i + 2], theData[i + 1], theData[i]);
321  i += 3;
322  }
323 }
unsigned short theData[7 *6 *32]
Definition: CSCCLCTData.h:90
int CSCCLCTData::nlines ( ) const
inline

Definition at line 42 of file CSCCLCTData.h.

References PVValHelper::add().

Referenced by CSCCLCTData().

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

Definition at line 325 of file CSCCLCTData.cc.

References add(), and comparatorDigis().

325  {
326  CSCCLCTData clctData(5, 16);
327  // aim for output 4 in 5th time bin, = 0000000000010000
328  CSCComparatorDigi comparatorDigi1(1, 0, 0x10);
329  // aim for output 5 in 6th time bin, = 0000 0000 0010 0000
330  CSCComparatorDigi comparatorDigi2(39, 1, 0x20);
331  // aim for output 7 in 7th time bin, = 000 0000 0100 0000
332  CSCComparatorDigi comparatorDigi3(80, 1, 0x40);
333 
334  clctData.add(comparatorDigi1, 1);
335  clctData.add(comparatorDigi2, 4);
336  clctData.add(comparatorDigi3, 6);
337 
338  CSCDetId layer1(1, 4, 1, 2, 1);
339  CSCDetId layer4(1, 4, 1, 2, 4);
340  CSCDetId layer6(1, 4, 1, 2, 6);
341 
342  std::vector<CSCComparatorDigi> digis1 = clctData.comparatorDigis(1);
343  std::vector<CSCComparatorDigi> digis2 = clctData.comparatorDigis(4);
344  std::vector<CSCComparatorDigi> digis3 = clctData.comparatorDigis(6);
345 
346  assert(digis1.size() == 1);
347  assert(digis2.size() == 1);
348  assert(digis3.size() == 1);
349 
350  assert(digis1[0].getStrip() == 1);
351  assert(digis1[0].getComparator() == 0);
352  assert(digis1[0].getTimeBin() == 4);
353 
354  assert(digis2[0].getStrip() == 39);
355  assert(digis2[0].getComparator() == 1);
356  assert(digis2[0].getTimeBin() == 5);
357 
358  assert(digis3[0].getStrip() == 80);
359  assert(digis3[0].getComparator() == 1);
360  assert(digis3[0].getTimeBin() == 6);
361 }
static void CSCCLCTData::setDebug ( const bool  value)
inlinestatic

turns on/off debug flag for this class

Definition at line 31 of file CSCCLCTData.h.

References debug, and CSCCLCTDataWord::value().

Referenced by CSCDCCUnpacker::CSCDCCUnpacker().

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

in 16-bit words

Definition at line 41 of file CSCCLCTData.h.

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

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

Definition at line 40 of file CSCCLCTData.cc.

References dataWord(), ncfebs_, and ntbins_.

Referenced by CSCCLCTData().

40  {
41  for (int ifeb = 0; ifeb < ncfebs_; ++ifeb) {
42  for (int tbin = 0; tbin < ntbins_; ++tbin) {
43  for (int layer = 1; layer <= 6; ++layer) {
44  dataWord(ifeb, tbin, layer) = CSCCLCTDataWord(ifeb, tbin, 0);
45  }
46  }
47  }
48 }
CSCCLCTDataWord & dataWord(int iline) const
Definition: CSCCLCTData.h:49

Member Data Documentation

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

Definition at line 87 of file CSCCLCTData.h.

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

int CSCCLCTData::ntbins_
private

Definition at line 88 of file CSCCLCTData.h.

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

int CSCCLCTData::size_
private

Definition at line 89 of file CSCCLCTData.h.

Referenced by CSCCLCTData(), and dump().

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

Definition at line 90 of file CSCCLCTData.h.

Referenced by CSCCLCTData(), and dump().

int CSCCLCTData::theFirmwareVersion
private

Definition at line 91 of file CSCCLCTData.h.

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