CMS 3D CMS Logo

Public Member Functions | Private Attributes

DTRangeT0Handler Class Reference

#include <DTRangeT0Handler.h>

Inheritance diagram for DTRangeT0Handler:
popcon::PopConSourceHandler< DTRangeT0 >

List of all members.

Public Member Functions

 DTRangeT0Handler (const edm::ParameterSet &ps)
void getNewObjects ()
std::string id () const
virtual ~DTRangeT0Handler ()

Private Attributes

std::string dataTag
std::string fileName
unsigned int runNumber

Detailed Description

Description:

Date:
2008/02/15 18:15:03
Revision:
1.3
Author:
Paolo Ronchese INFN Padova

Definition at line 35 of file DTRangeT0Handler.h.


Constructor & Destructor Documentation

DTRangeT0Handler::DTRangeT0Handler ( const edm::ParameterSet ps)

Constructor

Definition at line 34 of file DTRangeT0Handler.cc.

                                                             :
 dataTag(   ps.getParameter<std::string>  (  "tag" ) ),
 fileName(  ps.getParameter<std::string>  ( "file" ) ),
 runNumber( ps.getParameter<unsigned int> (  "run" ) ) {
}
DTRangeT0Handler::~DTRangeT0Handler ( ) [virtual]

Destructor

Definition at line 43 of file DTRangeT0Handler.cc.

                                    {
}

Member Function Documentation

void DTRangeT0Handler::getNewObjects ( ) [virtual]

Operations

Implements popcon::PopConSourceHandler< DTRangeT0 >.

Definition at line 49 of file DTRangeT0Handler.cc.

References gather_cfg::cout, dataTag, fileName, compare_using_db::ifile, prof2calltree::last, cond::TagInfo::lastInterval, popcon::PopConSourceHandler< DTRangeT0 >::m_to_transfer, runNumber, DTRangeT0::set(), ntuplemaker::status, and popcon::PopConSourceHandler< DTRangeT0 >::tagInfo().

                                     {

  //to access the information on the tag inside the offline database:
  cond::TagInfo const & ti = tagInfo();
  unsigned int last = ti.lastInterval.first;

  //to access the information on last successful log entry for this tag:
//  cond::LogDBEntry const & lde = logDBEntry();     

  //to access the lastest payload (Ref is a smart pointer)
//  Ref payload = lastPayload();

/*
  int irun = event.id().run();
  int ievt = event.id().event();
  std::cout << "================ "
            << irun << " " << ievt << std::endl;

  std::map<std::string, popcon::PayloadIOV> mp = getOfflineInfo();
  std::map<std::string, popcon::PayloadIOV>::iterator iter = mp.begin();
  std::map<std::string, popcon::PayloadIOV>::iterator iend = mp.end();
  std::cout << "list of all tags: " << std::endl;
  while ( iter != iend ) {
    std::cout << "Tag: "                       << iter->first
              << " , last object valid since " << iter->second.last_since
              << " to "                        << iter->second.last_till
              << std::endl;
    iter++;
  }

  std::cout << "look for tag " << dataTag << std::endl;
  std::map<std::string, popcon::PayloadIOV>::iterator itag =
    mp.find( dataTag );
*/

  DTRangeT0* t0Range = new DTRangeT0( dataTag );

  int status = 0;
  std::ifstream ifile( fileName.c_str() );
  int whe;
  int sta;
  int sec;
  int qua;
  int t0min;
  int t0max;
  while ( ifile >> whe
                >> sta
                >> sec
                >> qua
                >> t0min
                >> t0max ) {
    status = t0Range->set( whe, sta, sec, qua, t0min, t0max );
    std::cout << whe << " "
              << sta << " "
              << sec << " "
              << qua << " "
              << t0min << " "
              << t0max << "  -> ";                
    std::cout << "insert status: " << status << std::endl;
  }

/*
  unsigned int runf = irun;
  unsigned int runl = 0xffffffff;
  popcon::IOVPair iop = { runf, runl };
  std::cout << "APPEND NEW OBJECT: "
            << runf << " " << runl << " " << t0Range << std::endl;
  m_to_transfer->push_back( std::make_pair( t0Range, iop ) );
*/

  //for each payload provide IOV information (say in this case we use since)
  cond::Time_t snc = runNumber;
  if ( runNumber > last )
       m_to_transfer.push_back( std::make_pair( t0Range, snc ) );
  else
       std::cout << "More recent data already present - skipped" << std::endl;

  return;

}
std::string DTRangeT0Handler::id ( void  ) const [virtual]

Implements popcon::PopConSourceHandler< DTRangeT0 >.

Definition at line 131 of file DTRangeT0Handler.cc.

References dataTag.

                                     {
  return dataTag;
}

Member Data Documentation

std::string DTRangeT0Handler::dataTag [private]

Definition at line 55 of file DTRangeT0Handler.h.

Referenced by getNewObjects(), and id().

std::string DTRangeT0Handler::fileName [private]

Definition at line 56 of file DTRangeT0Handler.h.

Referenced by getNewObjects().

unsigned int DTRangeT0Handler::runNumber [private]

Definition at line 57 of file DTRangeT0Handler.h.

Referenced by getNewObjects().