CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTDeadFlagHandler Class Reference

#include <DTDeadFlagHandler.h>

Inheritance diagram for DTDeadFlagHandler:
popcon::PopConSourceHandler< DTDeadFlag >

Public Member Functions

 DTDeadFlagHandler (const edm::ParameterSet &ps)
 
void getNewObjects () override
 
std::string id () const override
 
 ~DTDeadFlagHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< DTDeadFlag >
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const *, std::string const > operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< DTDeadFlag >
typedef std::map< Time_t, std::shared_ptr< DTDeadFlag > > Container
 
typedef std::unique_ptr< DTDeadFlagRef
 
typedef PopConSourceHandler< DTDeadFlagself
 
typedef cond::Time_t Time_t
 
typedef DTDeadFlag value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< DTDeadFlag >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< DTDeadFlag >
Container m_iovs
 
std::vector< std::pair< DTDeadFlag *, Time_t > > m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Description:

Date
2007/12/07 15:12:19
Revision
1.2
Author
Paolo Ronchese INFN Padova

Definition at line 34 of file DTDeadFlagHandler.h.

Constructor & Destructor Documentation

◆ DTDeadFlagHandler()

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

Constructor

Definition at line 33 of file DTDeadFlagHandler.cc.

34  : dataTag(ps.getParameter<std::string>("tag")),
35  fileName(ps.getParameter<std::string>("file")),
36  runNumber(ps.getParameter<unsigned int>("run")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
unsigned int runNumber

◆ ~DTDeadFlagHandler()

DTDeadFlagHandler::~DTDeadFlagHandler ( )
override

Destructor

Definition at line 41 of file DTDeadFlagHandler.cc.

41 {}

Member Function Documentation

◆ getNewObjects()

void DTDeadFlagHandler::getNewObjects ( )
overridevirtual

Operations

Implements popcon::PopConSourceHandler< DTDeadFlag >.

Definition at line 46 of file DTDeadFlagHandler.cc.

References gather_cfg::cout, dataTag, fileName, compare_using_db::ifile, dqmdumpme::last, cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< DTDeadFlag >::m_to_transfer, runNumber, fileinputsource_cfi::sec, cond::Iov_t::since, mps_update::status, popcon::PopConSourceHandler< DTDeadFlag >::tagInfo(), and cmsswSequenceInfo::tp.

46  {
47  //to access the information on the tag inside the offline database:
48  cond::TagInfo_t const& ti = tagInfo();
50 
51  //to access the information on last successful log entry for this tag:
52  // cond::LogDBEntry const & lde = logDBEntry();
53 
54  //to access the lastest payload (Ref is a smart pointer)
55  // Ref payload = lastPayload();
56 
57  /*
58  int irun = event.id().run();
59  int ievt = event.id().event();
60  std::cout << "================ "
61  << irun << " " << ievt << std::endl;
62 
63  std::map<std::string, popcon::PayloadIOV> mp = getOfflineInfo();
64  std::map<std::string, popcon::PayloadIOV>::iterator iter = mp.begin();
65  std::map<std::string, popcon::PayloadIOV>::iterator iend = mp.end();
66  std::cout << "list of all tags: " << std::endl;
67  while ( iter != iend ) {
68  std::cout << "Tag: " << iter->first
69  << " , last object valid since " << iter->second.last_since
70  << " to " << iter->second.last_till
71  << std::endl;
72  iter++;
73  }
74 
75  std::cout << "look for tag " << dataTag << std::endl;
76  std::map<std::string, popcon::PayloadIOV>::iterator itag =
77  mp.find( dataTag );
78 */
79 
80  auto dFlag = std::make_unique<DTDeadFlag>(dataTag);
81 
82  int status = 0;
83  std::ifstream ifile(fileName.c_str());
84  int whe;
85  int sta;
86  int sec;
87  int qua;
88  int lay;
89  int cel;
90  int hv;
91  int tp;
92  int ro;
93  int dc;
94  while (ifile >> whe >> sta >> sec >> qua >> lay >> cel >> hv >> tp >> ro >> dc) {
95  status = dFlag->set(whe, sta, sec, qua, lay, cel, hv != 0, tp != 0, ro != 0, dc != 0);
96  std::cout << whe << " " << sta << " " << sec << " " << qua << " " << lay << " " << cel << " " << hv << " " << tp
97  << " " << ro << " " << dc << " -> ";
98  std::cout << "insert status: " << status << std::endl;
99  }
100 
101  /*
102  unsigned int runf = irun;
103  unsigned int runl = 0xffffffff;
104  popcon::IOVPair iop = { runf, runl };
105  std::cout << "APPEND NEW OBJECT: "
106  << runf << " " << runl << " " << dFlag << std::endl;
107  m_to_transfer->push_back( std::make_pair( dFlag, iop ) );
108 */
109 
110  //for each payload provide IOV information (say in this case we use since)
111  cond::Time_t snc = runNumber;
112  if (runNumber > last)
113  m_to_transfer.push_back(std::make_pair(dFlag.release(), snc));
114  else
115  std::cout << "More recent data already present - skipped" << std::endl;
116 
117  return;
118 }
Iov_t lastInterval
Definition: Types.h:73
Time_t since
Definition: Types.h:53
cond::TagInfo_t const & tagInfo() const
unsigned long long Time_t
Definition: Time.h:14
std::vector< std::pair< DTDeadFlag *, Time_t > > m_to_transfer
unsigned int runNumber

◆ id()

std::string DTDeadFlagHandler::id ( ) const
overridevirtual

Implements popcon::PopConSourceHandler< DTDeadFlag >.

Definition at line 120 of file DTDeadFlagHandler.cc.

References dataTag.

120 { return dataTag; }

Member Data Documentation

◆ dataTag

std::string DTDeadFlagHandler::dataTag
private

Definition at line 51 of file DTDeadFlagHandler.h.

Referenced by getNewObjects(), and id().

◆ fileName

std::string DTDeadFlagHandler::fileName
private

Definition at line 52 of file DTDeadFlagHandler.h.

Referenced by getNewObjects(), and readConfig.fileINI::read().

◆ runNumber

unsigned int DTDeadFlagHandler::runNumber
private