#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 |
typedef WorkerT< EDProducer > | WorkerType |
Public Types inherited from edm::ProducerBase | |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Public Member Functions | |
MatacqProducer (const edm::ParameterSet ¶ms) | |
virtual void | produce (edm::Event &event, const edm::EventSetup &eventSetup) |
~MatacqProducer () | |
Public Member Functions inherited from edm::EDProducer | |
EDProducer () | |
virtual | ~EDProducer () |
Public Member Functions inherited from edm::ProducerBase | |
ProducerBase () | |
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
boost::function< void(const BranchDescription &)> | registrationCallback () const |
used by the fwk to register list of products More... | |
virtual | ~ProducerBase () |
Private Types | |
typedef std::auto_ptr< Storage > | FILE_t |
typedef IOOffset | 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) |
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 | 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_ |
MatacqRawEvent | matacq_ |
bool | mergeRaw_ |
uint32_t | openedFileRunNumber_ |
std::map< uint32_t, uint32_t > | orbitOffset_ |
std::string | orbitOffsetFile_ |
PosEstimator | posEstim_ |
bool | produceDigis_ |
bool | produceRaw_ |
std::string | rawInstanceName_ |
timeval | startTime_ |
struct MatacqProducer::stats_t | stats_ |
bool | timing_ |
int | verbosity_ |
Static Private Attributes | |
static const int | bufferSize = 30000 |
static const int | matacqFedId_ = 655 |
static int | orbitTolerance_ = 80 |
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) |
Protected Member Functions inherited from edm::EDProducer | |
CurrentProcessingContext const * | currentContext () const |
Protected Member Functions inherited from edm::ProducerBase | |
template<class TProducer , class TMethod > | |
void | callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod) |
EDM producer module providing MATACQ data. The MATACQ is a board sampling the ECAL laser pulse. Data are recording in dedicated files. This module permits to read these files add to each laser type EDM the corresponding MATACQ data: as digis (#see MatacqDigiCollection) or the raw data FED block (#see FEDRawDataCollection). Run and orbit numbers are used to match the MATACQ data with the ECAL DCC data.
Module parameters are listed and documented in EventFilter/EcalRawToDigi/ecalMatacq_cfi.py.
Definition at line 51 of file MatacqProducer.h.
|
private |
Definition at line 63 of file MatacqProducer.h.
|
private |
Definition at line 62 of file MatacqProducer.h.
Enumerator | |
---|---|
laserType | |
ledType | |
tpType | |
pedType |
Definition at line 54 of file MatacqProducer.h.
|
explicit |
Constructor
params | seletive readout parameters |
Definition at line 49 of file MatacqProducer.cc.
References gather_cfg::cout, digiInstanceName_, doOrbitOffset_, edm::hlt::Exception, loadOrbitOffset(), logFile_, logFileName_, orbitOffsetFile_, dbtoconf::out, posEstim_, produceDigis_, produceRaw_, rawInstanceName_, startTime_, MatacqProducer::PosEstimator::verbosity(), and verbosity_.
MatacqProducer::~MatacqProducer | ( | ) |
Destructor
Definition at line 682 of file MatacqProducer.cc.
References gather_cfg::cout, logFile_, mclose(), MatacqProducer::stats_t::nEvents, MatacqProducer::stats_t::nLaserEventsWithMatacq, MatacqProducer::stats_t::nNonLaserEventsWithMatacq, startTime_, stats_, matplotRender::t, and timing_.
|
private |
Add matacq digi to the event
event | the event |
digiInstanceName_ | name to give to the matacq digi instance |
Definition at line 119 of file MatacqProducer.cc.
References bufferSize, filterCSVwithJSON::copy, gather_cfg::cout, data_, digiInstanceName_, doOrbitOffset_, formatter_, getCalibTriggerType(), MatacqRawEvent::getDccLen(), getMatacqEvent(), getMatacqFile(), getOrbitId(), MatacqRawEvent::getOrbitId(), MatacqRawEvent::getParsedLen(), getRunNumber(), ignoreTriggerType_, inputRawCollection_, edm::InputTag::instance(), MatacqDataFormatter::interpretRawData(), edm::InputTag::label(), laserType, matacq_, matacqFedId_, mergeRaw_, MatacqProducer::stats_t::nLaserEventsWithMatacq, MatacqProducer::stats_t::nNonLaserEventsWithMatacq, evf::evtn::offset(), orbitOffset_, produceDigis_, produceRaw_, rawInstanceName_, inputsource_file_cfi::runNumber, stats_, and verbosity_.
Referenced by produce().
|
private |
Definition at line 564 of file MatacqProducer.cc.
References Majority< T >::add(), FEDRawData::data(), runTheMatrix::data, edm::hlt::Exception, edm::Event::getByType(), FEDNumbering::inRange(), edm::HandleBase::isValid(), L1TEmulatorMonitor_cff::p, Majority< T >::result(), and FEDRawData::size().
Referenced by addMatacqData().
|
private |
Definition at line 270 of file MatacqProducer.cc.
References 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(), evf::evtn::offset(), orbitTolerance_, pos, MatacqProducer::PosEstimator::pos(), posEstim_, DTTTrigCorrFirst::run, evf::utils::state, 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 466 of file MatacqProducer.cc.
References gather_cfg::cout, fileNames_, alignmentValidation::fname, diffTreeTool::format(), newFWLiteAna::found, i, MatacqProducer::PosEstimator::init(), lastOrb_, mcheck(), misOpened(), mopen(), openedFileRunNumber_, posEstim_, inputsource_file_cfi::runNumber, runSubDir(), and verbosity_.
Referenced by addMatacqData().
|
private |
Definition at line 520 of file MatacqProducer.cc.
References abs, FEDRawData::data(), runTheMatrix::data, edm::hlt::Exception, edm::Event::getByType(), edm::EventBase::id(), FEDNumbering::inRange(), edm::HandleBase::isValid(), orbitTolerance_, and FEDRawData::size().
Referenced by addMatacqData().
|
private |
Definition at line 516 of file MatacqProducer.cc.
References edm::Event::run().
Referenced by addMatacqData().
|
private |
Loading orbit correction table from file.
Definition at line 701 of file MatacqProducer.cc.
References gather_cfg::cout, edm::hlt::Exception, f, ntuplemaker::iline, max(), orbitOffset_, orbitOffsetFile_, DTTTrigCorrFirst::run, and asciidump::s.
Referenced by MatacqProducer().
|
private |
|
private |
Definition at line 940 of file MatacqProducer.cc.
References inFile_.
Referenced by mopen(), and ~MatacqProducer().
|
private |
|
private |
Definition at line 945 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqFile().
|
private |
Definition at line 928 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 877 of file MatacqProducer.cc.
References gather_cfg::cout, inFile_, lastOrb_, mrewind(), and verbosity_.
Referenced by getMatacqEvent(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 917 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 857 of file MatacqProducer.cc.
References gather_cfg::cout, inFile_, mrewind(), and verbosity_.
Referenced by getMatacqEvent(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 905 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent(), and MatacqProducer::PosEstimator::init().
|
private |
Definition at line 870 of file MatacqProducer.cc.
References inFile_.
Referenced by getMatacqEvent().
|
virtual |
Produces the EDM products
CMS | event |
eventSetup | event conditions |
Implements edm::EDProducer.
Definition at line 110 of file MatacqProducer.cc.
References addMatacqData(), gather_cfg::cout, disabled_, MatacqProducer::stats_t::nEvents, startTime_, stats_, and verbosity_.
Referenced by python.JSONExport.JsonExport::export(), and python.HTMLExport.HTMLExport::export().
|
staticprivate |
Definition at line 956 of file MatacqProducer.cc.
References diffTreeTool::format().
Referenced by getMatacqFile().
|
staticprivate |
Definition at line 262 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Definition at line 264 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 287 of file MatacqProducer.h.
Referenced by addMatacqData(), and MatacqProducer().
|
private |
Definition at line 269 of file MatacqProducer.h.
Referenced by getMatacqEvent().
|
private |
Definition at line 212 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Definition at line 265 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
When true look for matacq data independently of trigger type.
Definition at line 254 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
|
private |
Name of currently opened matacq file
Definition at line 291 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 245 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Definition at line 268 of file MatacqProducer.h.
Referenced by getMatacqEvent(), getMatacqFile(), and mread().
|
private |
Log file
Definition at line 308 of file MatacqProducer.h.
Referenced by MatacqProducer(), and ~MatacqProducer().
|
private |
|
private |
Definition at line 256 of file MatacqProducer.h.
Referenced by addMatacqData(), and getMatacqEvent().
|
staticprivate |
Definition at line 293 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Switch for merging Matacq raw data with existing raw data collection.
Definition at line 250 of file MatacqProducer.h.
Referenced by addMatacqData().
|
private |
Definition at line 267 of file MatacqProducer.h.
Referenced by getMatacqFile().
|
private |
Orbit offset table.
Definition at line 283 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 279 of file MatacqProducer.h.
Referenced by loadOrbitOffset(), and MatacqProducer().
|
staticprivate |
Definition at line 266 of file MatacqProducer.h.
Referenced by getMatacqEvent(), and getOrbitId().
|
private |
Definition at line 271 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 |
Definition at line 273 of file MatacqProducer.h.
Referenced by MatacqProducer(), produce(), and ~MatacqProducer().
|
private |
Referenced by addMatacqData(), produce(), and ~MatacqProducer().
|
staticprivate |
Definition at line 301 of file MatacqProducer.h.
|
private |
Parameter to switch module timing.
Definition at line 224 of file MatacqProducer.h.
Referenced by ~MatacqProducer().
|
private |
Verbosity level
Definition at line 232 of file MatacqProducer.h.
Referenced by addMatacqData(), getMatacqEvent(), getMatacqFile(), MatacqProducer(), mread(), mseek(), MatacqProducer::PosEstimator::pos(), and produce().