CMS 3D CMS Logo

Public Member Functions | Private Attributes

CondReader Class Reference

Inheritance diagram for CondReader:
edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const edm::Event &evt, const edm::EventSetup &evtSetup)
 CondReader (const edm::ParameterSet &iConfig)
 ~CondReader ()

Private Attributes

unsigned long long since
unsigned long long till

Detailed Description

Definition at line 19 of file CondReader.cc.


Constructor & Destructor Documentation

CondReader::CondReader ( const edm::ParameterSet iConfig)

Definition at line 32 of file CondReader.cc.

                                                     : 
  since(iConfig.getUntrackedParameter<unsigned long long>("since",0)),
  till(iConfig.getUntrackedParameter<unsigned long long>("till",0))
{}
CondReader::~CondReader ( )

Definition at line 37 of file CondReader.cc.

{}

Member Function Documentation

void CondReader::analyze ( const edm::Event evt,
const edm::EventSetup evtSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 39 of file CondReader.cc.

References gather_cfg::cout, edm::EventSetup::get(), RPCObImon::ObImon_rpc, edm::ESHandle< T >::product(), since, till, cond::rpcobgas::time, and RPCFw::UTtoT().

{
  
  edm::Service<cond::service::PoolDBOutputService> mydbservice;

  edm::ESHandle<RPCObImon> condRcd;
  evtSetup.get<RPCObImonRcd>().get(condRcd);
  edm::LogInfo("CondReader") << "[CondReader::analyze] End Reading Cond" << std::endl;
  
  std::cout << "Run start: " << since << " - Run stop: " << till << std::endl;
  
  RPCFw time ("", "", "");
  coral::TimeStamp sTime = time.UTtoT(since);
  coral::TimeStamp tTime = time.UTtoT(till);
  int ndateS = (sTime.day() * 10000) + (sTime.month() * 100) + (sTime.year()-2000);
  int ntimeS = (sTime.hour() * 10000) + (sTime.minute() * 100) + sTime.second();
  int ndateT = (tTime.day() * 10000) + (tTime.month() * 100) + (tTime.year()-2000);
  int ntimeT = (tTime.hour() * 10000) + (tTime.minute() * 100) + tTime.second();
  std::cout << "Run start: " << ndateS << " " << ntimeS << " - Run stop: " << ndateT << " " << ntimeT << std::endl;

  const RPCObImon* cond = condRcd.product();
  std::vector<RPCObImon::I_Item> mycond = cond->ObImon_rpc; 
  std::vector<RPCObImon::I_Item>::iterator icond;

  std::cout << "************************************" << std::endl;
  for(icond = mycond.begin(); icond < mycond.end(); ++icond){

    if (icond->day >= ndateS && icond->time >= ntimeS && icond->day <= ndateT && icond->time <= ntimeT)
      std::cout<<"dpid = " << icond->dpid << " - value = " << icond->value << " - day = " << icond->day << " - time = " << icond->time << std::endl;
  }
  
}

Member Data Documentation

unsigned long long CondReader::since [private]

Definition at line 27 of file CondReader.cc.

Referenced by analyze().

unsigned long long CondReader::till [private]

Definition at line 28 of file CondReader.cc.

Referenced by analyze().