CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
MatacqProducer Class Reference

#include <MatacqProducer.h>

Inheritance diagram for MatacqProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 

Public Member Functions

 MatacqProducer (const edm::ParameterSet &params)
 
virtual void produce (edm::Event &event, const edm::EventSetup &eventSetup)
 
 ~MatacqProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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)
 

Detailed Description

Definition at line 45 of file MatacqProducer.h.

Member Typedef Documentation

typedef FILE* MatacqProducer::FILE_t
private

Definition at line 60 of file MatacqProducer.h.

typedef off_t MatacqProducer::filepos_t
private

Definition at line 59 of file MatacqProducer.h.

Member Enumeration Documentation

Enumerator
laserType 
ledType 
tpType 
pedType 

Definition at line 48 of file MatacqProducer.h.

Constructor & Destructor Documentation

MatacqProducer::MatacqProducer ( const edm::ParameterSet params)
explicit

Constructor

Parameters
paramsseletive readout parameters

Definition at line 65 of file MatacqProducer.cc.

MatacqProducer::~MatacqProducer ( )

Destructor

Definition at line 767 of file MatacqProducer.cc.

Member Function Documentation

void MatacqProducer::addMatacqData ( edm::Event event)
private

Add matacq digi to the event

Parameters
eventthe event
digiInstanceName_name to give to the matacq digi instance

Definition at line 179 of file MatacqProducer.cc.

int MatacqProducer::getCalibTriggerType ( edm::Event ev) const
private

Definition at line 647 of file MatacqProducer.cc.

bool MatacqProducer::getMatacqEvent ( uint32_t  runNumber,
int32_t  orbitId,
bool  fileChange 
)
private

Definition at line 343 of file MatacqProducer.cc.

bool MatacqProducer::getMatacqFile ( uint32_t  runNumber,
uint32_t  orbitId,
bool *  fileChange = 0 
)
private

Retrieve the file containing a given matacq event

Parameters
runNumberNumber of the run the matacq event is looking from
orbitIdId of the orbit of the matacq event
fileChangeif not null pointer, set to true if the file changed.
Returns
true if file retrieval succeeded, false otherwise. found.

Definition at line 543 of file MatacqProducer.cc.

uint32_t MatacqProducer::getOrbitId ( edm::Event ev) const
private

Definition at line 602 of file MatacqProducer.cc.

uint32_t MatacqProducer::getRunNumber ( edm::Event ev) const
private

Definition at line 598 of file MatacqProducer.cc.

void MatacqProducer::loadOrbitOffset ( )
private

Loading orbit correction table from file.

See Also
orbitOffsetFile_

Definition at line 780 of file MatacqProducer.cc.

bool MatacqProducer::mcheck ( const std::string &  name)
private

Definition at line 1005 of file MatacqProducer.cc.

void MatacqProducer::mclose ( )
private

Definition at line 1030 of file MatacqProducer.cc.

bool MatacqProducer::meof ( )
private

Definition at line 1039 of file MatacqProducer.cc.

bool MatacqProducer::misOpened ( )
private

Definition at line 1035 of file MatacqProducer.cc.

bool MatacqProducer::mopen ( const std::string &  name)
private

Definition at line 1018 of file MatacqProducer.cc.

bool MatacqProducer::mread ( char *  buf,
size_t  n,
const char *  mess = 0,
bool  peek = false 
)
private

Read a data block from input file. On failure file position is restored and if position restoring fails, file is rewind.

Parameters
bufbuffer to store read data
nsize of data block
messtext to insert in the eventual error message.
peekif true file position is restored after the data read
Returns
true on success, false on failure

Definition at line 959 of file MatacqProducer.cc.

bool MatacqProducer::mrewind ( )
private

Definition at line 999 of file MatacqProducer.cc.

bool MatacqProducer::mseek ( filepos_t  offset,
int  whence = SEEK_SET,
const char *  mess = 0 
)
private

Move input file read pointer. On failure file is rewind.

Parameters
bufbuffer to store read data
nsize of data block
messtext to insert in the eventual error message.
Returns
true on success, false on failure

Definition at line 939 of file MatacqProducer.cc.

bool MatacqProducer::msize ( filepos_t s)
private

Definition at line 987 of file MatacqProducer.cc.

bool MatacqProducer::mtell ( filepos_t pos)
private

Definition at line 952 of file MatacqProducer.cc.

void MatacqProducer::newRun ( int  prevRun,
int  newRun 
)
private

Definition at line 1053 of file MatacqProducer.cc.

void MatacqProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
virtual

Produces the EDM products

Parameters
CMSevent
eventSetupevent conditions

Implements edm::EDProducer.

Definition at line 147 of file MatacqProducer.cc.

Referenced by JSONExport.JsonExport::export().

std::string MatacqProducer::runSubDir ( uint32_t  runNumber)
staticprivate

Definition at line 1046 of file MatacqProducer.cc.

Member Data Documentation

const int MatacqProducer::bufferSize = 30000
staticprivate

Definition at line 264 of file MatacqProducer.h.

std::vector<unsigned char> MatacqProducer::data_
private

Definition at line 266 of file MatacqProducer.h.

std::string MatacqProducer::digiInstanceName_
private

Instance name to use for the produced Matacq digi collection

Definition at line 212 of file MatacqProducer.h.

bool MatacqProducer::disabled_
private

Parameter to disable matacq data production. For timing purpose.

Definition at line 224 of file MatacqProducer.h.

bool MatacqProducer::doOrbitOffset_
private

Switch for orbit ID correction.

See Also
orbitOffsetFile_

Definition at line 289 of file MatacqProducer.h.

int MatacqProducer::eventSkipCounter_
private

counter for event skipping

Definition at line 315 of file MatacqProducer.h.

int MatacqProducer::fastRetrievalThresh_
private

Definition at line 271 of file MatacqProducer.h.

std::vector<std::string> MatacqProducer::fileNames_
private

Definition at line 208 of file MatacqProducer.h.

MatacqDataFormatter MatacqProducer::formatter_
private

Definition at line 267 of file MatacqProducer.h.

bool MatacqProducer::ignoreTriggerType_
private

When true look for matacq data independently of trigger type.

Definition at line 256 of file MatacqProducer.h.

FILE_t MatacqProducer::inFile_
private

Stream of currently opened matacq file

Definition at line 262 of file MatacqProducer.h.

std::string MatacqProducer::inFileName_
private

Name of currently opened matacq file

Definition at line 293 of file MatacqProducer.h.

edm::InputTag MatacqProducer::inputRawCollection_
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.

edm::EDGetTokenT<FEDRawDataCollection> MatacqProducer::inputRawCollectionToken_
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.

int32_t MatacqProducer::lastOrb_
private

Definition at line 270 of file MatacqProducer.h.

std::ofstream MatacqProducer::logFile_
private

Log file

Definition at line 310 of file MatacqProducer.h.

std::string MatacqProducer::logFileName_
private

Log file name

Definition at line 306 of file MatacqProducer.h.

bool MatacqProducer::logTiming_
private

Switch for code timing.

Definition at line 334 of file MatacqProducer.h.

MatacqRawEvent MatacqProducer::matacq_
private

Definition at line 258 of file MatacqProducer.h.

const int MatacqProducer::matacqFedId_ = 655
staticprivate

Definition at line 295 of file MatacqProducer.h.

bool MatacqProducer::mergeRaw_
private

Switch for merging Matacq raw data with existing raw data collection.

Definition at line 252 of file MatacqProducer.h.

int MatacqProducer::onErrorDisablingEvtCnt_
private

Number of events to skip in case of error

Definition at line 319 of file MatacqProducer.h.

uint32_t MatacqProducer::openedFileRunNumber_
private

Definition at line 269 of file MatacqProducer.h.

std::map<uint32_t,uint32_t> MatacqProducer::orbitOffset_
private

Orbit offset table.

See Also
orbitOffsetFile_

Definition at line 285 of file MatacqProducer.h.

std::string MatacqProducer::orbitOffsetFile_
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.

const int MatacqProducer::orbitTolerance_ = 80
staticprivate

Definition at line 268 of file MatacqProducer.h.

PosEstimator MatacqProducer::posEstim_
private

Definition at line 273 of file MatacqProducer.h.

bool MatacqProducer::produceDigis_
private

Swictch for Matacq digi producion

Definition at line 232 of file MatacqProducer.h.

bool MatacqProducer::produceRaw_
private

Switch for Matacq FED raw data production

Definition at line 236 of file MatacqProducer.h.

std::string MatacqProducer::rawInstanceName_
private

Instance name to use for the produced Matacq raw data collection

Definition at line 216 of file MatacqProducer.h.

uint32_t MatacqProducer::runNumber_
private

Number of the currently processed run

Definition at line 338 of file MatacqProducer.h.

timeval MatacqProducer::startTime_
private

Definition at line 275 of file MatacqProducer.h.

struct MatacqProducer::stats_t MatacqProducer::stats_
private
const MatacqProducer::stats_t MatacqProducer::stats_init = {0,0,0}
staticprivate

Definition at line 303 of file MatacqProducer.h.

std::ofstream MatacqProducer::timeLog_
private

Output stream to log code timing

Definition at line 330 of file MatacqProducer.h.

std::string MatacqProducer::timeLogFile_
private

Name of file to log timing

Definition at line 323 of file MatacqProducer.h.

timeval MatacqProducer::timer_
private

Buffer for timing

Definition at line 326 of file MatacqProducer.h.

bool MatacqProducer::timing_
private

Parameter to switch module timing.

Definition at line 220 of file MatacqProducer.h.

int MatacqProducer::verbosity_
private

Verbosity level

Definition at line 228 of file MatacqProducer.h.