#include <MatacqProducer.h>
Classes | |
struct | MatacqEventId |
class | PosEstimator |
struct | stats_t |
Public Types | |
enum | calibTrigType_t { laserType = 4, ledType = 5, tpType = 6, pedType = 7 } |
Public Types inherited from edm::EDProducer | |
typedef EDProducer | ModuleType |
Public Types inherited from edm::ProducerBase | |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Public Types inherited from edm::EDConsumerBase | |
typedef ProductLabels | Labels |
Private Types | |
typedef FILE * | FILE_t |
typedef off_t | filepos_t |
Private Member Functions | |
void | addMatacqData (edm::Event &event) |
int | getCalibTriggerType (edm::Event &ev) const |
bool | getMatacqEvent (uint32_t runNumber, int32_t orbitId, bool fileChange) |
bool | getMatacqFile (uint32_t runNumber, uint32_t orbitId, bool *fileChange=0) |
uint32_t | getOrbitId (edm::Event &ev) const |
uint32_t | getRunNumber (edm::Event &ev) const |
void | loadOrbitOffset () |
bool | mcheck (const std::string &name) |
void | mclose () |
bool | meof () |
bool | misOpened () |
bool | mopen (const std::string &name) |
bool | mread (char *buf, size_t n, const char *mess=0, bool peek=false) |
bool | mrewind () |
bool | mseek (filepos_t offset, int whence=SEEK_SET, const char *mess=0) |
bool | msize (filepos_t &s) |
bool | mtell (filepos_t &pos) |
void | newRun (int prevRun, int newRun) |
Static Private Member Functions | |
static std::string | runSubDir (uint32_t runNumber) |
Private Attributes | |
std::vector< unsigned char > | data_ |
std::string | digiInstanceName_ |
bool | disabled_ |
bool | doOrbitOffset_ |
int | eventSkipCounter_ |
int | fastRetrievalThresh_ |
std::vector< std::string > | fileNames_ |
MatacqDataFormatter | formatter_ |
bool | ignoreTriggerType_ |
FILE_t | inFile_ |
std::string | inFileName_ |
edm::InputTag | inputRawCollection_ |
edm::EDGetTokenT < FEDRawDataCollection > | inputRawCollectionToken_ |
int32_t | lastOrb_ |
std::ofstream | logFile_ |
std::string | logFileName_ |
bool | logTiming_ |
MatacqRawEvent | matacq_ |
bool | mergeRaw_ |
int | onErrorDisablingEvtCnt_ |
uint32_t | openedFileRunNumber_ |
std::map< uint32_t, uint32_t > | orbitOffset_ |
std::string | orbitOffsetFile_ |
PosEstimator | posEstim_ |
bool | produceDigis_ |
bool | produceRaw_ |
std::string | rawInstanceName_ |
uint32_t | runNumber_ |
timeval | startTime_ |
struct MatacqProducer::stats_t | stats_ |
std::ofstream | timeLog_ |
std::string | timeLogFile_ |
timeval | timer_ |
bool | timing_ |
int | verbosity_ |
Static Private Attributes | |
static const int | bufferSize = 30000 |
static const int | matacqFedId_ = 655 |
static const int | orbitTolerance_ = 80 |
static const stats_t | stats_init = {0,0,0} |
Additional Inherited Members | |
Static Public Member Functions inherited from edm::EDProducer | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &descriptions) |
Protected Member Functions inherited from edm::EDConsumerBase | |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | consumes (TypeToGet const &id, edm::InputTag const &tag) |
ConsumesCollector | consumesCollector () |
Use a ConsumesCollector to gather consumes information from helper functions. More... | |
template<typename ProductType , BranchType B = InEvent> | |
void | consumesMany () |
void | consumesMany (const TypeToGet &id) |
template<BranchType B> | |
void | consumesMany (const TypeToGet &id) |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
Definition at line 45 of file MatacqProducer.h.
|
private |
Definition at line 60 of file MatacqProducer.h.
|
private |
Definition at line 59 of file MatacqProducer.h.
Enumerator | |
---|---|
laserType | |
ledType | |
tpType | |
pedType |
Definition at line 48 of file MatacqProducer.h.
|
explicit |
Constructor
params | seletive readout parameters |
Definition at line 65 of file MatacqProducer.cc.
References gather_cfg::cout, digiInstanceName_, doOrbitOffset_, Exception, edm::ParameterSet::getParameter(), inputRawCollectionToken_, loadOrbitOffset(), logFile_, logFileName_, logTiming_, now(), orbitOffsetFile_, fileinputsource_cfi::out, posEstim_, produceDigis_, produceRaw_, rawInstanceName_, startTime_, timeLog_, timeLogFile_, timer_, MatacqProducer::PosEstimator::verbosity(), and verbosity_.
MatacqProducer::~MatacqProducer | ( | ) |
Destructor
Definition at line 766 of file MatacqProducer.cc.
References gather_cfg::cout, logTiming_, mclose(), now(), startTime_, and t.
|
private |
Add matacq digi to the event
event | the event |
digiInstanceName_ | name to give to the matacq digi instance |
Definition at line 179 of file MatacqProducer.cc.
References bufferSize, filterCSVwithJSON::copy, gather_cfg::cout, data_, digiInstanceName_, doOrbitOffset_, eventSkipCounter_, formatter_, getCalibTriggerType(), MatacqRawEvent::getDccLen(), getMatacqEvent(), getMatacqFile(), getOrbitId(), MatacqRawEvent::getOrbitId(), MatacqRawEvent::getParsedLen(), getRunNumber(), ignoreTriggerType_, inputRawCollectionToken_, MatacqDataFormatter::interpretRawData(), laserType, matacq_, matacqFedId_, mergeRaw_, eostools::move(), MatacqProducer::stats_t::nLaserEventsWithMatacq, MatacqProducer::stats_t::nNonLaserEventsWithMatacq, now(), orbitOffset_, produceDigis_, produceRaw_, rawInstanceName_, convertSQLiteXML::runNumber, stats_, and verbosity_.
Referenced by produce().
|
private |
Definition at line 646 of file MatacqProducer.cc.
References Majority< T >::add(), FEDRawData::data(), data, Exception, edm::Event::getByToken(), inputRawCollectionToken_, FEDNumbering::inRange(), edm::HandleBase::isValid(), AlCaHLTBitMon_ParallelJobs::p, lumiPlot::rawdata, Majority< T >::result(), and FEDRawData::size().
Referenced by addMatacqData().
|
private |
Definition at line 342 of file MatacqProducer.cc.
References funct::abs(), gather_cfg::cout, data_, MatacqProducer::PosEstimator::eventLength(), Exception, fastRetrievalThresh_, newFWLiteAna::found, MatacqRawEvent::getDccLen(), MatacqRawEvent::getOrbitId(), MatacqRawEvent::getRunNum(), inFileName_, MatacqProducer::PosEstimator::invalid(), lastOrb_, matacq_, mread(), mrewind(), mseek(), msize(), mtell(), now(), hltrates_dqm_sourceclient-live_cfg::offset, orbitTolerance_, MatacqProducer::PosEstimator::pos(), posEstim_, DTTTrigCorrFirst::run, and verbosity_.
Referenced by addMatacqData().
|
private |
Retrieve the file containing a given matacq event
runNumber | Number of the run the matacq event is looking from |
orbitId | Id of the orbit of the matacq event |
fileChange | if not null pointer, set to true if the file changed. |
Definition at line 542 of file MatacqProducer.cc.
References gather_cfg::cout, eventSkipCounter_, fileNames_, alignmentValidation::fname, cmsPerfStripChart::format, newFWLiteAna::found, i, MatacqProducer::PosEstimator::init(), lastOrb_, mcheck(), misOpened(), mopen(), now(), onErrorDisablingEvtCnt_, openedFileRunNumber_, posEstim_, convertSQLiteXML::runNumber, runSubDir(), and verbosity_.
Referenced by addMatacqData().
|
private |
Definition at line 601 of file MatacqProducer.cc.
References funct::abs(), FEDRawData::data(), data, Exception, edm::Event::getByToken(), edm::EventBase::id(), inputRawCollectionToken_, FEDNumbering::inRange(), edm::HandleBase::isValid(), orbitTolerance_, lumiPlot::rawdata, and FEDRawData::size().
Referenced by addMatacqData().
|
private |
Definition at line 597 of file MatacqProducer.cc.
References edm::Event::run().
Referenced by addMatacqData(), and produce().
|
private |
Loading orbit correction table from file.
Definition at line 779 of file MatacqProducer.cc.
References gather_cfg::cout, Exception, f, ntuplemaker::iline, bookConverter::max, now(), orbitOffset_, orbitOffsetFile_, DTTTrigCorrFirst::run, and alignCSCRings::s.
Referenced by MatacqProducer().
|
private |
|
private |
Definition at line 1029 of file MatacqProducer.cc.
References inFile_.
Referenced by mopen(), and ~MatacqProducer().
|
private |
|
private |
Definition at line 1034 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqFile().
|
private |
Definition at line 1017 of file MatacqProducer.cc.
References inFile_, inFileName_, mclose(), and mergeVDriftHistosByStation::name.
Referenced by getMatacqFile().
|
private |
Read a data block from input file. On failure file position is restored and if position restoring fails, file is rewind.
buf | buffer to store read data |
n | size of data block |
mess | text to insert in the eventual error message. |
peek | if true file position is restored after the data read |
Definition at line 958 of file MatacqProducer.cc.
References gather_cfg::cout, inFile_, lastOrb_, mrewind(), now(), and verbosity_.
Referenced by getMatacqEvent(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 998 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent(), MatacqProducer::PosEstimator::init(), mread(), and mseek().
|
private |
Move input file read pointer. On failure file is rewind.
buf | buffer to store read data |
n | size of data block |
mess | text to insert in the eventual error message. |
Definition at line 938 of file MatacqProducer.cc.
References gather_cfg::cout, inFile_, mrewind(), now(), and verbosity_.
Referenced by getMatacqEvent(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 986 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 951 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent().
|
private |
Definition at line 1052 of file MatacqProducer.cc.
References eventSkipCounter_, logFile_, MatacqProducer::stats_t::nEvents, MatacqProducer::stats_t::nLaserEventsWithMatacq, MatacqProducer::stats_t::nNonLaserEventsWithMatacq, now(), runNumber_, and stats_.
Referenced by produce().
|
virtual |
Produces the EDM products
CMS | event |
eventSetup | event conditions |
Implements edm::EDProducer.
Definition at line 147 of file MatacqProducer.cc.
References addMatacqData(), gather_cfg::cout, disabled_, getRunNumber(), logTiming_, MatacqProducer::stats_t::nEvents, newRun(), now(), convertSQLiteXML::runNumber, runNumber_, startTime_, stats_, t, timeLog_, timer_, and verbosity_.
Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().
|
staticprivate |
Definition at line 1045 of file MatacqProducer.cc.
References cmsPerfStripChart::format, and units().
Referenced by getMatacqFile().
|
staticprivate |
Definition at line 264 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Definition at line 266 of file MatacqProducer.h.
Referenced by addMatacqData(), and getMatacqEvent().
|
private |
Instance name to use for the produced Matacq digi collection
Definition at line 212 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Parameter to disable matacq data production. For timing purpose.
Definition at line 224 of file MatacqProducer.h.
Referenced by produce().
|
private |
Switch for orbit ID correction.
Definition at line 289 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
counter for event skipping
Definition at line 315 of file MatacqProducer.h.
Referenced by addMatacqData(), getMatacqFile(), and newRun().
|
private |
Definition at line 271 of file MatacqProducer.h.
Referenced by getMatacqEvent().
|
private |
Definition at line 208 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Definition at line 267 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
When true look for matacq data independently of trigger type.
Definition at line 256 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
|
private |
Name of currently opened matacq file
Definition at line 293 of file MatacqProducer.h.
Referenced by getMatacqEvent(), and mopen().
|
private |
Name of the raw data collection the Matacq data must be merge to if merging is enabled.
Definition at line 241 of file MatacqProducer.h.
|
private |
EDM token to access the raw data collection the Matacq data must be merge to if merging is enabled.
Definition at line 247 of file MatacqProducer.h.
Referenced by addMatacqData(), getCalibTriggerType(), getOrbitId(), and MatacqProducer().
|
private |
Definition at line 270 of file MatacqProducer.h.
Referenced by getMatacqEvent(), getMatacqFile(), and mread().
|
private |
Log file
Definition at line 310 of file MatacqProducer.h.
Referenced by MatacqProducer(), and newRun().
|
private |
|
private |
Switch for code timing.
Definition at line 334 of file MatacqProducer.h.
Referenced by MatacqProducer(), produce(), and ~MatacqProducer().
|
private |
Definition at line 258 of file MatacqProducer.h.
Referenced by addMatacqData(), and getMatacqEvent().
|
staticprivate |
Definition at line 295 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Switch for merging Matacq raw data with existing raw data collection.
Definition at line 252 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Number of events to skip in case of error
Definition at line 319 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Definition at line 269 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Orbit offset table.
Definition at line 285 of file MatacqProducer.h.
Referenced by addMatacqData(), and loadOrbitOffset().
|
private |
File name of table with orbit offset between matacq event and DCC. Used to recover data suffering from orbit miss-synchonization
Definition at line 281 of file MatacqProducer.h.
Referenced by loadOrbitOffset(), and MatacqProducer().
|
staticprivate |
Definition at line 268 of file MatacqProducer.h.
Referenced by getMatacqEvent(), and getOrbitId().
|
private |
Definition at line 273 of file MatacqProducer.h.
Referenced by getMatacqEvent(), getMatacqFile(), and MatacqProducer().
|
private |
Swictch for Matacq digi producion
Definition at line 232 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Switch for Matacq FED raw data production
Definition at line 236 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Instance name to use for the produced Matacq raw data collection
Definition at line 216 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Number of the currently processed run
Definition at line 338 of file MatacqProducer.h.
|
private |
Definition at line 275 of file MatacqProducer.h.
Referenced by MatacqProducer(), produce(), and ~MatacqProducer().
|
private |
Referenced by addMatacqData(), newRun(), and produce().
|
staticprivate |
Definition at line 303 of file MatacqProducer.h.
|
private |
Output stream to log code timing
Definition at line 330 of file MatacqProducer.h.
Referenced by MatacqProducer(), and produce().
|
private |
Name of file to log timing
Definition at line 323 of file MatacqProducer.h.
Referenced by MatacqProducer().
|
private |
Buffer for timing
Definition at line 326 of file MatacqProducer.h.
Referenced by MatacqProducer(), and produce().
|
private |
Parameter to switch module timing.
Definition at line 220 of file MatacqProducer.h.
|
private |
Verbosity level
Definition at line 228 of file MatacqProducer.h.
Referenced by addMatacqData(), getMatacqEvent(), getMatacqFile(), MatacqProducer(), mread(), mseek(), MatacqProducer::PosEstimator::pos(), and produce().