CMS 3D CMS Logo

DTDeadFlagHandler Class Reference

Description:. More...

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

Inheritance diagram for DTDeadFlagHandler:

popcon::PopConSourceHandler< DTDeadFlag >

List of all members.

Public Member Functions

 DTDeadFlagHandler (const edm::ParameterSet &ps)
 Constructor.
void getNewObjects ()
 Operations.
std::string id () const
virtual ~DTDeadFlagHandler ()
 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 DTDeadFlagHandler.h.


Constructor & Destructor Documentation

DTDeadFlagHandler::DTDeadFlagHandler ( const edm::ParameterSet ps  ) 

Constructor.

Definition at line 34 of file DTDeadFlagHandler.cc.

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

DTDeadFlagHandler::~DTDeadFlagHandler (  )  [virtual]

Destructor.

Definition at line 43 of file DTDeadFlagHandler.cc.

00043                                       {
00044 }


Member Function Documentation

void DTDeadFlagHandler::getNewObjects (  )  [virtual]

Operations.

Implements popcon::PopConSourceHandler< DTDeadFlag >.

Definition at line 49 of file DTDeadFlagHandler.cc.

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

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   std::map<std::string, popcon::PayloadIOV> mp = getOfflineInfo();
00068   std::map<std::string, popcon::PayloadIOV>::iterator iter = mp.begin();
00069   std::map<std::string, popcon::PayloadIOV>::iterator iend = mp.end();
00070   std::cout << "list of all tags: " << std::endl;
00071   while ( iter != iend ) {
00072     std::cout << "Tag: "                       << iter->first
00073               << " , last object valid since " << iter->second.last_since
00074               << " to "                        << iter->second.last_till
00075               << std::endl;
00076     iter++;
00077   }
00078 
00079   std::cout << "look for tag " << dataTag << std::endl;
00080   std::map<std::string, popcon::PayloadIOV>::iterator itag =
00081     mp.find( dataTag );
00082 */
00083 
00084   DTDeadFlag* dFlag = new DTDeadFlag( dataTag );
00085 
00086   int status = 0;
00087   std::ifstream ifile( fileName.c_str() );
00088   int whe;
00089   int sta;
00090   int sec;
00091   int qua;
00092   int lay;
00093   int cel;
00094   int hv;
00095   int tp;
00096   int ro;
00097   int dc;
00098   while ( ifile >> whe
00099                 >> sta
00100                 >> sec
00101                 >> qua
00102                 >> lay
00103                 >> cel
00104                 >> hv
00105                 >> tp
00106                 >> ro
00107                 >> dc ) {
00108     status = dFlag->setCellStatus( whe, sta, sec, qua, lay, cel,
00109                                    hv != 0, tp != 0, ro != 0, dc != 0 );
00110     std::cout << whe << " "
00111               << sta << " "
00112               << sec << " "
00113               << qua << " "
00114               << lay << " "
00115               << cel << " "
00116               << hv << " "
00117               << tp << " "
00118               << ro << " "
00119               << dc << "  -> ";                
00120     std::cout << "insert status: " << status << std::endl;
00121   }
00122 
00123 /*
00124   unsigned int runf = irun;
00125   unsigned int runl = 0xffffffff;
00126   popcon::IOVPair iop = { runf, runl };
00127   std::cout << "APPEND NEW OBJECT: "
00128             << runf << " " << runl << " " << dFlag << std::endl;
00129   m_to_transfer->push_back( std::make_pair( dFlag, iop ) );
00130 */
00131 
00132   //for each payload provide IOV information (say in this case we use since)
00133   cond::Time_t snc = runNumber;
00134   if ( runNumber > last )
00135        m_to_transfer.push_back( std::make_pair( dFlag, snc ) );
00136   else
00137        std::cout << "More recent data already present - skipped" << std::endl;
00138 
00139   return;
00140 
00141 }

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

Implements popcon::PopConSourceHandler< DTDeadFlag >.

Definition at line 144 of file DTDeadFlagHandler.cc.

References dataTag.

00144                                       {
00145   return dataTag;
00146 }


Member Data Documentation

std::string DTDeadFlagHandler::dataTag [private]

Definition at line 55 of file DTDeadFlagHandler.h.

Referenced by getNewObjects(), and id().

std::string DTDeadFlagHandler::fileName [private]

Definition at line 56 of file DTDeadFlagHandler.h.

Referenced by getNewObjects().

unsigned int DTDeadFlagHandler::runNumber [private]

Definition at line 57 of file DTDeadFlagHandler.h.

Referenced by getNewObjects().


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