CMS 3D CMS Logo

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

#include <DTTPGParametersHandler.h>

Inheritance diagram for DTTPGParametersHandler:
popcon::PopConSourceHandler< DTTPGParameters >

Public Member Functions

 DTTPGParametersHandler (const edm::ParameterSet &ps)
 
void getNewObjects () override
 
std::string id () const override
 
 ~DTTPGParametersHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< DTTPGParameters >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
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 ()
 
void sort ()
 
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< DTTPGParameters >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< DTTPGParameters *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< DTTPGParametersself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef DTTPGParameters value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< DTTPGParameters >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< DTTPGParameters >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Description:

Date
2009/01/27 12:07:41
Revision
1.1.2.1
Author
Paolo Ronchese INFN Padova

Definition at line 34 of file DTTPGParametersHandler.h.

Constructor & Destructor Documentation

◆ DTTPGParametersHandler()

DTTPGParametersHandler::DTTPGParametersHandler ( const edm::ParameterSet ps)

Constructor

Definition at line 33 of file DTTPGParametersHandler.cc.

34  : dataTag(ps.getParameter<std::string>("tag")),
35  fileName(ps.getParameter<std::string>("file")),
36  runNumber(ps.getParameter<unsigned int>("run")) {}

◆ ~DTTPGParametersHandler()

DTTPGParametersHandler::~DTTPGParametersHandler ( )
override

Destructor

Definition at line 41 of file DTTPGParametersHandler.cc.

41 {}

Member Function Documentation

◆ getNewObjects()

void DTTPGParametersHandler::getNewObjects ( )
overridevirtual

Operations

Implements popcon::PopConSourceHandler< DTTPGParameters >.

Definition at line 46 of file DTTPGParametersHandler.cc.

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 
81 
82  int status = 0;
83  std::ifstream ifile(fileName.c_str());
84  // int cx = 32;
85  // ifile >> cx;
86  // tSync->setClock( cx );
87  int whe;
88  int sta;
89  int sec;
90  int cl;
91  float ph;
92  while (ifile >> whe >> sta >> sec >> cl >> ph) {
93  status = tSync->set(whe, sta, sec, cl, ph, DTTimeUnits::ns);
94  std::cout << whe << " " << sta << " " << sec << " " << cl << " " << ph << " -> ";
95  std::cout << "insert status: " << status << std::endl;
96  }
97 
98  /*
99  unsigned int runf = irun;
100  unsigned int runl = 0xffffffff;
101  popcon::IOVPair iop = { runf, runl };
102  std::cout << "APPEND NEW OBJECT: "
103  << runf << " " << runl << " " << tSync << std::endl;
104  m_to_transfer->push_back( std::make_pair( tSync, iop ) );
105 */
106 
107  //for each payload provide IOV information (say in this case we use since)
108  cond::Time_t snc = runNumber;
109  if (runNumber > last)
110  m_to_transfer.push_back(std::make_pair(tSync, snc));
111  else {
112  std::cout << "More recent data already present - skipped" << std::endl;
113  delete tSync;
114  }
115 
116  return;
117 }

References GetRecoTauVFromDQM_MC_cff::cl, gather_cfg::cout, dataTag, L1DTConfigParams_cff::DTTPGParameters, fileName, compare_using_db::ifile, dqmdumpme::last, cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< DTTPGParameters >::m_to_transfer, DTTimeUnits::ns, runNumber, fileinputsource_cfi::sec, DTTPGParameters::set(), cond::Iov_t::since, mps_update::status, and popcon::PopConSourceHandler< DTTPGParameters >::tagInfo().

◆ id()

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

Implements popcon::PopConSourceHandler< DTTPGParameters >.

Definition at line 119 of file DTTPGParametersHandler.cc.

119 { return dataTag; }

References dataTag.

Member Data Documentation

◆ dataTag

std::string DTTPGParametersHandler::dataTag
private

Definition at line 51 of file DTTPGParametersHandler.h.

Referenced by getNewObjects(), and id().

◆ fileName

std::string DTTPGParametersHandler::fileName
private

Definition at line 52 of file DTTPGParametersHandler.h.

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

◆ runNumber

unsigned int DTTPGParametersHandler::runNumber
private
DTTPGParameters::set
int set(int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit)
Definition: DTTPGParameters.cc:123
popcon::PopConSourceHandler< DTTPGParameters >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
mps_update.status
status
Definition: mps_update.py:69
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTTPGParametersHandler::dataTag
std::string dataTag
Definition: DTTPGParametersHandler.h:51
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition: GetRecoTauVFromDQM_MC_cff.py:38
dqmdumpme.last
last
Definition: dqmdumpme.py:56
compare_using_db.ifile
ifile
Definition: compare_using_db.py:251
DTTimeUnits::ns
Definition: DTTimeUnits.h:32
DTTPGParametersHandler::runNumber
unsigned int runNumber
Definition: DTTPGParametersHandler.h:53
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
popcon::PopConSourceHandler< DTTPGParameters >::tagInfo
cond::TagInfo_t const & tagInfo() const
Definition: PopConSourceHandler.h:78
DTTPGParameters
Definition: DTTPGParameters.h:62
cond::Iov_t::since
Time_t since
Definition: Types.h:53
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:87
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition: Types.h:73
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
L1DTConfigParams_cff.DTTPGParameters
DTTPGParameters
Definition: L1DTConfigParams_cff.py:12
DTTPGParametersHandler::fileName
std::string fileName
Definition: DTTPGParametersHandler.h:52
cond::TagInfo_t
Definition: Types.h:69