#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 | |
using | ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >> |
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 |
bool | getOrbitRange (uint32_t &firstOrb, uint32_t &lastOrb) |
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) |
static bool | wantsGlobalLuminosityBlocks () |
static bool | wantsGlobalRuns () |
static bool | wantsStreamLuminosityBlocks () |
static bool | wantsStreamRuns () |
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 66 of file MatacqProducer.cc.
References gather_cfg::cout, digiInstanceName_, doOrbitOffset_, Exception, edm::ParameterSet::getParameter(), inputRawCollectionToken_, loadOrbitOffset(), logFile_, logFileName_, logTiming_, now(), orbitOffsetFile_, MillePedeFileConverter_cfg::out, posEstim_, produceDigis_, produceRaw_, rawInstanceName_, startTime_, timeLog_, timeLogFile_, timer_, MatacqProducer::PosEstimator::verbosity(), and verbosity_.
|
override |
Destructor
Definition at line 823 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 180 of file MatacqProducer.cc.
References bufferSize, popcon2dropbox::copy(), gather_cfg::cout, data_, digiInstanceName_, doOrbitOffset_, eventSkipCounter_, FEDRawDataCollection::FEDData(), 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, FEDRawData::size(), stats_, and verbosity_.
Referenced by produce().
|
private |
Definition at line 703 of file MatacqProducer.cc.
References Majority< T >::add(), FEDRawData::data(), data, Exception, FEDRawDataCollection::FEDData(), edm::Event::getByToken(), triggerObjects_cff::id, inputRawCollectionToken_, FEDNumbering::inRange(), edm::HandleBase::isValid(), AlCaHLTBitMon_ParallelJobs::p, matplotRender::rawdata, Majority< T >::result(), FEDRawData::size(), and trackingPlots::stat.
Referenced by addMatacqData().
|
private |
Definition at line 343 of file MatacqProducer.cc.
References funct::abs(), gather_cfg::cout, data_, MatacqProducer::PosEstimator::eventLength(), Exception, runEdmFileComparison::failed, fastRetrievalThresh_, runEdmFileComparison::found, MatacqRawEvent::getDccLen(), MatacqRawEvent::getOrbitId(), MatacqRawEvent::getRunNum(), inFileName_, createfilelist::int, MatacqProducer::PosEstimator::invalid(), lastOrb_, matacq_, mread(), mrewind(), mseek(), msize(), mtell(), now(), PFRecoTauDiscriminationByIsolation_cfi::offset, orbitTolerance_, MatacqProducer::PosEstimator::pos(), posEstim_, findQualityFiles::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 543 of file MatacqProducer.cc.
References gather_cfg::cout, eventSkipCounter_, fileNames_, alignmentValidation::fname, cmsPerfStripChart::format, runEdmFileComparison::found, g, getOrbitRange(), mps_fire::i, MatacqProducer::PosEstimator::init(), lastOrb_, misOpened(), mopen(), now(), onErrorDisablingEvtCnt_, openedFileRunNumber_, posEstim_, convertSQLiteXML::runNumber, runSubDir(), str, and verbosity_.
Referenced by addMatacqData().
|
private |
Definition at line 658 of file MatacqProducer.cc.
References funct::abs(), FEDRawData::data(), data, Exception, FEDRawDataCollection::FEDData(), edm::Event::getByToken(), triggerObjects_cff::id, edm::EventBase::id(), inputRawCollectionToken_, FEDNumbering::inRange(), edm::HandleBase::isValid(), orbitTolerance_, matplotRender::rawdata, and FEDRawData::size().
Referenced by addMatacqData().
|
private |
Definition at line 1127 of file MatacqProducer.cc.
References MatacqRawEvent::getDccLen(), MatacqRawEvent::getOrbitId(), RecoTauValidation_cfi::header, createfilelist::int, mread(), mseek(), msize(), mtell(), and nEvts.
Referenced by getMatacqFile().
|
private |
Definition at line 654 of file MatacqProducer.cc.
References edm::Event::run().
Referenced by addMatacqData(), and produce().
|
private |
Loading orbit correction table from file.
Definition at line 836 of file MatacqProducer.cc.
References StorageFactory::check(), gather_cfg::cout, Storage::CURRENT, MillePedeFileConverter_cfg::e, Storage::END, Exception, f, FrontierConditions_GlobalTag_cff::file, StorageFactory::get(), ntuplemaker::iline, inFile_, inFileName_, SiStripPI::max, mcheck(), mclose(), meof(), misOpened(), mopen(), mread(), mrewind(), mseek(), msize(), mtell(), gen::n, dataset::name, now(), PFRecoTauDiscriminationByIsolation_cfi::offset, StorageFactory::open(), IOFlags::OpenRead, orbitOffset_, orbitOffsetFile_, Storage::rewind(), findQualityFiles::run, alignCSCRings::s, Storage::SET, AlCaHLTBitMon_QueryRunRegistry::string, verbosity_, and cms::Exception::what().
Referenced by MatacqProducer().
|
private |
Definition at line 1061 of file MatacqProducer.cc.
References trackingPlots::stat.
Referenced by loadOrbitOffset().
|
private |
Definition at line 1086 of file MatacqProducer.cc.
References inFile_.
Referenced by loadOrbitOffset(), mopen(), and ~MatacqProducer().
|
private |
Definition at line 1095 of file MatacqProducer.cc.
References inFile_.
Referenced by loadOrbitOffset().
|
private |
Definition at line 1091 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqFile(), and loadOrbitOffset().
|
private |
Definition at line 1074 of file MatacqProducer.cc.
References inFile_, inFileName_, mclose(), and dataset::name.
Referenced by getMatacqFile(), and loadOrbitOffset().
|
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 1015 of file MatacqProducer.cc.
References gather_cfg::cout, inFile_, lastOrb_, mrewind(), now(), and verbosity_.
Referenced by getMatacqEvent(), getOrbitRange(), MatacqProducer::PosEstimator::init(), and loadOrbitOffset().
|
private |
Definition at line 1055 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent(), MatacqProducer::PosEstimator::init(), loadOrbitOffset(), 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 995 of file MatacqProducer.cc.
References gather_cfg::cout, inFile_, mrewind(), now(), and verbosity_.
Referenced by getMatacqEvent(), getOrbitRange(), MatacqProducer::PosEstimator::init(), and loadOrbitOffset().
|
private |
Definition at line 1043 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent(), getOrbitRange(), MatacqProducer::PosEstimator::init(), and loadOrbitOffset().
|
private |
Definition at line 1008 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent(), getOrbitRange(), and loadOrbitOffset().
|
private |
Definition at line 1109 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().
|
override |
Produces the EDM products
CMS | event |
eventSetup | event conditions |
Definition at line 148 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 1102 of file MatacqProducer.cc.
References cmsPerfStripChart::format, str, and units().
Referenced by getMatacqFile().
|
staticprivate |
Definition at line 268 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Definition at line 270 of file MatacqProducer.h.
Referenced by addMatacqData(), and getMatacqEvent().
|
private |
Instance name to use for the produced Matacq digi collection
Definition at line 216 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Parameter to disable matacq data production. For timing purpose.
Definition at line 228 of file MatacqProducer.h.
Referenced by produce().
|
private |
Switch for orbit ID correction.
Definition at line 293 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
counter for event skipping
Definition at line 319 of file MatacqProducer.h.
Referenced by addMatacqData(), getMatacqFile(), and newRun().
|
private |
Definition at line 275 of file MatacqProducer.h.
Referenced by getMatacqEvent().
|
private |
Definition at line 212 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Definition at line 271 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
When true look for matacq data independently of trigger type.
Definition at line 260 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Stream of currently opened matacq file
Definition at line 266 of file MatacqProducer.h.
Referenced by loadOrbitOffset(), mclose(), meof(), misOpened(), mopen(), mread(), mrewind(), mseek(), msize(), and mtell().
|
private |
Name of currently opened matacq file
Definition at line 297 of file MatacqProducer.h.
Referenced by getMatacqEvent(), loadOrbitOffset(), and mopen().
|
private |
Name of the raw data collection the Matacq data must be merge to if merging is enabled.
Definition at line 245 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 251 of file MatacqProducer.h.
Referenced by addMatacqData(), getCalibTriggerType(), getOrbitId(), and MatacqProducer().
|
private |
Definition at line 274 of file MatacqProducer.h.
Referenced by getMatacqEvent(), getMatacqFile(), and mread().
|
private |
Log file
Definition at line 314 of file MatacqProducer.h.
Referenced by MatacqProducer(), and newRun().
|
private |
|
private |
Switch for code timing.
Definition at line 338 of file MatacqProducer.h.
Referenced by MatacqProducer(), produce(), and ~MatacqProducer().
|
private |
Definition at line 262 of file MatacqProducer.h.
Referenced by addMatacqData(), and getMatacqEvent().
|
staticprivate |
Definition at line 299 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Switch for merging Matacq raw data with existing raw data collection.
Definition at line 256 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Number of events to skip in case of error
Definition at line 323 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Definition at line 273 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Orbit offset table.
Definition at line 289 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 285 of file MatacqProducer.h.
Referenced by loadOrbitOffset(), and MatacqProducer().
|
staticprivate |
Definition at line 272 of file MatacqProducer.h.
Referenced by getMatacqEvent(), and getOrbitId().
|
private |
Definition at line 277 of file MatacqProducer.h.
Referenced by getMatacqEvent(), getMatacqFile(), and MatacqProducer().
|
private |
Swictch for Matacq digi producion
Definition at line 236 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Switch for Matacq FED raw data production
Definition at line 240 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Instance name to use for the produced Matacq raw data collection
Definition at line 220 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Number of the currently processed run
Definition at line 342 of file MatacqProducer.h.
|
private |
Definition at line 279 of file MatacqProducer.h.
Referenced by MatacqProducer(), produce(), and ~MatacqProducer().
|
private |
Referenced by addMatacqData(), newRun(), and produce().
|
staticprivate |
Definition at line 307 of file MatacqProducer.h.
|
private |
Output stream to log code timing
Definition at line 334 of file MatacqProducer.h.
Referenced by MatacqProducer(), and produce().
|
private |
Name of file to log timing
Definition at line 327 of file MatacqProducer.h.
Referenced by MatacqProducer().
|
private |
Buffer for timing
Definition at line 330 of file MatacqProducer.h.
Referenced by MatacqProducer(), and produce().
|
private |
Parameter to switch module timing.
Definition at line 224 of file MatacqProducer.h.
|
private |
Verbosity level
Definition at line 232 of file MatacqProducer.h.
Referenced by addMatacqData(), getMatacqEvent(), getMatacqFile(), MatacqProducer::PosEstimator::init(), loadOrbitOffset(), MatacqProducer(), mread(), mseek(), MatacqProducer::PosEstimator::pos(), and produce().