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 | Static Public Attributes | Private Member Functions | Private Attributes
CSCEventData Class Reference

#include <CSCEventData.h>

Public Member Functions

void add (const CSCStripDigi &, int layer)
 routines to add digis to the data More...
 
void add (const CSCWireDigi &, int layer)
 
void add (const CSCComparatorDigi &, int layer)
 
void add (const std::vector< CSCALCTDigi > &)
 these go in as vectors, so they get sorted right away More...
 
void add (const std::vector< CSCCLCTDigi > &)
 
void add (const std::vector< CSCCorrelatedLCTDigi > &)
 
void addALCTStructures ()
 adds an empty ALCTHeader, trailer, and anode data More...
 
CSCAnodeDataalctData () const
 user must check if nalct > 0 More...
 
CSCALCTHeaderalctHeader () const
 user must check if nalct > 0 More...
 
CSCALCTTraileralctTrailer () const
 user must check if nalct > 0 More...
 
CSCCFEBDatacfebData (unsigned icfeb) const
 unpacked in long mode: has overflow and error bits decoded More...
 
int chamberType () const
 might not be set in real data More...
 
CSCCLCTDataclctData () const
 user must check if nclct > 0 More...
 
 CSCEventData (int chamberType)
 
 CSCEventData (unsigned short *buf)
 should make const input soon More...
 
 CSCEventData ()
 
 CSCEventData (const CSCEventData &data)
 
const CSCDMBHeaderdmbHeader () const
 the DAQ motherboard header. A good place for event and chamber info More...
 
CSCDMBHeaderdmbHeader ()
 
const CSCDMBTrailerdmbTrailer () const
 DMB trailer. More...
 
bool isALCT (const short unsigned int *buf)
 if dealing with ALCT data More...
 
bool isTMB (const short unsigned int *buf)
 if dealing with TMB data More...
 
int nalct () const
 the flag for existence of ALCT data More...
 
int nclct () const
 the number of CLCTs More...
 
CSCEventData operator= (const CSCEventData &data)
 
boost::dynamic_bitset pack ()
 returns the packed event data. More...
 
void setEventInformation (int bxnum, int lvl1num)
 
unsigned short size () const
 size of the data buffer used, in bytes More...
 
std::vector< CSCStripDigistripDigis (const CSCDetId &idlayer) const
 returns all the strip digis in the chamber, with the comparator information. More...
 
std::vector< CSCStripDigistripDigis (unsigned idlayer, unsigned icfeb) const
 returns all the strip digis in the chamber's cfeb More...
 
std::vector< std::vector
< CSCStripDigi > > 
stripDigis () const
 deprecated. Use the above methods instead More...
 
CSCTMBDatatmbData () const
 user must check in nclct > 0 More...
 
CSCTMBHeadertmbHeader () const
 user must check if nclct > 0 More...
 
std::vector< CSCWireDigiwireDigis (unsigned ilayer) const
 
std::vector< std::vector
< CSCWireDigi > > 
wireDigis () const
 deprecated. Use the above method instead. More...
 
 ~CSCEventData ()
 

Static Public Member Functions

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

Static Public Attributes

static bool debug = false
 

Private Member Functions

void addComparatorInformation (std::vector< CSCStripDigi > &, int layer) const
 adds the comparators to the strip digis More...
 
void checkALCTClasses ()
 makes new ALCT classes, if needed More...
 
void checkTMBClasses ()
 makes new TMB classes, if needed More...
 
void copy (const CSCEventData &)
 
void destroy ()
 
void init ()
 
void unpack_data (unsigned short *buf)
 

Private Attributes

unsigned short * alctZSErecovered
 Auxiliary bufer to recove the ALCT raw payload from zero suppression. More...
 
int size_
 
CSCALCTHeadertheALCTHeader
 
CSCALCTTrailertheALCTTrailer
 
CSCAnodeDatatheAnodeData
 
CSCCFEBDatatheCFEBData [5]
 for up to 5 CFEB boards More...
 
int theChamberType
 
CSCDMBHeader theDMBHeader
 
CSCDMBTrailer theDMBTrailer
 
CSCTMBDatatheTMBData
 
int zseEnable
 

Detailed Description

Definition at line 36 of file CSCEventData.h.

Constructor & Destructor Documentation

CSCEventData::CSCEventData ( int  chamberType)
explicit

Definition at line 14 of file CSCEventData.cc.

References i, and theCFEBData.

14  :
15  theDMBHeader(),
16  theALCTHeader(0),
17  theAnodeData(0),
18  theALCTTrailer(0),
19  theTMBData(0),
20  theDMBTrailer(),
23  zseEnable(0)
24 {
25 
26  for(unsigned i = 0; i < 5; ++i) {
27  theCFEBData[i] = 0;
28  }
29 }
int i
Definition: DBlmapReader.cc:9
unsigned short * alctZSErecovered
Auxiliary bufer to recove the ALCT raw payload from zero suppression.
Definition: CSCEventData.h:178
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
CSCDMBTrailer theDMBTrailer
Definition: CSCEventData.h:170
CSCALCTTrailer * theALCTTrailer
Definition: CSCEventData.h:164
int chamberType() const
might not be set in real data
Definition: CSCEventData.h:134
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
CSCEventData::CSCEventData ( unsigned short *  buf)

should make const input soon

Definition at line 32 of file CSCEventData.cc.

References unpack_data().

32  {
33  unpack_data(buf);
34 }
void unpack_data(unsigned short *buf)
Definition: CSCEventData.cc:37
CSCEventData::CSCEventData ( )
inline

Definition at line 41 of file CSCEventData.h.

41 {}
CSCEventData::~CSCEventData ( )

since we need deep copies, need the Big Three (destructor, copy ctor, op=)

Definition at line 261 of file CSCEventData.cc.

References destroy().

261  {
262  destroy();
263 }
CSCEventData::CSCEventData ( const CSCEventData data)

Definition at line 257 of file CSCEventData.cc.

References copy().

257  {
258  copy(data);
259 }
void copy(const CSCEventData &)

Member Function Documentation

void CSCEventData::add ( const CSCStripDigi digi,
int  layer 
)

routines to add digis to the data

Definition at line 455 of file CSCEventData.cc.

References CSCCFEBData::add(), CSCDMBHeader::addCFEB(), CSCStripDigi::getADCCounts(), CSCStripDigi::getStrip(), theCFEBData, and theDMBHeader.

Referenced by CSCDigiToRaw::add(), and selfTest().

455  {
456  //@@ need special logic here for ME11
457  unsigned cfeb = (digi.getStrip()-1)/16;
458  bool sixteenSamples = false;
459  if (digi.getADCCounts().size()==16) sixteenSamples = true;
460  if(theCFEBData[cfeb] == 0) {
461  theCFEBData[cfeb] = new CSCCFEBData(cfeb, sixteenSamples);
462  theDMBHeader.addCFEB(cfeb);
463  }
464  theCFEBData[cfeb]->add(digi, layer);
465 }
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:54
void add(const CSCStripDigi &, int layer)
Definition: CSCCFEBData.cc:80
int getStrip() const
Definition: CSCStripDigi.h:51
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
void addCFEB(int icfeb)
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
void CSCEventData::add ( const CSCWireDigi digi,
int  layer 
)

Definition at line 468 of file CSCEventData.cc.

References CSCAnodeData::add(), checkALCTClasses(), CSCWireDigi::getWireGroup(), CSCALCTHeader::setDAVForChannel(), theALCTHeader, and theAnodeData.

468  {
470  theAnodeData->add(digi, layer);
472 }
void checkALCTClasses()
makes new ALCT classes, if needed
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
void add(const CSCWireDigi &wireDigi, int layer)
Definition: CSCAnodeData.h:27
int getWireGroup() const
default
Definition: CSCWireDigi.h:24
void setDAVForChannel(int wireGroup)
Definition: CSCALCTHeader.h:88
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
void CSCEventData::add ( const CSCComparatorDigi digi,
int  layer 
)

Definition at line 474 of file CSCEventData.cc.

References CSCCLCTData::add(), checkTMBClasses(), CSCTMBData::clctData(), and theTMBData.

474  {
475  checkTMBClasses();
476  theTMBData->clctData()->add(digi, layer);
477 }
CSCCLCTData * clctData()
Definition: CSCTMBData.h:39
void checkTMBClasses()
makes new TMB classes, if needed
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
void add(const CSCComparatorDigi &digi, int layer)
TODO for packing. Doesn&#39;t do flipping yet.
Definition: CSCCLCTData.cc:184
void CSCEventData::add ( const std::vector< CSCALCTDigi > &  digis)

these go in as vectors, so they get sorted right away

Definition at line 481 of file CSCEventData.cc.

References CSCALCTHeader::add(), checkALCTClasses(), and theALCTHeader.

481  {
483  theALCTHeader->add(digis);
484 }
void checkALCTClasses()
makes new ALCT classes, if needed
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
void add(const std::vector< CSCALCTDigi > &digis)
void CSCEventData::add ( const std::vector< CSCCLCTDigi > &  digis)

Definition at line 487 of file CSCEventData.cc.

References CSCTMBHeader::add(), checkTMBClasses(), theTMBData, and CSCTMBData::tmbHeader().

487  {
488  checkTMBClasses();
489  theTMBData->tmbHeader()->add(digis);
490 }
void checkTMBClasses()
makes new TMB classes, if needed
void add(const std::vector< CSCCLCTDigi > &digis)
these methods need more brains to figure which one goes first
Definition: CSCTMBHeader.cc:99
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:38
void CSCEventData::add ( const std::vector< CSCCorrelatedLCTDigi > &  digis)

Definition at line 492 of file CSCEventData.cc.

References CSCTMBHeader::add(), checkTMBClasses(), theTMBData, and CSCTMBData::tmbHeader().

492  {
493  checkTMBClasses();
494  theTMBData->tmbHeader()->add(digis);
495 }
void checkTMBClasses()
makes new TMB classes, if needed
void add(const std::vector< CSCCLCTDigi > &digis)
these methods need more brains to figure which one goes first
Definition: CSCTMBHeader.cc:99
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:38
void CSCEventData::addALCTStructures ( )

adds an empty ALCTHeader, trailer, and anode data

void CSCEventData::addComparatorInformation ( std::vector< CSCStripDigi > &  ,
int  layer 
) const
private

adds the comparators to the strip digis

CSCAnodeData * CSCEventData::alctData ( ) const

user must check if nalct > 0

Definition at line 396 of file CSCEventData.cc.

References edm::hlt::Exception, nalct(), and theAnodeData.

Referenced by cscdqm::EventProcessor::processCSC().

396  {
397  if(nalct() == 0) throw cms::Exception("No ALCT for this chamber");
398  return theAnodeData;
399 }
int nalct() const
the flag for existence of ALCT data
Definition: CSCEventData.h:84
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
CSCALCTHeader * CSCEventData::alctHeader ( ) const

user must check if nalct > 0

Definition at line 385 of file CSCEventData.cc.

References edm::hlt::Exception, nalct(), and theALCTHeader.

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

385  {
386  if(nalct() == 0) throw cms::Exception("No ALCT for this chamber");
387  return theALCTHeader;
388 }
int nalct() const
the flag for existence of ALCT data
Definition: CSCEventData.h:84
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
CSCALCTTrailer * CSCEventData::alctTrailer ( ) const

user must check if nalct > 0

Definition at line 390 of file CSCEventData.cc.

References edm::hlt::Exception, nalct(), and theALCTTrailer.

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

390  {
391  if(nalct() == 0) throw cms::Exception("No ALCT for this chamber");
392  return theALCTTrailer;
393 }
int nalct() const
the flag for existence of ALCT data
Definition: CSCEventData.h:84
CSCALCTTrailer * theALCTTrailer
Definition: CSCEventData.h:164
CSCCFEBData * CSCEventData::cfebData ( unsigned  icfeb) const

unpacked in long mode: has overflow and error bits decoded

Definition at line 380 of file CSCEventData.cc.

References theCFEBData.

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

380  {
381  return theCFEBData[icfeb];
382 }
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
int CSCEventData::chamberType ( ) const
inline

might not be set in real data

Definition at line 134 of file CSCEventData.h.

References theChamberType.

134 {return theChamberType;}
void CSCEventData::checkALCTClasses ( )
private

makes new ALCT classes, if needed

Definition at line 430 of file CSCEventData.cc.

References CSCDMBHeader::addNALCT(), CSCALCTHeader::alctFirmwareVersion(), NULL, CSCALCTHeader::setEventInformation(), size(), CSCAnodeData::sizeInWords(), CSCALCTTrailer::sizeInWords(), CSCALCTHeader::sizeInWords(), theALCTHeader, theALCTTrailer, theAnodeData, theChamberType, and theDMBHeader.

Referenced by add().

430  {
431  if(theAnodeData == NULL)
432  {
433  assert(theChamberType>0);
439  // set data available flag
441  }
442 }
unsigned short int sizeInWords() const
the amount of the input binary buffer read, in 16-bit words
Definition: CSCAnodeData.h:21
#define NULL
Definition: scimark2.h:8
void setEventInformation(const CSCDMBHeader &)
static int sizeInWords()
in 16-bit frames
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
int sizeInWords()
in 16-bit words
Definition: CSCALCTHeader.h:99
CSCALCTTrailer * theALCTTrailer
Definition: CSCEventData.h:164
unsigned short int alctFirmwareVersion() const
Definition: CSCALCTHeader.h:87
unsigned short size() const
size of the data buffer used, in bytes
Definition: CSCEventData.h:49
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
void CSCEventData::checkTMBClasses ( )
private

makes new TMB classes, if needed

Definition at line 445 of file CSCEventData.cc.

References CSCDMBHeader::addNCLCT(), NULL, CSCTMBHeader::setEventInformation(), theDMBHeader, theTMBData, and CSCTMBData::tmbHeader().

Referenced by add().

446 {
447  if(theTMBData == NULL) {
448  theTMBData = new CSCTMBData();
451  }
452 }
void setEventInformation(const CSCDMBHeader &dmbHeader)
fills fields like bxn and l1a
Definition: CSCTMBHeader.h:28
#define NULL
Definition: scimark2.h:8
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:38
CSCCLCTData * CSCEventData::clctData ( ) const

user must check if nclct > 0

Definition at line 412 of file CSCEventData.cc.

References CSCTMBData::clctData(), edm::hlt::Exception, nclct(), NULL, and tmbData().

Referenced by cscdqm::EventProcessor::processCSC().

412  {
413  if((nclct() == 0)||(tmbData()==NULL)) throw cms::Exception("No CLCT data for this chamber");
414  return tmbData()->clctData();
415 }
CSCCLCTData * clctData()
Definition: CSCTMBData.h:39
int nclct() const
the number of CLCTs
Definition: CSCEventData.h:87
#define NULL
Definition: scimark2.h:8
CSCTMBData * tmbData() const
user must check in nclct &gt; 0
void CSCEventData::copy ( const CSCEventData data)
private

Definition at line 288 of file CSCEventData.cc.

References init(), NULL, size_, theALCTHeader, theALCTTrailer, theAnodeData, theCFEBData, theChamberType, theDMBHeader, theDMBTrailer, and theTMBData.

Referenced by CSCEventData(), and operator=().

288  {
289  init();
290  theDMBHeader = data.theDMBHeader;
292  if(data.theALCTHeader != NULL)
294  if(data.theAnodeData != NULL)
295  theAnodeData = new CSCAnodeData(*(data.theAnodeData));
296  if(data.theALCTTrailer != NULL)
298  if(data.theTMBData != NULL)
299  theTMBData = new CSCTMBData(*(data.theTMBData));
300  for(int icfeb = 0; icfeb < 5; ++icfeb) {
301  theCFEBData[icfeb] = 0;
302  if(data.theCFEBData[icfeb] != NULL)
303  theCFEBData[icfeb] = new CSCCFEBData(*(data.theCFEBData[icfeb]));
304  }
305  size_ = data.size_;
307 
308 }
#define NULL
Definition: scimark2.h:8
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
CSCDMBTrailer theDMBTrailer
Definition: CSCEventData.h:170
CSCALCTTrailer * theALCTTrailer
Definition: CSCEventData.h:164
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
void CSCEventData::destroy ( )
private

Definition at line 311 of file CSCEventData.cc.

References alctZSErecovered, theALCTHeader, theALCTTrailer, theAnodeData, theCFEBData, theTMBData, and zseEnable.

Referenced by operator=(), and ~CSCEventData().

311  {
312  if(zseEnable){
313  delete [] alctZSErecovered;
314  }
315  delete theALCTHeader;
316  delete theAnodeData;
317  delete theALCTTrailer;
318  delete theTMBData;
319  for(int icfeb = 0; icfeb < 5; ++icfeb) {
320  delete theCFEBData[icfeb];
321  }
322 /*
323  std::cout << "Before delete alctZSErecovered " << std::endl;
324  delete [] alctZSErecovered;
325  std::cout << "After delete alctZSErecovered " << std::endl;
326 */
327 }
unsigned short * alctZSErecovered
Auxiliary bufer to recove the ALCT raw payload from zero suppression.
Definition: CSCEventData.h:178
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
CSCALCTTrailer * theALCTTrailer
Definition: CSCEventData.h:164
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
const CSCDMBHeader* CSCEventData::dmbHeader ( ) const
inline

the DAQ motherboard header. A good place for event and chamber info

Definition at line 90 of file CSCEventData.h.

References theDMBHeader.

Referenced by CSCDDUEventData::add(), CSCDigiToRaw::findEventData(), and cscdqm::EventProcessor::processCSC().

90 {return &theDMBHeader;}
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
CSCDMBHeader* CSCEventData::dmbHeader ( )
inline

Definition at line 91 of file CSCEventData.h.

References theDMBHeader.

91 {return &theDMBHeader;}
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
const CSCDMBTrailer* CSCEventData::dmbTrailer ( ) const
inline

DMB trailer.

Definition at line 112 of file CSCEventData.h.

References theDMBTrailer.

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

112 {return &theDMBTrailer;}
CSCDMBTrailer theDMBTrailer
Definition: CSCEventData.h:170
void CSCEventData::init ( void  )
private

helpers for ctors, dtor, and op= zeroes all pointers

Definition at line 274 of file CSCEventData.cc.

References alctZSErecovered, theALCTHeader, theALCTTrailer, theAnodeData, theCFEBData, theTMBData, and zseEnable.

Referenced by copy(), and unpack_data().

274  {
275  //dataPresent = 0;
276  theALCTHeader = 0;
277  theAnodeData = 0;
278  theALCTTrailer = 0;
279  theTMBData = 0;
280  for(int icfeb = 0; icfeb < 5; ++icfeb) {
281  theCFEBData[icfeb] = 0;
282  }
284  zseEnable=0;
285 }
unsigned short * alctZSErecovered
Auxiliary bufer to recove the ALCT raw payload from zero suppression.
Definition: CSCEventData.h:178
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
CSCALCTTrailer * theALCTTrailer
Definition: CSCEventData.h:164
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
bool CSCEventData::isALCT ( const short unsigned int *  buf)

if dealing with ALCT data

Definition at line 247 of file CSCEventData.cc.

Referenced by unpack_data().

247  {
248  return (((buf[0]&0xFFFF)==0xDB0A)||(((buf[0]&0xF800)==0x6000)&&((buf[1]&0xF800)==0)));
249 }
bool CSCEventData::isTMB ( const short unsigned int *  buf)

if dealing with TMB data

Definition at line 251 of file CSCEventData.cc.

Referenced by unpack_data().

251  {
252  return ((buf[0]&0xFFF)==0xB0C);
253 }
int CSCEventData::nalct ( ) const
inline

the flag for existence of ALCT data

Definition at line 84 of file CSCEventData.h.

References CSCDMBHeader::nalct(), and theDMBHeader.

Referenced by alctData(), alctHeader(), alctTrailer(), cscdqm::EventProcessor::processCSC(), and unpack_data().

84 {return theDMBHeader.nalct();}
unsigned nalct() const
Definition: CSCDMBHeader.cc:41
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
int CSCEventData::nclct ( ) const
inline

the number of CLCTs

Definition at line 87 of file CSCEventData.h.

References CSCDMBHeader::nclct(), and theDMBHeader.

Referenced by clctData(), cscdqm::EventProcessor::processCSC(), tmbData(), tmbHeader(), and unpack_data().

87 {return theDMBHeader.nclct();}
unsigned nclct() const
Definition: CSCDMBHeader.cc:46
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
CSCEventData CSCEventData::operator= ( const CSCEventData data)

Definition at line 266 of file CSCEventData.cc.

References copy(), and destroy().

266  {
267  // check for self-assignment before destructing
268  if(&data != this) destroy();
269  copy(data);
270  return *this;
271 }
void copy(const CSCEventData &)
boost::dynamic_bitset CSCEventData::pack ( )

returns the packed event data.

Definition at line 511 of file CSCEventData.cc.

References alctHeader(), alctTrailer(), bitset_utilities::append(), cfebData(), CSCAnodeData::data(), CSCDMBTrailer::data(), CSCDMBHeader::data(), CSCALCTTrailer::data(), data, dmbTrailer(), NULL, CSCTMBData::pack(), CSCALCTHeader::pack(), query::result, CSCAnodeData::sizeInWords(), CSCDMBHeader::sizeInWords(), CSCALCTTrailer::sizeInWords(), CSCDMBTrailer::sizeInWords(), theALCTHeader, theALCTTrailer, theAnodeData, theCFEBData, theDMBHeader, theDMBTrailer, theTMBData, and bitset_utilities::ushortToBitset().

Referenced by pyrootRender.interactiveRender::draw().

511  {
512  boost::dynamic_bitset<> result = bitset_utilities::ushortToBitset( theDMBHeader.sizeInWords()*16,
513  theDMBHeader.data());
514 
515  if(theALCTHeader != NULL) {
516  boost::dynamic_bitset<> alctHeader = theALCTHeader->pack();
517  result = bitset_utilities::append(result, alctHeader);
518  }
519  if(theAnodeData != NULL) {
520  boost::dynamic_bitset<> anodeData = bitset_utilities::ushortToBitset (theAnodeData->sizeInWords()*16,
521  theAnodeData->data());
522  result = bitset_utilities::append(result, anodeData);
523  }
524  if(theALCTTrailer != NULL) {
526  theALCTTrailer->data());
527  result = bitset_utilities::append(result, alctTrailer);
528  }
529  if(theTMBData != NULL) {
530  result = bitset_utilities::append(result, theTMBData->pack());
531  }
532 
533  for(int icfeb = 0; icfeb < 5; ++icfeb) {
534  if(theCFEBData[icfeb] != NULL){
535  boost::dynamic_bitset<> cfebData = bitset_utilities::ushortToBitset(theCFEBData[icfeb]->sizeInWords()*16,
536  theCFEBData[icfeb]->data());
537  result = bitset_utilities::append(result, cfebData);
538  }
539  }
540 
542  theDMBTrailer.data());
543  result = bitset_utilities::append(result, dmbTrailer);
544  return result;
545 }
unsigned short int sizeInWords() const
the amount of the input binary buffer read, in 16-bit words
Definition: CSCAnodeData.h:21
boost::dynamic_bitset pack()
not const because it sets size int TMBTrailer
Definition: CSCTMBData.cc:404
const CSCDMBTrailer * dmbTrailer() const
DMB trailer.
Definition: CSCEventData.h:112
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
#define NULL
Definition: scimark2.h:8
CSCALCTHeader * alctHeader() const
user must check if nalct &gt; 0
static int sizeInWords()
in 16-bit frames
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
unsigned short * data()
Definition: CSCDMBTrailer.h:25
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
CSCALCTTrailer * alctTrailer() const
user must check if nalct &gt; 0
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
tuple result
Definition: query.py:137
unsigned sizeInWords() const
Definition: CSCDMBHeader.cc:97
boost::dynamic_bitset pack()
CSCDMBTrailer theDMBTrailer
Definition: CSCEventData.h:170
unsigned short * data()
CSCALCTTrailer * theALCTTrailer
Definition: CSCEventData.h:164
unsigned short * data()
Definition: CSCDMBHeader.h:48
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
CSCCFEBData * cfebData(unsigned icfeb) const
unpacked in long mode: has overflow and error bits decoded
boost::dynamic_bitset ushortToBitset(const unsigned int numberOfBits, unsigned short *buf)
this method takes numberOfBits bits from unsigned short * array and returns them in the bitset obj...
unsigned short * data()
Definition: CSCAnodeData.h:19
static unsigned sizeInWords()
Definition: CSCDMBTrailer.h:75
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
void CSCEventData::selfTest ( )
static

Definition at line 548 of file CSCEventData.cc.

References add(), CSCTMBHeader::CLCTDigis(), CSCTMBHeader::CorrelatedLCTDigis(), cscPackAndUnpack(), cscPackerCompare(), CSCDetId::layer(), muon::overlap(), EcalCondDBWriter_cfi::pedestal, DetId::rawId(), stripDigis(), and tmbHeader().

548  {
549  CSCEventData chamberData(5);
550  CSCDetId detId(1, 3, 2, 1, 3);
551  std::vector<CSCCLCTDigi> clctDigis;
552  // Both CLCTs are read-out at the same (pre-trigger) bx, so the last-but-one
553  // arguments in both digis must be the same.
554  clctDigis.push_back(CSCCLCTDigi(1, 1, 4, 1, 0, 30, 3, 2, 1)); // valid for 2007
555  clctDigis.push_back(CSCCLCTDigi(1, 1, 2, 1, 1, 31, 1, 2, 2));
556 
557  // BX of LCT (8th argument) is 1-bit word (the least-significant bit
558  // of ALCT's bx).
559  std::vector<CSCCorrelatedLCTDigi> corrDigis;
560  corrDigis.push_back(CSCCorrelatedLCTDigi(1, 1, 2, 10, 98, 5, 0, 1, 0, 0, 0, 0));
561  corrDigis.push_back(CSCCorrelatedLCTDigi(2, 1, 2, 20, 15, 9, 1, 0, 0, 0, 0, 0));
562 
563  chamberData.add(clctDigis);
564  chamberData.add(corrDigis);
565 
566  CSCWireDigi wireDigi(10, 6);
567  CSCComparatorDigi comparatorDigi(30, 1, 6);
568  chamberData.add(wireDigi, 3);
569  chamberData.add(comparatorDigi, 3);
570 
571  CSCEventData newData = cscPackAndUnpack(chamberData);
572 
573  std::vector<CSCCLCTDigi> clcts = newData.tmbHeader()->CLCTDigis(detId.rawId());
574  assert(cscPackerCompare(clcts[0],clctDigis[0]));
575  assert(cscPackerCompare(clcts[1],clctDigis[1]));
576 
577  std::vector<CSCCorrelatedLCTDigi> lcts = newData.tmbHeader()->CorrelatedLCTDigis(detId.rawId());
578  assert(cscPackerCompare(lcts[0], corrDigis[0]));
579  assert(cscPackerCompare(lcts[1], corrDigis[1]));
580 
581  // test strip digis
582  CSCDetId me1adet1(1, 1, 1, 4, 1);
583  CSCDetId me1bdet1(1, 1, 4, 4, 6);
584  CSCDetId me1adet2(2, 1, 1, 4, 2);
585  CSCDetId me1bdet2(2, 1, 4, 4, 5);
586 
587  std::vector<int> sca(16, 600);
588  std::vector<unsigned short> overflow(16, 0), overlap(16, 0), errorfl(16,0);
589  CSCStripDigi me1a(5, sca, overflow, overlap, errorfl);
590  CSCStripDigi me1b(8, sca, overflow, overlap, errorfl);
591 
592  CSCEventData forward(1);
593  CSCEventData backward(1);
594 
595  forward.add(me1a, me1adet1.layer());
596  forward.add(me1b, me1bdet1.layer());
597  backward.add(me1a, me1adet2.layer());
598  backward.add(me1b, me1adet2.layer());
599  std::vector<CSCStripDigi> me1afs = forward.stripDigis(me1adet1);
600  std::vector<CSCStripDigi> me1bfs = forward.stripDigis(me1bdet1);
601  std::vector<CSCStripDigi> me1abs = backward.stripDigis(me1adet2);
602  std::vector<CSCStripDigi> me1bbs = backward.stripDigis(me1bdet2);
603  //FIXME The current code works under the assumption that ME11 and ME1A
604  // go into separate EventData. They need to be combined.
605  assert(me1afs.size() == 16);
606  assert(me1bfs.size() == 16);
607  assert(me1abs.size() == 16);
608  assert(me1bbs.size() == 16);
609 
610  assert(me1afs[4].getStrip() == 5);
611  assert(me1bfs[7].getStrip() == 8);
612  assert(me1abs[4].getStrip() == 5);
613  assert(me1bbs[7].getStrip() == 8);
614  assert(me1afs[4].pedestal() == 600);
615  assert(me1bfs[7].pedestal() == 600);
616  assert(me1abs[4].pedestal() == 600);
617  assert(me1bbs[7].pedestal() == 600);
618 
619 
620 }
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const
returns CorrelatedLCT digis
Definition: CSCTMBHeader.h:86
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer)
returns CLCT digis
Definition: CSCTMBHeader.h:80
bool cscPackerCompare(const T &t1, const T &t2)
CSCTMBHeader * tmbHeader() const
user must check if nclct &gt; 0
T cscPackAndUnpack(T &t)
static void CSCEventData::setDebug ( const bool  value)
inlinestatic

turns on/off debug flag for this class

Definition at line 52 of file CSCEventData.h.

References debug, and relativeConstraints::value.

Referenced by CSCDCCUnpacker::CSCDCCUnpacker().

52 {debug = value;}
static bool debug
Definition: CSCEventData.h:137
void CSCEventData::setEventInformation ( int  bxnum,
int  lvl1num 
)

this will fill the DMB header, and change all related fields in the DMBTrailer, ALCTHeader, and TMBHeader

Definition at line 418 of file CSCEventData.cc.

References CSCDMBHeader::setBXN(), CSCTMBHeader::setEventInformation(), CSCALCTHeader::setEventInformation(), CSCDMBHeader::setL1A(), theALCTHeader, theDMBHeader, theTMBData, and CSCTMBData::tmbHeader().

Referenced by CSCDDUEventData::add().

418  {
419  theDMBHeader.setBXN(bxnum);
420  theDMBHeader.setL1A(lvl1num);
421  if(theALCTHeader) {
423  }
424  if(theTMBData) {
426  }
427 }
void setEventInformation(const CSCDMBHeader &dmbHeader)
fills fields like bxn and l1a
Definition: CSCTMBHeader.h:28
void setL1A(int l1a)
Definition: CSCDMBHeader.cc:80
void setEventInformation(const CSCDMBHeader &)
void setBXN(int bxn)
Definition: CSCDMBHeader.cc:85
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:38
unsigned short CSCEventData::size ( void  ) const
inline

size of the data buffer used, in bytes

Definition at line 49 of file CSCEventData.h.

References size_.

Referenced by checkALCTClasses().

49 {return size_;}
std::vector< CSCStripDigi > CSCEventData::stripDigis ( const CSCDetId idlayer) const

returns all the strip digis in the chamber, with the comparator information.

Definition at line 330 of file CSCEventData.cc.

References query::result, and stripDigis().

Referenced by operator<<(), and selfTest().

330  {
331  std::vector<CSCStripDigi> result;
332  for(unsigned icfeb = 0; icfeb < 5; ++icfeb){
333  std::vector<CSCStripDigi> newDigis = stripDigis(idlayer, icfeb);
334  result.insert(result.end(), newDigis.begin(), newDigis.end());
335  }
336  return result;
337 }
std::vector< std::vector< CSCStripDigi > > stripDigis() const
deprecated. Use the above methods instead
tuple result
Definition: query.py:137
std::vector< CSCStripDigi > CSCEventData::stripDigis ( unsigned  idlayer,
unsigned  icfeb 
) const

returns all the strip digis in the chamber's cfeb

Definition at line 340 of file CSCEventData.cc.

References CSCCFEBData::digis(), NULL, query::result, and theCFEBData.

340  {
341  // assert(ilayer > 0 && ilayer <= 6); // off because now idlayer is raw cscdetid
342  std::vector<CSCStripDigi> result;
343  if(theCFEBData[icfeb] != NULL) {
344  std::vector<CSCStripDigi> newDigis = theCFEBData[icfeb]->digis(idlayer);
345  result.insert(result.end(), newDigis.begin(), newDigis.end());
346  }
347 
348  return result;
349 }
void digis(uint32_t idlayer, std::vector< CSCStripDigi > &result)
faster way to get to digis
Definition: CSCCFEBData.cc:202
#define NULL
Definition: scimark2.h:8
tuple result
Definition: query.py:137
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
std::vector< std::vector< CSCStripDigi > > CSCEventData::stripDigis ( ) const

deprecated. Use the above methods instead

Definition at line 362 of file CSCEventData.cc.

References query::result.

Referenced by stripDigis().

362  {
363  std::vector < std::vector<CSCStripDigi> > result;
364  for (int layer = 1; layer <= 6; ++layer) {
365  std::vector<CSCStripDigi> digis = stripDigis(layer);
366  result.push_back(digis);
367  }
368  return result;
369 }
std::vector< std::vector< CSCStripDigi > > stripDigis() const
deprecated. Use the above methods instead
tuple result
Definition: query.py:137
CSCTMBData * CSCEventData::tmbData ( ) const

user must check in nclct > 0

Definition at line 401 of file CSCEventData.cc.

References edm::hlt::Exception, nclct(), and theTMBData.

Referenced by clctData(), cscdqm::EventProcessor::processCSC(), and tmbHeader().

401  {
402  if(nclct() == 0) throw cms::Exception("No CLCT for this chamber");
403  return theTMBData;
404 }
int nclct() const
the number of CLCTs
Definition: CSCEventData.h:87
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
CSCTMBHeader * CSCEventData::tmbHeader ( ) const

user must check if nclct > 0

Definition at line 407 of file CSCEventData.cc.

References edm::hlt::Exception, nclct(), NULL, tmbData(), and CSCTMBData::tmbHeader().

Referenced by selfTest().

407  {
408  if((nclct() == 0)||(tmbData()==NULL)) throw cms::Exception("No CLCT header for this chamber");
409  return tmbData()->tmbHeader();
410 }
int nclct() const
the number of CLCTs
Definition: CSCEventData.h:87
#define NULL
Definition: scimark2.h:8
CSCTMBData * tmbData() const
user must check in nclct &gt; 0
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:38
void CSCEventData::unpack_data ( unsigned short *  buf)
private

The size of the ALCT payload is determined here

Check if Zero Suppression ALCT Enabled

Aauxilary variables neede to recover zero suppression Calculate the number of wire groups per layer

Calculate the number of words in the layer

unsigned short * posZSEtmpALCT = pos; This is just to dump the actual ALCT payload ** begin ** For debuggin purposes

to_rm (8 lines)

This is just to dump the actual ALCT payload ** end **

Actual word counting and recovering the original ALCT payload

Convert the recovered vector into the array

This is to check the content of the recovered ALCT payload to_rm (7 lines)

Definition at line 37 of file CSCEventData.cc.

References CSCALCTHeader::ALCTDigis(), alctZSErecovered, CSCDMBTrailer::cfeb_endtimeout, CSCDMBTrailer::cfeb_starttimeout, CSCDMBHeader::cfebAvailable(), CSCDMBHeader::check(), CSCALCTHeader::check(), CSCALCTHeader::data(), debug, i, init(), isALCT(), isTMB(), j, ConfigFiles::l, LogTrace, nalct(), nclct(), CSCTMBData::size(), size_, CSCAnodeData::sizeInWords(), CSCDMBHeader::sizeInWords(), CSCCFEBData::sizeInWords(), CSCALCTTrailer::sizeInWords(), CSCDMBTrailer::sizeInWords(), CSCALCTHeader::sizeInWords(), theALCTHeader, theALCTTrailer, theAnodeData, theCFEBData, theDMBHeader, theDMBTrailer, theTMBData, and zseEnable.

Referenced by CSCEventData().

38 {
39  // zero everything
40  init();
41  unsigned short * pos = buf;
42  if(debug) {
43  LogTrace ("CSCEventData|CSCRawToDigi") << "The event data ";
44  for(int i = 0; i < 16; ++i){
45  LogTrace ("CSCEventData|CSCRawToDigi") << std::hex << pos[i ] << " ";
46  }
47  }
48 
50  if(!(theDMBHeader.check())) {
51  LogTrace ("CSCEventData|CSCRawToDigi") << "Bad DMB Header??? " << " first four words: ";
52  for(int i = 0; i < 4; ++i){
53  LogTrace ("CSCEventData|CSCRawToDigi") << std::hex << pos[i ] << " ";
54  }
55  }
56 
57 
58  if (debug) {
59  LogTrace ("CSCEventData|CSCRawToDigi") << "nalct = " << nalct();
60  LogTrace ("CSCEventData|CSCRawToDigi") << "nclct = " << nclct();
61  }
62 
63  if (debug) {
64  LogTrace ("CSCEventData|CSCRawToDigi") << "size in words of DMBHeader" << theDMBHeader.sizeInWords();
65  LogTrace ("CSCEventData|CSCRawToDigi") << "sizeof(DMBHeader)" << sizeof(theDMBHeader);
66  }
67 
68  pos += theDMBHeader.sizeInWords();
69 
70  if (nalct() ==1) {
71  if (isALCT(pos)) {//checking for ALCTData
72  theALCTHeader = new CSCALCTHeader( pos );
73  if(!theALCTHeader->check()){
74  LogTrace ("CSCEventData|CSCRawToDigi") <<"+++WARNING: Corrupt ALCT data - won't attempt to decode";
75  }
76  else {
77  //dataPresent|=0x40;
78  pos += theALCTHeader->sizeInWords(); //size of the header
79  //fill ALCT Digis
81 
82  //theAnodeData = new CSCAnodeData(*theALCTHeader, pos);
83 
84 
86  /*
87  std::cout << " ****The ALCT information from CSCEventData.cc (begin)**** " << std::endl; ///to_rm
88  std::cout << " alctHeader2007().size: " << theALCTHeader->alctHeader2007().sizeInWords() << std::endl; ///to_rm
89  std::cout << " ALCT Header Content: " << std::endl; ///to_rm
91  for(int k=0; k<theALCTHeader->sizeInWords(); k+=4){
92  std::cout << std::hex << theALCTHeader->data()[k+3]
93  << " " << theALCTHeader->data()[k+2]
94  << " " << theALCTHeader->data()[k+1]
95  << " " << theALCTHeader->data()[k] << std::dec << std::endl;
96  }
97  */
98  //std::cout << " ALCT Size: " << theAnodeData->sizeInWords() << std::endl;
100  // int zseEnable = 0;
101  zseEnable = (theALCTHeader->data()[5] & 0x1000) >> 12;
102  //std::cout << " ZSE Bit: " << zseEnable << std::endl; /// to_rm
103  int sizeInWord_ZSE =0;
104 
105  //alctZSErecovered = new unsigned short [theAnodeData->sizeInWords()];
106 
107  if(zseEnable){
110  int nWGs_per_layer = ( (theALCTHeader->data()[6]&0x0007) + 1 ) * 16 ;
112  int nWG_round_up = int(nWGs_per_layer/12)+(nWGs_per_layer%3?1:0);
113  //std::cout << " Words per layer: " << nWG_round_up << std::endl; ///to_rm
114  unsigned short * posZSE = pos;
115  std::vector<unsigned short> alctZSErecoveredVector;
116  alctZSErecoveredVector.clear();
117 
118  //alctZSErecovered = new unsigned short [theAnodeData->sizeInWords()];
119  //delete [] alctZSErecovered;
120  //std::cout << " ALCT Buffer with ZSE: " << std::endl; ///to_rm
124  //unsigned short * posZSEdebug = pos; ///to_rm
125 
127  /*
128  while (*posZSEdebug != 0xDE0D){
129  unsigned short d = *posZSEdebug;
130  unsigned short c = *(posZSEdebug+1);
131  unsigned short b = *(posZSEdebug+2);
132  unsigned short a = *(posZSEdebug+3);
133  posZSEdebug+=4;
134  std::cout << std::hex << a << " " << b << " " << c << " " << d << std::dec << std::endl;
135  }
136  */
138 
140  int alctZSErecoveredPos=0;
141  while (*posZSE != 0xDE0D){
142  if( (*posZSE == 0x1000) && (*posZSE != 0x3000)){
143  for(int j=0; j<nWG_round_up; j++){
144  alctZSErecoveredVector.push_back(0x0000);
145  }
146  alctZSErecoveredPos+=nWG_round_up;
147  }
148  else {
149  alctZSErecoveredVector.push_back(*posZSE);
150  ++alctZSErecoveredPos;
151  }
152  posZSE++;
153  sizeInWord_ZSE++;
154  }
155 
156  alctZSErecovered = new unsigned short [alctZSErecoveredVector.size()];
157 
159  for(int l=0; l<(int)alctZSErecoveredVector.size(); l++){
160  alctZSErecovered[l]=alctZSErecoveredVector[l];
161  }
162 
163  unsigned short *posRecovered = alctZSErecovered;
164  theAnodeData = new CSCAnodeData(*theALCTHeader, posRecovered);
165 
168  /*
169  std::cout << " The ALCT payload recovered: " << std::endl;
170  for(int k=0; k<theAnodeData->sizeInWords(); k+=4){
171  std::cout << std::hex << alctZSErecovered[k+3] << " "
172  << alctZSErecovered[k+2] << " "
173  << alctZSErecovered[k+1] << " "
174  << alctZSErecovered[k] << std::dec << std::endl;
175  }
176  */
177  //delete [] alctZSErecovered;
178  //std::cout << " ALCT SizeZSE : " << sizeInWord_ZSE << std::endl; ///to_rm
179  //std::cout << " ALCT SizeZSE Recovered: " << alctZSErecoveredPos << std::endl; ///to_rm
180  //std::cout << " ALCT Size Expected: " << theAnodeData->sizeInWords() << std::endl; ///to_rm
181  pos +=sizeInWord_ZSE;
182  }
183  else{
184  //pos +=sizeInWord_ZSE;
186  pos += theAnodeData->sizeInWords(); // size of the data is determined during unpacking
187  }
188  //std::cout << " ****The ALCT information from CSCEventData.cc (end)**** " << std::endl; ///to_rm
189  theALCTTrailer = new CSCALCTTrailer( pos );
190  pos += theALCTTrailer->sizeInWords();
191  }
192  }
193  else {
194  LogTrace ("CSCEventData|CSCRawToDigi") << "Error:nalct reported but no ALCT data found!!!";
195  }
196  }
197 
198  if (nclct() ==1) {
199  if (isTMB(pos)) {
200  //dataPresent|=0x20;
201  theTMBData = new CSCTMBData(pos); //fill all TMB data
202  pos += theTMBData->size();
203  }
204  else {
205  LogTrace ("CSCEventData|CSCRawToDigi") << "Error:nclct reported but no TMB data found!!!";
206  }
207  }
208 
209  //now let's try to find and unpack the DMBTrailer
210  bool dmbTrailerReached= false;
211  for (int i=0; i<12000; ++i) {//8000 max for cfeb + 1980ALCT + 287 TMB
212  dmbTrailerReached =
213  (*(i+pos) & 0xF000) == 0xF000 && (*(i+pos+1) & 0xF000) == 0xF000
214  && (*(i+pos+2) & 0xF000) == 0xF000 && (*(i+pos+3) & 0xF000) == 0xF000
215  && (*(i+pos+4) & 0xF000) == 0xE000 && (*(i+pos+5) & 0xF000) == 0xE000
216  && (*(i+pos+6) & 0xF000) == 0xE000 && (*(i+pos+7) & 0xF000) == 0xE000;
217  if (dmbTrailerReached) {
218  theDMBTrailer = *( (CSCDMBTrailer *) (pos+i) );
219  break;
220  }
221  }
222  if (dmbTrailerReached) {
223  for(int icfeb = 0; icfeb < 5; ++icfeb) {
224  theCFEBData[icfeb] = 0;
225  int cfeb_available = theDMBHeader.cfebAvailable(icfeb);
226  unsigned int cfebTimeout = theDMBTrailer.cfeb_starttimeout | theDMBTrailer.cfeb_endtimeout;
227  //cfeb_available cannot be trusted - need additional verification!
228  if ( cfeb_available==1 ) {
229  if ((cfebTimeout >> icfeb) & 1) {
230  if (debug) LogTrace ("CSCEventData|CSCRawToDigi") << "CFEB Timed out! ";
231  } else {
232  //dataPresent|=(0x1>>icfeb);
233  // Fill CFEB data and convert it into cathode digis
234  theCFEBData[icfeb] = new CSCCFEBData(icfeb, pos);
235  pos += theCFEBData[icfeb]->sizeInWords();
236  }
237  }
238  }
239  pos += theDMBTrailer.sizeInWords();
240  size_ = pos-buf;
241  }
242  else {
243  LogTrace ("CSCEventData|CSCRawToDigi") << "Critical Error: DMB Trailer was not found!!! ";
244  }
245 }
int i
Definition: DBlmapReader.cc:9
bool isALCT(const short unsigned int *buf)
if dealing with ALCT data
bool check() const
unsigned short int sizeInWords() const
the amount of the input binary buffer read, in 16-bit words
Definition: CSCAnodeData.h:21
unsigned short * alctZSErecovered
Auxiliary bufer to recove the ALCT raw payload from zero suppression.
Definition: CSCEventData.h:178
int nclct() const
the number of CLCTs
Definition: CSCEventData.h:87
const unsigned short size() const
Definition: CSCTMBData.h:36
bool check() const
int nalct() const
the flag for existence of ALCT data
Definition: CSCEventData.h:84
static int sizeInWords()
in 16-bit frames
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
static bool debug
Definition: CSCEventData.h:137
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
unsigned cfeb_starttimeout
Definition: CSCDMBTrailer.h:45
int j
Definition: DBlmapReader.cc:9
unsigned sizeInWords() const
Definition: CSCDMBHeader.cc:97
CSCDMBTrailer theDMBTrailer
Definition: CSCEventData.h:170
#define LogTrace(id)
int sizeInWords()
in 16-bit words
Definition: CSCALCTHeader.h:99
std::vector< CSCALCTDigi > ALCTDigis() const
CSCALCTTrailer * theALCTTrailer
Definition: CSCEventData.h:164
bool isTMB(const short unsigned int *buf)
if dealing with TMB data
unsigned cfeb_endtimeout
Definition: CSCDMBTrailer.h:48
unsigned sizeInWords() const
Definition: CSCCFEBData.h:47
static unsigned sizeInWords()
Definition: CSCDMBTrailer.h:75
bool cfebAvailable(unsigned icfeb)
counts from zero
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
unsigned short int * data()
Definition: CSCALCTHeader.h:96
std::vector< CSCWireDigi > CSCEventData::wireDigis ( unsigned  ilayer) const

Definition at line 352 of file CSCEventData.cc.

References theAnodeData, and CSCAnodeData::wireDigis().

Referenced by operator<<().

352  {
353  if(theAnodeData == 0) {
354  return std::vector<CSCWireDigi>();
355  }
356  else {
357  return theAnodeData->wireDigis(ilayer);
358  }
359 }
std::vector< CSCWireDigi > wireDigis(int layer) const
input layer is from 1 to 6
Definition: CSCAnodeData.h:24
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
std::vector< std::vector< CSCWireDigi > > CSCEventData::wireDigis ( ) const

deprecated. Use the above method instead.

Definition at line 371 of file CSCEventData.cc.

References query::result.

371  {
372  std::vector < std::vector<CSCWireDigi> > result;
373  for (int layer = 1; layer <= 6; ++layer) {
374  result.push_back(wireDigis(layer));
375  }
376  return result;
377 }
std::vector< std::vector< CSCWireDigi > > wireDigis() const
deprecated. Use the above method instead.
tuple result
Definition: query.py:137

Member Data Documentation

unsigned short* CSCEventData::alctZSErecovered
private

Auxiliary bufer to recove the ALCT raw payload from zero suppression.

Definition at line 178 of file CSCEventData.h.

Referenced by destroy(), init(), and unpack_data().

bool CSCEventData::debug = false
static
int CSCEventData::size_
private

Definition at line 172 of file CSCEventData.h.

Referenced by copy(), size(), and unpack_data().

CSCALCTHeader* CSCEventData::theALCTHeader
private

these may or may not be present. I decided to make them dynamic because most CSC chambers don't have LCTs, therefore don't have data, except for DMB headers and trailers.

Definition at line 162 of file CSCEventData.h.

Referenced by add(), alctHeader(), checkALCTClasses(), copy(), destroy(), init(), pack(), setEventInformation(), and unpack_data().

CSCALCTTrailer* CSCEventData::theALCTTrailer
private

Definition at line 164 of file CSCEventData.h.

Referenced by alctTrailer(), checkALCTClasses(), copy(), destroy(), init(), pack(), and unpack_data().

CSCAnodeData* CSCEventData::theAnodeData
private
CSCCFEBData* CSCEventData::theCFEBData[5]
private

for up to 5 CFEB boards

Definition at line 168 of file CSCEventData.h.

Referenced by add(), cfebData(), copy(), CSCEventData(), destroy(), init(), pack(), stripDigis(), and unpack_data().

int CSCEventData::theChamberType
private

this won't be filled when real data is read it. It's only used when packing simulated data, so we know how many wire and strip channels to make.

Definition at line 175 of file CSCEventData.h.

Referenced by chamberType(), checkALCTClasses(), and copy().

CSCDMBHeader CSCEventData::theDMBHeader
private
CSCDMBTrailer CSCEventData::theDMBTrailer
private

Definition at line 170 of file CSCEventData.h.

Referenced by copy(), dmbTrailer(), pack(), and unpack_data().

CSCTMBData* CSCEventData::theTMBData
private
int CSCEventData::zseEnable
private

Definition at line 179 of file CSCEventData.h.

Referenced by destroy(), init(), and unpack_data().