#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=nullptr) |
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=nullptr, bool peek=false) |
bool | mrewind () |
bool | mseek (filepos_t offset, int whence=SEEK_SET, const char *mess=nullptr) |
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 |
const static int | orbitTolerance_ = 80 |
const static 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 | wantsInputProcessBlocks () |
static bool | wantsProcessBlocks () |
static bool | wantsStreamLuminosityBlocks () |
static bool | wantsStreamRuns () |
Protected Member Functions inherited from edm::ProducerBase | |
template<class ProductType > | |
BranchAliasSetterT< ProductType > | produces () |
declare what type of product will make and with which optional label More... | |
template<typename ProductType , BranchType B> | |
BranchAliasSetterT< ProductType > | produces () |
template<typename ProductType , Transition B> | |
BranchAliasSetterT< ProductType > | produces () |
BranchAliasSetter | produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true) |
template<BranchType B> | |
BranchAliasSetter | produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true) |
template<Transition B> | |
BranchAliasSetter | produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true) |
template<typename ProductType , Transition B> | |
BranchAliasSetterT< ProductType > | produces (std::string instanceName) |
template<class ProductType > | |
BranchAliasSetterT< ProductType > | produces (std::string instanceName) |
template<typename ProductType , BranchType B> | |
BranchAliasSetterT< ProductType > | produces (std::string instanceName) |
ProducesCollector | producesCollector () |
Protected Member Functions inherited from edm::EDConsumerBase | |
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
template<BranchType B = InEvent> | |
EDConsumerBaseAdaptor< B > | consumes (edm::InputTag tag) noexcept |
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event> | |
auto | esConsumes () |
template<Transition Tr = Transition::Event> | |
constexpr auto | esConsumes () noexcept |
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> | |
auto | esConsumes (ESInputTag const &tag) |
template<Transition Tr = Transition::Event> | |
auto | esConsumes (ESInputTag tag) noexcept |
template<Transition Tr = Transition::Event> | |
ESGetTokenGeneric | esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey) |
Used with EventSetupRecord::doGet. More... | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
Definition at line 41 of file MatacqProducer.h.
|
private |
Definition at line 51 of file MatacqProducer.h.
|
private |
Definition at line 50 of file MatacqProducer.h.
|
explicit |
Constructor
params | seletive readout parameters |
Definition at line 62 of file MatacqProducer.cc.
References gather_cfg::cout, digiInstanceName_, doOrbitOffset_, Exception, inputRawCollectionToken_, loadOrbitOffset(), logFile_, logFileName_, logTiming_, now(), orbitOffsetFile_, MillePedeFileConverter_cfg::out, CalibrationSummaryClient_cfi::params, posEstim_, produceDigis_, produceRaw_, rawInstanceName_, startTime_, timeLog_, timeLogFile_, timer_, MatacqProducer::PosEstimator::verbosity(), and verbosity_.
|
override |
Destructor
Definition at line 813 of file MatacqProducer.cc.
References gather_cfg::cout, logTiming_, mclose(), now(), startTime_, and submitPVValidationJobs::t.
|
private |
Add matacq digi to the event
event | the event |
digiInstanceName_ | name to give to the matacq digi instance |
Definition at line 174 of file MatacqProducer.cc.
References bufferSize, filterCSVwithJSON::copy, gather_cfg::cout, data_, DigiToRawDM_cff::digiColl, 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 689 of file MatacqProducer.cc.
References data, ev, Exception, FEDRawDataCollection::FEDData(), triggerObjects_cff::id, inputRawCollectionToken_, FEDNumbering::inRange(), edm::HandleBase::isValid(), AlCaHLTBitMon_ParallelJobs::p, and hgcalPlots::stat.
Referenced by addMatacqData().
|
private |
Definition at line 326 of file MatacqProducer.cc.
References funct::abs(), gather_cfg::cout, data_, MatacqProducer::PosEstimator::eventLength(), Exception, runEdmFileComparison::failed, fastRetrievalThresh_, newFWLiteAna::found, MatacqRawEvent::getDccLen(), MatacqRawEvent::getOrbitId(), MatacqRawEvent::getRunNum(), inFileName_, createfilelist::int, MatacqProducer::PosEstimator::invalid(), lastOrb_, matacq_, mread(), mrewind(), mseek(), msize(), mtell(), now(), hltrates_dqm_sourceclient-live_cfg::offset, orbitTolerance_, MatacqProducer::PosEstimator::pos(), posEstim_, writedatasetfile::run, convertSQLiteXML::runNumber, 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 525 of file MatacqProducer.cc.
References gather_cfg::cout, eventSkipCounter_, fileNames_, alignmentValidation::fname, newFWLiteAna::found, g, getOrbitRange(), mps_fire::i, MatacqProducer::PosEstimator::init(), lastOrb_, misOpened(), mopen(), now(), onErrorDisablingEvtCnt_, openedFileRunNumber_, posEstim_, convertSQLiteXML::runNumber, runSubDir(), and verbosity_.
Referenced by addMatacqData().
|
private |
Definition at line 648 of file MatacqProducer.cc.
References funct::abs(), data, ev, Exception, FEDRawDataCollection::FEDData(), triggerObjects_cff::id, inputRawCollectionToken_, FEDNumbering::inRange(), edm::HandleBase::isValid(), and orbitTolerance_.
Referenced by addMatacqData().
|
private |
Definition at line 1125 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 646 of file MatacqProducer.cc.
References ev.
Referenced by addMatacqData(), and produce().
|
private |
Loading orbit correction table from file.
Definition at line 826 of file MatacqProducer.cc.
References visDQMUpload::buf, gather_cfg::cout, Exception, f, ntuplemaker::iline, SiStripPI::max, now(), orbitOffset_, orbitOffsetFile_, writedatasetfile::run, and alignCSCRings::s.
Referenced by MatacqProducer().
|
private |
Definition at line 1062 of file MatacqProducer.cc.
References Skims_PA_cff::name, and hgcalPlots::stat.
|
private |
Definition at line 1088 of file MatacqProducer.cc.
References inFile_.
Referenced by mopen(), and ~MatacqProducer().
|
private |
Definition at line 1096 of file MatacqProducer.cc.
References inFile_.
|
private |
Definition at line 1094 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqFile().
|
private |
Definition at line 1075 of file MatacqProducer.cc.
References inFile_, inFileName_, mclose(), and Skims_PA_cff::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 1011 of file MatacqProducer.cc.
References visDQMUpload::buf, gather_cfg::cout, inFile_, lastOrb_, mrewind(), dqmiodumpmetadata::n, now(), and verbosity_.
Referenced by getMatacqEvent(), getOrbitRange(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 1055 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 989 of file MatacqProducer.cc.
References gather_cfg::cout, inFile_, mrewind(), now(), hltrates_dqm_sourceclient-live_cfg::offset, and verbosity_.
Referenced by getMatacqEvent(), getOrbitRange(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 1042 of file MatacqProducer.cc.
References visDQMUpload::buf, inFile_, alignCSCRings::s, and hgcalPlots::stat.
Referenced by getMatacqEvent(), getOrbitRange(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 1004 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent(), and getOrbitRange().
|
private |
Definition at line 1111 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().
|
overridevirtual |
Produces the EDM products
CMS | event |
eventSetup | event conditions |
Implements edm::EDProducer.
Definition at line 143 of file MatacqProducer.cc.
References addMatacqData(), gather_cfg::cout, disabled_, getRunNumber(), logTiming_, MatacqProducer::stats_t::nEvents, newRun(), now(), convertSQLiteXML::runNumber, runNumber_, startTime_, stats_, submitPVValidationJobs::t, timeLog_, timer_, and verbosity_.
|
staticprivate |
Definition at line 1104 of file MatacqProducer.cc.
References convertSQLiteXML::runNumber, and units().
Referenced by getMatacqFile().
|
staticprivate |
Definition at line 243 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Definition at line 245 of file MatacqProducer.h.
Referenced by addMatacqData(), and getMatacqEvent().
|
private |
Instance name to use for the produced Matacq digi collection
Definition at line 192 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Parameter to disable matacq data production. For timing purpose.
Definition at line 204 of file MatacqProducer.h.
Referenced by produce().
|
private |
Switch for orbit ID correction.
Definition at line 268 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
counter for event skipping
Definition at line 293 of file MatacqProducer.h.
Referenced by addMatacqData(), getMatacqFile(), and newRun().
|
private |
Definition at line 250 of file MatacqProducer.h.
Referenced by getMatacqEvent().
|
private |
Definition at line 188 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Definition at line 246 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
When true look for matacq data independently of trigger type.
Definition at line 235 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
|
private |
Name of currently opened matacq file
Definition at line 272 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 221 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 226 of file MatacqProducer.h.
Referenced by addMatacqData(), getCalibTriggerType(), getOrbitId(), and MatacqProducer().
|
private |
Definition at line 249 of file MatacqProducer.h.
Referenced by getMatacqEvent(), getMatacqFile(), and mread().
|
private |
Log file
Definition at line 289 of file MatacqProducer.h.
Referenced by MatacqProducer(), and newRun().
|
private |
|
private |
Switch for code timing.
Definition at line 312 of file MatacqProducer.h.
Referenced by MatacqProducer(), produce(), and ~MatacqProducer().
|
private |
Definition at line 237 of file MatacqProducer.h.
Referenced by addMatacqData(), and getMatacqEvent().
|
staticprivate |
Definition at line 274 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Switch for merging Matacq raw data with existing raw data collection.
Definition at line 231 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Number of events to skip in case of error
Definition at line 297 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Definition at line 248 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Orbit offset table.
Definition at line 264 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 260 of file MatacqProducer.h.
Referenced by loadOrbitOffset(), and MatacqProducer().
|
staticprivate |
Definition at line 247 of file MatacqProducer.h.
Referenced by getMatacqEvent(), and getOrbitId().
|
private |
Definition at line 252 of file MatacqProducer.h.
Referenced by getMatacqEvent(), getMatacqFile(), and MatacqProducer().
|
private |
Swictch for Matacq digi producion
Definition at line 212 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Switch for Matacq FED raw data production
Definition at line 216 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Instance name to use for the produced Matacq raw data collection
Definition at line 196 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Number of the currently processed run
Definition at line 316 of file MatacqProducer.h.
|
private |
Definition at line 254 of file MatacqProducer.h.
Referenced by MatacqProducer(), produce(), and ~MatacqProducer().
|
private |
Referenced by addMatacqData(), newRun(), and produce().
|
staticprivate |
Definition at line 282 of file MatacqProducer.h.
|
private |
Output stream to log code timing
Definition at line 308 of file MatacqProducer.h.
Referenced by MatacqProducer(), and produce().
|
private |
Name of file to log timing
Definition at line 301 of file MatacqProducer.h.
Referenced by MatacqProducer().
|
private |
Buffer for timing
Definition at line 304 of file MatacqProducer.h.
Referenced by MatacqProducer(), and produce().
|
private |
Parameter to switch module timing.
Definition at line 200 of file MatacqProducer.h.
|
private |
Verbosity level
Definition at line 208 of file MatacqProducer.h.
Referenced by addMatacqData(), getMatacqEvent(), getMatacqFile(), MatacqProducer(), mread(), mseek(), MatacqProducer::PosEstimator::pos(), and produce().