CMS 3D CMS Logo

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

#include <EvFRecordInserter.h>

Inheritance diagram for evf::EvFRecordInserter:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
 EvFRecordInserter (const edm::ParameterSet &)
 
 ~EvFRecordInserter ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- 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 (const std::string &iProcessName, std::vector< const char * > &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 Attributes

EvffedFillerEP ef_
 
uint64_t ehi_
 
uint32_t evc_
 
edm::InputTag label_
 
uint32_t last_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 12 of file EvFRecordInserter.h.

Constructor & Destructor Documentation

evf::EvFRecordInserter::EvFRecordInserter ( const edm::ParameterSet pset)
explicit

Definition at line 12 of file EvFRecordInserter.cc.

13  : evc_(0)
14  , ehi_(0LL)
15  , last_(0)
16  , label_(pset.getParameter<edm::InputTag>("inputTag"))
17  {}
T getParameter(std::string const &) const
evf::EvFRecordInserter::~EvFRecordInserter ( )
inline

Definition at line 17 of file EvFRecordInserter.h.

17 {};

Member Function Documentation

void evf::EvFRecordInserter::analyze ( const edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 18 of file EvFRecordInserter.cc.

References FEDRawData::data(), data, ef_, ehi_, evc_, edm::EventID::event(), evf::fedinterface::EVFFED_ID, edm::Event::getByLabel(), edm::EventBase::id(), label_, last_, fileCollector::now, lumiPlot::rawdata, evf::EvffedFillerEP::setEPEventCount(), evf::EvffedFillerEP::setEPEventHisto(), evf::EvffedFillerEP::setEPEventId(), evf::EvffedFillerEP::setEPProcessId(), evf::EvffedFillerEP::setEPTimeStamp(), FEDRawData::size(), and findQualityFiles::size.

19  {
21  e.getByLabel(label_,rawdata);
22  unsigned int id = fedinterface::EVFFED_ID;
23  const FEDRawData& data = rawdata->FEDData(id);
24  size_t size=data.size();
25  unsigned char * cdata = const_cast<unsigned char*>(data.data());
26  timeval now;
27  gettimeofday(&now,0);
28  evc_++;
29  uint32_t ldiff = 0;
30  if(e.id().event()-last_ < 0xff)
31  ldiff = e.id().event()-last_;
32  else
33  ldiff = 0xff;
34  ehi_ = (ehi_<<8)+(uint64_t)ldiff;
35  last_ = e.id().event();
36  if(size>0){
37  ef_.setEPTimeStamp(((uint64_t)(now.tv_sec) << 32)
38  + (uint64_t)(now.tv_usec),cdata);
39 
40  ef_.setEPProcessId(getpid(),cdata);
41  ef_.setEPEventId(e.id().event(), cdata);
42  ef_.setEPEventCount(evc_, cdata);
43  ef_.setEPEventHisto(ehi_, cdata);
44  }
45  }
EventNumber_t event() const
Definition: EventID.h:41
void setEPEventId(uint32_t eid, unsigned char *payload)
const unsigned int EVFFED_ID
Definition: FED1023.h:28
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
void setEPProcessId(pid_t pid, unsigned char *payload)
void setEPTimeStamp(uint64_t ts, unsigned char *payload)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
void setEPEventCount(uint32_t evc, unsigned char *payload)
unsigned long long uint64_t
Definition: Time.h:15
edm::EventID id() const
Definition: EventBase.h:60
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void setEPEventHisto(uint64_t ehi, unsigned char *payload)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
dictionary rawdata
Definition: lumiPlot.py:393
tuple size
Write out results.

Member Data Documentation

EvffedFillerEP evf::EvFRecordInserter::ef_
private

Definition at line 22 of file EvFRecordInserter.h.

Referenced by analyze().

uint64_t evf::EvFRecordInserter::ehi_
private

Definition at line 24 of file EvFRecordInserter.h.

Referenced by analyze().

uint32_t evf::EvFRecordInserter::evc_
private

Definition at line 23 of file EvFRecordInserter.h.

Referenced by analyze().

edm::InputTag evf::EvFRecordInserter::label_
private
uint32_t evf::EvFRecordInserter::last_
private

Definition at line 25 of file EvFRecordInserter.h.

Referenced by analyze().