CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

cond::EmptyIOVSource Class Reference

Inheritance diagram for cond::EmptyIOVSource:
edm::ProducerSourceBase edm::InputSource edm::ProductRegistryHelper

List of all members.

Public Types

typedef unsigned long long Time_t

Public Member Functions

 EmptyIOVSource (edm::ParameterSet const &, edm::InputSourceDescription const &)
 ~EmptyIOVSource ()

Private Member Functions

virtual void initialize (edm::EventID &id, edm::TimeValue_t &time, edm::TimeValue_t &interval) override
virtual void produce (edm::Event &e) override
virtual bool setRunAndEventInfo (edm::EventID &id, edm::TimeValue_t &time) override

Private Attributes

Time_t m_current
Time_t m_firstValid
Time_t m_interval
Time_t m_lastValid
std::string m_timeType

Detailed Description

Definition at line 4 of file EmptyIOVSource.cc.


Member Typedef Documentation

typedef unsigned long long cond::EmptyIOVSource::Time_t

Definition at line 6 of file EmptyIOVSource.cc.


Constructor & Destructor Documentation

cond::EmptyIOVSource::EmptyIOVSource ( edm::ParameterSet const &  pset,
edm::InputSourceDescription const &  desc 
)

Definition at line 30 of file EmptyIOVSource.cc.

References m_current, and m_firstValid.

                                                                       :
    edm::ProducerSourceBase(pset,desc,true),
    m_timeType(pset.getParameter<std::string>("timetype")),
    m_firstValid(pset.getParameter<unsigned long long>("firstValue")),
    m_lastValid(pset.getParameter<unsigned long long>("lastValue")),
    m_interval(pset.getParameter<unsigned long long>("interval")){
    m_current=m_firstValid;
  }
cond::EmptyIOVSource::~EmptyIOVSource ( )

Definition at line 39 of file EmptyIOVSource.cc.

                                  {
  }

Member Function Documentation

void cond::EmptyIOVSource::initialize ( edm::EventID id,
edm::TimeValue_t time,
edm::TimeValue_t interval 
) [override, private, virtual]

Reimplemented from edm::ProducerSourceBase.

Definition at line 60 of file EmptyIOVSource.cc.

References edm::errors::Configuration, Exception, prof2calltree::l, edm::ProducerSourceBase::luminosityBlock(), edm::LuminosityBlockID::luminosityBlock(), m_firstValid, m_interval, m_timeType, edm::LuminosityBlockID::run(), and AlCaHLTBitMon_QueryRunRegistry::string.

                                                                                               {
    if( m_timeType=="runnumber" ){
      id = edm::EventID(m_firstValid, id.luminosityBlock(), 1);
      interval = 0LL; 
    }else if( m_timeType=="timestamp" ){
      time = m_firstValid;
      interval = m_interval; 
    }else if( m_timeType=="lumiid" ){
      edm::LuminosityBlockID l(m_firstValid);
      id = edm::EventID(l.run(), l.luminosityBlock(), 1);
      interval = 0LL; 
    }else{
      throw edm::Exception(edm::errors::Configuration, std::string("EmptyIOVSource::initialize: ")+m_timeType+std::string("is not one of the supported types: runnumber,timestamp,lumiid") );
    }
  }
void cond::EmptyIOVSource::produce ( edm::Event e) [override, private, virtual]

Implements edm::ProducerSourceBase.

Definition at line 41 of file EmptyIOVSource.cc.

                                           {
  }  
bool cond::EmptyIOVSource::setRunAndEventInfo ( edm::EventID id,
edm::TimeValue_t time 
) [override, private, virtual]

Implements edm::ProducerSourceBase.

Definition at line 43 of file EmptyIOVSource.cc.

References prof2calltree::l, edm::ProducerSourceBase::luminosityBlock(), edm::LuminosityBlockID::luminosityBlock(), m_current, m_interval, m_lastValid, m_timeType, convertSQLiteXML::ok, and edm::LuminosityBlockID::run().

                                                                             {
    if(m_current<=m_lastValid){
      if( m_timeType=="runnumber" ){
        id = edm::EventID(m_current, id.luminosityBlock(), 1);
      }else if( m_timeType=="timestamp" ){
        time = m_current;
      }else if( m_timeType=="lumiid" ){
        edm::LuminosityBlockID l(m_current);
        id = edm::EventID(l.run(), l.luminosityBlock(), 1);
        //std::cout<<"run "<<l.run()<<std::endl;
        //std::cout<<"luminosityBlock "<<l.luminosityBlock()<<std::endl;
      }
    }
    bool ok = !(m_lastValid<m_current);
    m_current += m_interval;
    return ok;
  }

Member Data Documentation

Definition at line 18 of file EmptyIOVSource.cc.

Referenced by EmptyIOVSource(), and setRunAndEventInfo().

Definition at line 15 of file EmptyIOVSource.cc.

Referenced by EmptyIOVSource(), and initialize().

Definition at line 17 of file EmptyIOVSource.cc.

Referenced by initialize(), and setRunAndEventInfo().

Definition at line 16 of file EmptyIOVSource.cc.

Referenced by setRunAndEventInfo().

std::string cond::EmptyIOVSource::m_timeType [private]

Definition at line 14 of file EmptyIOVSource.cc.

Referenced by initialize(), and setRunAndEventInfo().