CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Attributes

popcon::RpcDataFebmap Class Reference

#include <RPCFebmapSH.h>

Inheritance diagram for popcon::RpcDataFebmap:
popcon::PopConSourceHandler< RPCObFebmap >

List of all members.

Public Member Functions

void getNewObjects ()
std::string id () const
 RpcDataFebmap (const edm::ParameterSet &pset)
 ~RpcDataFebmap ()

Public Attributes

RPCObFebmapFebdata
unsigned long long niov
unsigned long long snc
unsigned long long tll
unsigned long long utime

Private Attributes

std::string host
std::string m_name
unsigned long long m_since
unsigned long long m_till
std::string passw
std::string user

Detailed Description

Definition at line 27 of file RPCFebmapSH.h.


Constructor & Destructor Documentation

popcon::RpcDataFebmap::~RpcDataFebmap ( )

Definition at line 23 of file RPCFebmapSH.cc.

{
}
popcon::RpcDataFebmap::RpcDataFebmap ( const edm::ParameterSet pset)

Definition at line 14 of file RPCFebmapSH.cc.

                                                              :
  m_name(pset.getUntrackedParameter<std::string>("name","RpcData")),
  host(pset.getUntrackedParameter<std::string>("host", "source db host")),
  user(pset.getUntrackedParameter<std::string>("user", "source username")),
  passw(pset.getUntrackedParameter<std::string>("passw", "source password")),
  m_since(pset.getUntrackedParameter<unsigned long long>("since",5)),
  m_till(pset.getUntrackedParameter<unsigned long long>("till",0)){
}

Member Function Documentation

void popcon::RpcDataFebmap::getNewObjects ( ) [virtual]

Implements popcon::PopConSourceHandler< RPCObFebmap >.

Definition at line 27 of file RPCFebmapSH.cc.

References gather_cfg::cout, RPCFw::createFEB(), query::host, hcal_dqm_sourceclient-file_cfg::user, and edm::Timestamp::value().

                                        {

  std::cout << "------- " << m_name << " - > getNewObjects\n" 
            << "got offlineInfo"<< tagInfo().name 
            << ", size " << tagInfo().size << ", last object valid since " 
            << tagInfo().lastInterval.first << " token "   
            << tagInfo().lastPayloadToken << std::endl;

  std::cout << " ------ last entry info regarding the payload (if existing): " 
            << logDBEntry().usertext << "last record with the correct tag has been written in the db: "
            << logDBEntry().destinationDB << std::endl; 
  
  //  snc = tagInfo().lastInterval.first;


   std::cout << std::endl << "=============================================" << std::endl;
   std::cout << std::endl << "===================  FEB   ==================" << std::endl;
   std::cout << std::endl << "=============================================" << std::endl << std::endl;
   snc = m_since;
   std::cout << ">> Range mode [" << snc << ", " << m_till << "]" << std::endl;
   std::cout << std::endl << "=============================================" << std::endl << std::endl;
   

  
  RPCFw caen ( host, user, passw );
  std::vector<RPCObFebmap::Feb_Item> Febmapcheck;

  Febmapcheck = caen.createFEB(snc, m_till);
  Febdata = new RPCObFebmap();
  RPCObFebmap::Feb_Item Febfill;
  std::vector<RPCObFebmap::Feb_Item>::iterator Febit;
  for(Febit = Febmapcheck.begin(); Febit != Febmapcheck.end(); Febit++)
    {
      Febfill = *(Febit);
      Febdata->ObFebMap_rpc.push_back(Febfill);
    }
  std::cout << " >> Final object size: " << Febdata->ObFebMap_rpc.size() << std::endl;

   if (Febdata->ObFebMap_rpc.size() > 0) {
     niov = snc;
   } else {
     niov = snc;
     std::cout << "NO DATA TO BE STORED" << std::endl;
   }


   ::timeval tv;
   tv.tv_sec = niov;
   tv.tv_usec = 0;
   edm::Timestamp tmstamp((unsigned long long)tv.tv_sec*1000000+(unsigned long long)tv.tv_usec);
   std::cout << "UNIX time = " << tmstamp.value() << std::endl;

   edm::TimeValue_t daqtime=0LL;
   daqtime=tv.tv_sec;
   daqtime=(daqtime<<32)+tv.tv_usec;
   edm::Timestamp daqstamp(daqtime);
   edm::TimeValue_t dtime = daqstamp.value();
   std::cout<<"DAQ time = " << dtime <<std::endl;

   niov = dtime;

   std::cout << "===> New IOV: since is = " << niov << std::endl;
   m_to_transfer.push_back(std::make_pair((RPCObFebmap*)Febdata,niov));

}
std::string popcon::RpcDataFebmap::id ( void  ) const [inline, virtual]

Implements popcon::PopConSourceHandler< RPCObFebmap >.

Definition at line 30 of file RPCFebmapSH.h.

References m_name.

{ return m_name;}

Member Data Documentation

Definition at line 34 of file RPCFebmapSH.h.

std::string popcon::RpcDataFebmap::host [private]

Definition at line 42 of file RPCFebmapSH.h.

std::string popcon::RpcDataFebmap::m_name [private]

Definition at line 41 of file RPCFebmapSH.h.

Referenced by id().

unsigned long long popcon::RpcDataFebmap::m_since [private]

Definition at line 45 of file RPCFebmapSH.h.

unsigned long long popcon::RpcDataFebmap::m_till [private]

Definition at line 46 of file RPCFebmapSH.h.

unsigned long long popcon::RpcDataFebmap::niov

Definition at line 38 of file RPCFebmapSH.h.

std::string popcon::RpcDataFebmap::passw [private]

Definition at line 44 of file RPCFebmapSH.h.

unsigned long long popcon::RpcDataFebmap::snc

Definition at line 36 of file RPCFebmapSH.h.

unsigned long long popcon::RpcDataFebmap::tll

Definition at line 37 of file RPCFebmapSH.h.

std::string popcon::RpcDataFebmap::user [private]

Definition at line 43 of file RPCFebmapSH.h.

unsigned long long popcon::RpcDataFebmap::utime

Definition at line 39 of file RPCFebmapSH.h.