#include <CSCEventData.h>
Public Member Functions | |
void | add (const CSCComparatorDigi &, const CSCDetId &) |
void | add (const CSCComparatorDigi &, int layer) |
void | add (const CSCStripDigi &, int layer) |
routines to add digis to the data More... | |
void | add (const CSCWireDigi &, 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... | |
CSCAnodeData * | alctData () const |
user must check if nalct > 0 More... | |
CSCALCTHeader * | alctHeader () const |
user must check if nalct > 0 More... | |
CSCALCTTrailer * | alctTrailer () const |
user must check if nalct > 0 More... | |
unsigned int | calcALCTcrc (std::vector< std::pair< unsigned int, unsigned short * > > &vec) |
const CSCCFEBData * | cfebData (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... | |
CSCCLCTData * | clctData () const |
user must check if nclct > 0 More... | |
CSCEventData () | |
CSCEventData (const CSCEventData &data) | |
CSCEventData (const uint16_t *buf, uint16_t format_version=2005) | |
should make const input soon More... | |
CSCEventData (int chamberType, uint16_t format_version=2005) | |
CSCDMBHeader * | dmbHeader () |
const CSCDMBHeader * | dmbHeader () const |
the DAQ motherboard header. A good place for event and chamber info More... | |
const CSCDMBTrailer * | dmbTrailer () const |
DMB trailer. More... | |
uint16_t | getFormatVersion () const |
bool | isALCT (const uint16_t *buf) |
if dealing with ALCT data More... | |
bool | isTMB (const uint16_t *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< std::vector< CSCStripDigi > > | stripDigis () const |
deprecated. Use the above methods instead More... | |
std::vector< CSCStripDigi > | stripDigis (const CSCDetId &idlayer) const |
returns all the strip digis in the chamber, with the comparator information. More... | |
std::vector< CSCStripDigi > | stripDigis (unsigned idlayer, unsigned icfeb) const |
returns all the strip digis in the chamber's cfeb More... | |
CSCTMBData * | tmbData () const |
user must check in nclct > 0 More... | |
CSCTMBHeader * | tmbHeader () const |
user must check if nclct > 0 More... | |
std::vector< std::vector< CSCWireDigi > > | wireDigis () const |
deprecated. Use the above method instead. More... | |
std::vector< CSCWireDigi > | wireDigis (unsigned ilayer) const |
~CSCEventData () | |
Static Public Member Functions | |
static void | selfTest () |
static void | setDebug (const bool value) |
Static Public Attributes | |
static std::atomic< 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 (const uint16_t *buf) |
Private Attributes | |
unsigned short * | alctZSErecovered |
Auxiliary bufer to recove the ALCT raw payload from zero suppression. More... | |
int | size_ |
CSCALCTHeader * | theALCTHeader |
CSCALCTTrailer * | theALCTTrailer |
CSCAnodeData * | theAnodeData |
CSCCFEBData * | theCFEBData [7] |
for up to MAX_CFEB CFEB boards More... | |
int | theChamberType |
CSCDMBHeader | theDMBHeader |
CSCDMBTrailer | theDMBTrailer |
uint16_t | theFormatVersion |
Output Format Version (2005, 2013) More... | |
CSCTMBData * | theTMBData |
int | zseEnable |
Definition at line 28 of file CSCEventData.h.
|
explicit |
CSCEventData::CSCEventData | ( | const uint16_t * | buf, |
uint16_t | format_version = 2005 |
||
) |
should make const input soon
Definition at line 33 of file CSCEventData.cc.
References visDQMUpload::buf, theFormatVersion, and unpack_data().
|
inline |
Definition at line 33 of file CSCEventData.h.
CSCEventData::~CSCEventData | ( | ) |
since we need deep copies, need the Big Three (destructor, copy ctor, op=)
Definition at line 259 of file CSCEventData.cc.
References destroy().
CSCEventData::CSCEventData | ( | const CSCEventData & | data | ) |
void CSCEventData::add | ( | const CSCComparatorDigi & | digi, |
const CSCDetId & | cid | ||
) |
Definition at line 495 of file CSCEventData.cc.
References CSCCLCTData::add(), checkTMBClasses(), CSCTMBData::clctData(), and theTMBData.
Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().
void CSCEventData::add | ( | const CSCComparatorDigi & | digi, |
int | layer | ||
) |
Definition at line 490 of file CSCEventData.cc.
References CSCCLCTData::add(), checkTMBClasses(), CSCTMBData::clctData(), and theTMBData.
Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().
void CSCEventData::add | ( | const CSCStripDigi & | digi, |
int | layer | ||
) |
routines to add digis to the data
Definition at line 467 of file CSCEventData.cc.
References CSCCFEBData::add(), CSCDMBHeader::addCFEB(), CSCDMBHeader::format_version(), CSCStripDigi::getADCCounts(), CSCStripDigi::getStrip(), theCFEBData, theDMBHeader, and theFormatVersion.
Referenced by CSCDigiToRaw::add(), counter.Counter::register(), SequenceTypes.Task::remove(), SequenceTypes.Task::replace(), and selfTest().
void CSCEventData::add | ( | const CSCWireDigi & | digi, |
int | layer | ||
) |
Definition at line 483 of file CSCEventData.cc.
References CSCAnodeData::add(), checkALCTClasses(), CSCWireDigi::getWireGroup(), CSCWireDigi::getWireGroupBX(), CSCALCTHeader::setBXNCount(), CSCALCTHeader::setDAVForChannel(), theALCTHeader, and theAnodeData.
Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().
void CSCEventData::add | ( | const std::vector< CSCALCTDigi > & | digis | ) |
these go in as vectors, so they get sorted right away
Definition at line 500 of file CSCEventData.cc.
References CSCALCTHeader::add(), checkALCTClasses(), and theALCTHeader.
Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().
void CSCEventData::add | ( | const std::vector< CSCCLCTDigi > & | digis | ) |
Definition at line 505 of file CSCEventData.cc.
References CSCTMBHeader::add(), checkTMBClasses(), theTMBData, and CSCTMBData::tmbHeader().
Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().
void CSCEventData::add | ( | const std::vector< CSCCorrelatedLCTDigi > & | digis | ) |
Definition at line 510 of file CSCEventData.cc.
References CSCTMBHeader::add(), checkTMBClasses(), theTMBData, and CSCTMBData::tmbHeader().
Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().
void CSCEventData::addALCTStructures | ( | ) |
adds an empty ALCTHeader, trailer, and anode data
|
private |
adds the comparators to the strip digis
CSCAnodeData * CSCEventData::alctData | ( | ) | const |
user must check if nalct > 0
Definition at line 381 of file CSCEventData.cc.
References Exception, nalct(), and theAnodeData.
CSCALCTHeader * CSCEventData::alctHeader | ( | ) | const |
user must check if nalct > 0
Definition at line 369 of file CSCEventData.cc.
References Exception, nalct(), and theALCTHeader.
Referenced by pack().
CSCALCTTrailer * CSCEventData::alctTrailer | ( | ) | const |
user must check if nalct > 0
Definition at line 375 of file CSCEventData.cc.
References Exception, nalct(), and theALCTTrailer.
Referenced by pack().
unsigned int CSCEventData::calcALCTcrc | ( | std::vector< std::pair< unsigned int, unsigned short * > > & | vec | ) |
Definition at line 569 of file CSCEventData.cc.
References RawDataTask_cfi::CRC, mps_fire::i, dqmiolumiharvest::j, dqmiodumpmetadata::n, edm::second(), OrderedSet::t, and w.
Referenced by pack().
const CSCCFEBData * CSCEventData::cfebData | ( | unsigned | icfeb | ) | const |
unpacked in long mode: has overflow and error bits decoded
Definition at line 367 of file CSCEventData.cc.
References theCFEBData.
Referenced by pack().
|
inline |
might not be set in real data
Definition at line 119 of file CSCEventData.h.
References theChamberType.
|
private |
makes new ALCT classes, if needed
Definition at line 436 of file CSCEventData.cc.
References CSCDMBHeader::addNALCT(), CSCALCTHeader::alctFirmwareVersion(), cms::cuda::assert(), CSCALCTHeader::setEventInformation(), size(), CSCAnodeData::sizeInWords(), CSCALCTTrailer::sizeInWords(), CSCALCTHeader::sizeInWords(), theALCTHeader, theALCTTrailer, theAnodeData, theChamberType, and theDMBHeader.
Referenced by add().
|
private |
makes new TMB classes, if needed
Definition at line 449 of file CSCEventData.cc.
References CSCDMBHeader::addNCLCT(), CSCTMBHeader::setEventInformation(), CSCTMBHeader::setNCFEBs(), theChamberType, theDMBHeader, theFormatVersion, theTMBData, and CSCTMBData::tmbHeader().
Referenced by add().
CSCCLCTData * CSCEventData::clctData | ( | ) | const |
user must check if nclct > 0
Definition at line 399 of file CSCEventData.cc.
References CSCTMBData::clctData(), Exception, nclct(), and tmbData().
|
private |
Definition at line 282 of file CSCEventData.cc.
References data, init(), MAX_CFEB, size_, theALCTHeader, theALCTTrailer, theAnodeData, theCFEBData, theChamberType, theDMBHeader, theDMBTrailer, theFormatVersion, and theTMBData.
Referenced by CSCEventData(), and operator=().
|
private |
Definition at line 304 of file CSCEventData.cc.
References alctZSErecovered, MAX_CFEB, theALCTHeader, theALCTTrailer, theAnodeData, theCFEBData, theTMBData, and zseEnable.
Referenced by operator=(), and ~CSCEventData().
|
inline |
|
inline |
the DAQ motherboard header. A good place for event and chamber info
Definition at line 75 of file CSCEventData.h.
References theDMBHeader.
Referenced by CSCDigiToRaw::findEventData().
|
inline |
DMB trailer.
Definition at line 97 of file CSCEventData.h.
References theDMBTrailer.
Referenced by pack().
|
inline |
|
private |
helpers for ctors, dtor, and op= zeroes all pointers
Definition at line 269 of file CSCEventData.cc.
References alctZSErecovered, MAX_CFEB, theALCTHeader, theALCTTrailer, theAnodeData, theCFEBData, theTMBData, and zseEnable.
Referenced by copy(), and unpack_data().
bool CSCEventData::isALCT | ( | const uint16_t * | buf | ) |
if dealing with ALCT data
Definition at line 251 of file CSCEventData.cc.
References visDQMUpload::buf.
Referenced by unpack_data().
bool CSCEventData::isTMB | ( | const uint16_t * | buf | ) |
if dealing with TMB data
Definition at line 255 of file CSCEventData.cc.
References visDQMUpload::buf.
Referenced by unpack_data().
|
inline |
the flag for existence of ALCT data
Definition at line 69 of file CSCEventData.h.
References CSCDMBHeader::nalct(), and theDMBHeader.
Referenced by alctData(), alctHeader(), alctTrailer(), and unpack_data().
|
inline |
the number of CLCTs
Definition at line 72 of file CSCEventData.h.
References CSCDMBHeader::nclct(), and theDMBHeader.
Referenced by clctData(), tmbData(), tmbHeader(), and unpack_data().
CSCEventData CSCEventData::operator= | ( | const CSCEventData & | data | ) |
boost::dynamic_bitset CSCEventData::pack | ( | ) |
returns the packed event data.
Definition at line 526 of file CSCEventData.cc.
References alctHeader(), alctTrailer(), bitset_utilities::append(), calcALCTcrc(), cfebData(), CSCAnodeData::data(), CSCDMBHeader::data(), CSCDMBTrailer::data(), CSCALCTTrailer::data(), data, CSCALCTHeader::data(), dmbTrailer(), MAX_CFEB, CSCTMBData::pack(), CSCALCTHeader::pack(), mps_fire::result, CSCALCTTrailer::setCRC(), CSCAnodeData::sizeInWords(), CSCDMBHeader::sizeInWords(), CSCDMBTrailer::sizeInWords(), CSCALCTTrailer::sizeInWords(), CSCALCTHeader::sizeInWords(), theALCTHeader, theALCTTrailer, theAnodeData, theCFEBData, theDMBHeader, theDMBTrailer, theTMBData, and bitset_utilities::ushortToBitset().
|
static |
Definition at line 593 of file CSCEventData.cc.
References add(), cms::cuda::assert(), CSCTMBHeader::CLCTDigis(), CSCTMBHeader::CorrelatedLCTDigis(), cscPackAndUnpack(), cscPackerCompare(), CSCDetId::layer(), goodZToMuMu_cfi::overlap, EcalCondDBWriter_cfi::pedestal, DetId::rawId(), stripDigis(), and tmbHeader().
|
inlinestatic |
turns on/off debug flag for this class
Definition at line 44 of file CSCEventData.h.
References debug, and relativeConstraints::value.
Referenced by CSCDCCUnpacker::CSCDCCUnpacker().
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 405 of file CSCEventData.cc.
References cms::cuda::assert(), CSCDMBHeader::setBXN(), CSCTMBHeader::setEventInformation(), CSCALCTHeader::setEventInformation(), CSCDMBHeader::setL1A(), CSCCFEBData::setL1A(), CSCDMBHeader::setL1A24(), CSCTMBHeader::setNCFEBs(), theALCTHeader, theCFEBData, theChamberType, theDMBHeader, theFormatVersion, theTMBData, and CSCTMBData::tmbHeader().
|
inline |
size of the data buffer used, in bytes
Definition at line 41 of file CSCEventData.h.
References size_.
Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and checkALCTClasses().
std::vector< std::vector< CSCStripDigi > > CSCEventData::stripDigis | ( | ) | const |
deprecated. Use the above methods instead
Definition at line 350 of file CSCEventData.cc.
References mps_fire::result.
Referenced by stripDigis().
std::vector< CSCStripDigi > CSCEventData::stripDigis | ( | const CSCDetId & | idlayer | ) | const |
returns all the strip digis in the chamber, with the comparator information.
Definition at line 322 of file CSCEventData.cc.
References MAX_CFEB, mps_fire::result, and stripDigis().
Referenced by operator<<(), and selfTest().
std::vector< CSCStripDigi > CSCEventData::stripDigis | ( | unsigned | idlayer, |
unsigned | icfeb | ||
) | const |
returns all the strip digis in the chamber's cfeb
Definition at line 331 of file CSCEventData.cc.
References CSCCFEBData::digis(), mps_fire::result, and theCFEBData.
CSCTMBData * CSCEventData::tmbData | ( | ) | const |
user must check in nclct > 0
Definition at line 387 of file CSCEventData.cc.
References Exception, nclct(), and theTMBData.
Referenced by clctData(), and tmbHeader().
CSCTMBHeader * CSCEventData::tmbHeader | ( | ) | const |
user must check if nclct > 0
Definition at line 393 of file CSCEventData.cc.
References Exception, nclct(), tmbData(), and CSCTMBData::tmbHeader().
Referenced by selfTest().
|
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 38 of file CSCEventData.cc.
References CSCALCTHeader::ALCTDigis(), alctZSErecovered, visDQMUpload::buf, CSCDMBTrailer::cfeb_endtimeout(), CSCDMBTrailer::cfeb_starttimeout(), CSCDMBHeader::cfebAvailable(), CSCDMBHeader::check(), CSCALCTHeader::check(), CSCALCTHeader::data(), debug, CSCDMBHeader::format_version(), mps_fire::i, init(), createfilelist::int, isALCT(), isTMB(), dqmiolumiharvest::j, cmsLHEtoEOSManager::l, LogTrace, MAX_CFEB, nalct(), nclct(), CSCTMBData::size(), size_, CSCAnodeData::sizeInWords(), CSCCFEBData::sizeInWords(), CSCDMBHeader::sizeInWords(), CSCDMBTrailer::sizeInWords(), CSCALCTTrailer::sizeInWords(), CSCALCTHeader::sizeInWords(), theALCTHeader, theALCTTrailer, theAnodeData, theCFEBData, theDMBHeader, theDMBTrailer, theFormatVersion, theTMBData, and zseEnable.
Referenced by CSCEventData().
std::vector< std::vector< CSCWireDigi > > CSCEventData::wireDigis | ( | ) | const |
deprecated. Use the above method instead.
Definition at line 359 of file CSCEventData.cc.
References mps_fire::result.
std::vector< CSCWireDigi > CSCEventData::wireDigis | ( | unsigned | ilayer | ) | const |
Definition at line 342 of file CSCEventData.cc.
References theAnodeData, and CSCAnodeData::wireDigis().
Referenced by operator<<().
|
private |
Auxiliary bufer to recove the ALCT raw payload from zero suppression.
Definition at line 170 of file CSCEventData.h.
Referenced by destroy(), init(), and unpack_data().
|
static |
Definition at line 128 of file CSCEventData.h.
Referenced by util.rrapi.RRApi::dprint(), rrapi.RRApi::dprint(), pkg.AbstractPkg::generate(), util.rrapi.RRApi::get(), rrapi.RRApi::get(), pkg.AbstractPkg::get_kwds(), runTauIdMVA.TauIDEmbedder::loadMVA_WPs_run2_2017(), runTauIdMVA.TauIDEmbedder::runTauID(), setDebug(), unpack_data(), and pkg.AbstractPkg::write().
|
private |
Definition at line 164 of file CSCEventData.h.
Referenced by copy(), size(), and unpack_data().
|
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 154 of file CSCEventData.h.
Referenced by add(), alctHeader(), checkALCTClasses(), copy(), destroy(), init(), pack(), setEventInformation(), and unpack_data().
|
private |
Definition at line 156 of file CSCEventData.h.
Referenced by alctTrailer(), checkALCTClasses(), copy(), destroy(), init(), pack(), and unpack_data().
|
private |
Definition at line 155 of file CSCEventData.h.
Referenced by add(), alctData(), checkALCTClasses(), copy(), destroy(), init(), pack(), unpack_data(), and wireDigis().
|
private |
for up to MAX_CFEB CFEB boards
Definition at line 160 of file CSCEventData.h.
Referenced by add(), cfebData(), copy(), CSCEventData(), destroy(), init(), pack(), setEventInformation(), stripDigis(), and unpack_data().
|
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 167 of file CSCEventData.h.
Referenced by chamberType(), checkALCTClasses(), checkTMBClasses(), copy(), and setEventInformation().
|
private |
Definition at line 149 of file CSCEventData.h.
Referenced by add(), checkALCTClasses(), checkTMBClasses(), copy(), dmbHeader(), nalct(), nclct(), pack(), setEventInformation(), and unpack_data().
|
private |
Definition at line 162 of file CSCEventData.h.
Referenced by copy(), dmbTrailer(), pack(), and unpack_data().
|
private |
Output Format Version (2005, 2013)
Definition at line 174 of file CSCEventData.h.
Referenced by add(), checkTMBClasses(), copy(), CSCEventData(), getFormatVersion(), setEventInformation(), and unpack_data().
|
private |
Definition at line 157 of file CSCEventData.h.
Referenced by add(), checkTMBClasses(), copy(), destroy(), init(), pack(), setEventInformation(), tmbData(), and unpack_data().
|
private |
Definition at line 171 of file CSCEventData.h.
Referenced by destroy(), init(), and unpack_data().