CMS 3D CMS Logo

DTPerformanceHandler Class Reference

Description:. More...

#include <CondTools/DT/interface/DTPerformanceHandler.h>

Inheritance diagram for DTPerformanceHandler:

popcon::PopConSourceHandler< DTPerformance >

List of all members.

Public Member Functions

 DTPerformanceHandler (const edm::ParameterSet &ps)
 Constructor.
void getNewObjects ()
 Operations.
std::string id () const
virtual ~DTPerformanceHandler ()
 Destructor.

Private Attributes

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


Detailed Description

Description:.

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

Definition at line 35 of file DTPerformanceHandler.h.


Constructor & Destructor Documentation

DTPerformanceHandler::DTPerformanceHandler ( const edm::ParameterSet ps  ) 

Constructor.

Definition at line 34 of file DTPerformanceHandler.cc.

00034                                                                      :
00035  dataTag(   ps.getParameter<std::string>  (  "tag" ) ),
00036  fileName(  ps.getParameter<std::string>  ( "file" ) ),
00037  runNumber( ps.getParameter<unsigned int> (  "run" ) ) {
00038 }

DTPerformanceHandler::~DTPerformanceHandler (  )  [virtual]

Destructor.

Definition at line 43 of file DTPerformanceHandler.cc.

00043                                             {
00044 }


Member Function Documentation

void DTPerformanceHandler::getNewObjects (  )  [virtual]

Operations.

Implements popcon::PopConSourceHandler< DTPerformance >.

Definition at line 49 of file DTPerformanceHandler.cc.

References GenMuonPlsPt100GeV_cfg::cout, dataTag, lat::endl(), fileName, indexGen::ifile, prof2calltree::last, cond::TagInfo::lastInterval, popcon::PopConSourceHandler< DTPerformance >::m_to_transfer, runNumber, DTPerformance::set(), StDecayID::status, popcon::PopConSourceHandler< DTPerformance >::tagInfo(), and ti.

00049                                          {
00050 
00051   //to access the information on the tag inside the offline database:
00052   cond::TagInfo const & ti = tagInfo();
00053   unsigned int last = ti.lastInterval.first;
00054 
00055   //to access the information on last successful log entry for this tag:
00056 //  cond::LogDBEntry const & lde = logDBEntry();     
00057 
00058   //to access the lastest payload (Ref is a smart pointer)
00059 //  Ref payload = lastPayload();
00060 
00061 /*
00062   int irun = event.id().run();
00063   int ievt = event.id().event();
00064   std::cout << "================ "
00065             << irun << " " << ievt << std::endl;
00066 
00067 //  edm::Service<cond::service::PoolDBOutputService> dbservice;
00068 
00069   std::map<std::string, popcon::PayloadIOV> mp = getOfflineInfo();
00070   std::map<std::string, popcon::PayloadIOV>::iterator iter = mp.begin();
00071   std::map<std::string, popcon::PayloadIOV>::iterator iend = mp.end();
00072   std::cout << "list of all tags: " << std::endl;
00073   while ( iter != iend ) {
00074     std::cout << "Tag: "                       << iter->first
00075               << " , last object valid since " << iter->second.last_since
00076               << " to "                        << iter->second.last_till
00077               << std::endl;
00078     iter++;
00079   }
00080 
00081   std::cout << "look for tag " << dataTag << std::endl;
00082   std::map<std::string, popcon::PayloadIOV>::iterator itag =
00083     mp.find( dataTag );
00084 */
00085 
00086   DTPerformance* dtPerf = new DTPerformance( dataTag );
00087 
00088   int status = 0;
00089   std::ifstream ifile( fileName.c_str() );
00090   int whe;
00091   int sta;
00092   int sec;
00093   int qua;
00094   float meanT0;
00095   float meanTtrig;
00096   float meanMtime;
00097   float meanNoise;
00098   float meanAfterPulse;
00099   float meanResolution;
00100   float meanEfficiency;
00101   while ( ifile >> whe
00102                 >> sta
00103                 >> sec
00104                 >> qua
00105                 >> meanT0
00106                 >> meanTtrig
00107                 >> meanMtime
00108                 >> meanNoise
00109                 >> meanAfterPulse
00110                 >> meanResolution
00111                 >> meanEfficiency ) {
00112     status = dtPerf->set( whe, sta, sec, qua,
00113                           meanT0, meanTtrig, meanMtime, meanNoise,
00114                           meanAfterPulse, meanResolution, meanEfficiency );
00115     std::cout << whe << " "
00116               << sta << " "
00117               << sec << " "
00118               << qua << std::endl << " === "
00119               << meanT0 << " "
00120               << meanTtrig << " "
00121               << meanMtime << " "
00122               << meanNoise << " "
00123               << meanAfterPulse << " "
00124               << meanResolution << " "
00125               << meanEfficiency << std::endl << "  -> ";                
00126     std::cout << "insert status: " << status << std::endl;
00127   }
00128 
00129 /*
00130   unsigned int runf = irun;
00131   unsigned int runl = 0xffffffff;
00132   popcon::IOVPair iop = { runf, runl };
00133   std::cout << "APPEND NEW OBJECT: "
00134             << runf << " " << runl << " " << dtPerf << std::endl;
00135   m_to_transfer->push_back( std::make_pair( dtPerf, iop ) );
00136 */
00137 
00138   //for each payload provide IOV information (say in this case we use since)
00139   cond::Time_t snc = runNumber;
00140   if ( runNumber > last )
00141        m_to_transfer.push_back( std::make_pair( dtPerf, snc ) );
00142   else
00143        std::cout << "More recent data already present - skipped" << std::endl;
00144 
00145   return;
00146 
00147 }

std::string DTPerformanceHandler::id ( void   )  const [virtual]

Implements popcon::PopConSourceHandler< DTPerformance >.

Definition at line 150 of file DTPerformanceHandler.cc.

References dataTag.

00150                                          {
00151   return dataTag;
00152 }


Member Data Documentation

std::string DTPerformanceHandler::dataTag [private]

Definition at line 55 of file DTPerformanceHandler.h.

Referenced by getNewObjects(), and id().

std::string DTPerformanceHandler::fileName [private]

Definition at line 56 of file DTPerformanceHandler.h.

Referenced by getNewObjects().

unsigned int DTPerformanceHandler::runNumber [private]

Definition at line 57 of file DTPerformanceHandler.h.

Referenced by getNewObjects().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:58 2009 for CMSSW by  doxygen 1.5.4