#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 |
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_ |
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::ProducerBase | |
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
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 43 of file MatacqProducer.h.
|
private |
Definition at line 58 of file MatacqProducer.h.
|
private |
Definition at line 57 of file MatacqProducer.h.
Enumerator | |
---|---|
laserType | |
ledType | |
tpType | |
pedType |
Definition at line 46 of file MatacqProducer.h.
|
explicit |
Constructor
params | seletive readout parameters |
Definition at line 66 of file MatacqProducer.cc.
References gather_cfg::cout, digiInstanceName_, doOrbitOffset_, edm::hlt::Exception, loadOrbitOffset(), logFile_, logFileName_, logTiming_, now(), orbitOffsetFile_, dbtoconf::out, posEstim_, produceDigis_, produceRaw_, rawInstanceName_, startTime_, timeLog_, timeLogFile_, timer_, MatacqProducer::PosEstimator::verbosity(), and verbosity_.
MatacqProducer::~MatacqProducer | ( | ) |
Destructor
Definition at line 765 of file MatacqProducer.cc.
References gather_cfg::cout, logTiming_, mclose(), now(), startTime_, and lumiQTWidget::t.
|
private |
Add matacq digi to the event
event | the event |
digiInstanceName_ | name to give to the matacq digi instance |
Definition at line 177 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_, inputRawCollection_, MatacqDataFormatter::interpretRawData(), laserType, matacq_, matacqFedId_, mergeRaw_, 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 645 of file MatacqProducer.cc.
References Majority< T >::add(), FEDRawData::data(), data, edm::hlt::Exception, edm::Event::getByLabel(), inputRawCollection_, FEDNumbering::inRange(), edm::HandleBase::isValid(), AlCaHLTBitMon_ParallelJobs::p, lumiPlot::rawdata, Majority< T >::result(), and FEDRawData::size().
Referenced by addMatacqData().
|
private |
Definition at line 341 of file MatacqProducer.cc.
References funct::abs(), gather_cfg::cout, data_, MatacqProducer::PosEstimator::eventLength(), edm::hlt::Exception, fastRetrievalThresh_, newFWLiteAna::found, MatacqRawEvent::getDccLen(), MatacqRawEvent::getOrbitId(), MatacqRawEvent::getRunNum(), inFileName_, MatacqProducer::PosEstimator::invalid(), lastOrb_, matacq_, mread(), mrewind(), mseek(), msize(), mtell(), now(), evf::evtn::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 541 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 600 of file MatacqProducer.cc.
References funct::abs(), FEDRawData::data(), data, edm::hlt::Exception, edm::Event::getByLabel(), edm::EventBase::id(), inputRawCollection_, FEDNumbering::inRange(), edm::HandleBase::isValid(), orbitTolerance_, lumiPlot::rawdata, and FEDRawData::size().
Referenced by addMatacqData().
|
private |
Definition at line 596 of file MatacqProducer.cc.
References edm::Event::run().
Referenced by addMatacqData(), and produce().
|
private |
Loading orbit correction table from file.
Definition at line 778 of file MatacqProducer.cc.
References gather_cfg::cout, edm::hlt::Exception, f, ntuplemaker::iline, max(), now(), orbitOffset_, orbitOffsetFile_, DTTTrigCorrFirst::run, and alignCSCRings::s.
Referenced by MatacqProducer().
|
private |
|
private |
Definition at line 1028 of file MatacqProducer.cc.
References inFile_.
Referenced by mopen(), and ~MatacqProducer().
|
private |
|
private |
Definition at line 1033 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqFile().
|
private |
Definition at line 1016 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 957 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 997 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 937 of file MatacqProducer.cc.
References gather_cfg::cout, inFile_, mrewind(), now(), and verbosity_.
Referenced by getMatacqEvent(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 985 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 950 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent().
|
private |
Definition at line 1051 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 145 of file MatacqProducer.cc.
References addMatacqData(), gather_cfg::cout, disabled_, getRunNumber(), logTiming_, MatacqProducer::stats_t::nEvents, newRun(), now(), convertSQLiteXML::runNumber, runNumber_, startTime_, stats_, lumiQTWidget::t, timeLog_, timer_, and verbosity_.
Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().
|
staticprivate |
Definition at line 1044 of file MatacqProducer.cc.
References cmsPerfStripChart::format, and create_public_lumi_plots::units.
Referenced by getMatacqFile().
|
staticprivate |
Definition at line 256 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Definition at line 258 of file MatacqProducer.h.
Referenced by addMatacqData(), and getMatacqEvent().
|
private |
Instance name to use for the produced Matacq digi collection
Definition at line 210 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Parameter to disable matacq data production. For timing purpose.
Definition at line 222 of file MatacqProducer.h.
Referenced by produce().
|
private |
Switch for orbit ID correction.
Definition at line 281 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
counter for event skipping
Definition at line 307 of file MatacqProducer.h.
Referenced by addMatacqData(), getMatacqFile(), and newRun().
|
private |
Definition at line 263 of file MatacqProducer.h.
Referenced by getMatacqEvent().
|
private |
Definition at line 206 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Definition at line 259 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
When true look for matacq data independently of trigger type.
Definition at line 248 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
|
private |
Name of currently opened matacq file
Definition at line 285 of file MatacqProducer.h.
Referenced by getMatacqEvent(), and mopen().
|
private |
Name of raw data collection the Matacq data must be merge to if merging is enabled.
Definition at line 239 of file MatacqProducer.h.
Referenced by addMatacqData(), getCalibTriggerType(), and getOrbitId().
|
private |
Definition at line 262 of file MatacqProducer.h.
Referenced by getMatacqEvent(), getMatacqFile(), and mread().
|
private |
Log file
Definition at line 302 of file MatacqProducer.h.
Referenced by MatacqProducer(), and newRun().
|
private |
|
private |
Switch for code timing.
Definition at line 326 of file MatacqProducer.h.
Referenced by MatacqProducer(), produce(), and ~MatacqProducer().
|
private |
Definition at line 250 of file MatacqProducer.h.
Referenced by addMatacqData(), and getMatacqEvent().
|
staticprivate |
Definition at line 287 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Switch for merging Matacq raw data with existing raw data collection.
Definition at line 244 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Number of events to skip in case of error
Definition at line 311 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Definition at line 261 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Orbit offset table.
Definition at line 277 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 273 of file MatacqProducer.h.
Referenced by loadOrbitOffset(), and MatacqProducer().
|
staticprivate |
Definition at line 260 of file MatacqProducer.h.
Referenced by getMatacqEvent(), and getOrbitId().
|
private |
Definition at line 265 of file MatacqProducer.h.
Referenced by getMatacqEvent(), getMatacqFile(), and MatacqProducer().
|
private |
Swictch for Matacq digi producion
Definition at line 230 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Switch for Matacq FED raw data production
Definition at line 234 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Instance name to use for the produced Matacq raw data collection
Definition at line 214 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Number of the currently processed run
Definition at line 330 of file MatacqProducer.h.
|
private |
Definition at line 267 of file MatacqProducer.h.
Referenced by MatacqProducer(), produce(), and ~MatacqProducer().
|
private |
Referenced by addMatacqData(), newRun(), and produce().
|
staticprivate |
Definition at line 295 of file MatacqProducer.h.
|
private |
Output stream to log code timing
Definition at line 322 of file MatacqProducer.h.
Referenced by MatacqProducer(), and produce().
|
private |
Name of file to log timing
Definition at line 315 of file MatacqProducer.h.
Referenced by MatacqProducer().
|
private |
Buffer for timing
Definition at line 318 of file MatacqProducer.h.
Referenced by MatacqProducer(), and produce().
|
private |
Parameter to switch module timing.
Definition at line 218 of file MatacqProducer.h.
|
private |
Verbosity level
Definition at line 226 of file MatacqProducer.h.
Referenced by addMatacqData(), getMatacqEvent(), getMatacqFile(), MatacqProducer(), mread(), mseek(), MatacqProducer::PosEstimator::pos(), and produce().