CMS 3D CMS Logo

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

#include <DTPerformanceHandler.h>

Inheritance diagram for DTPerformanceHandler:
popcon::PopConSourceHandler< DTPerformance >

Public Member Functions

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

Detailed Description

Description:

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

Definition at line 34 of file DTPerformanceHandler.h.

Constructor & Destructor Documentation

◆ DTPerformanceHandler()

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

Constructor

Definition at line 33 of file DTPerformanceHandler.cc.

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

◆ ~DTPerformanceHandler()

DTPerformanceHandler::~DTPerformanceHandler ( )
override

Destructor

Definition at line 41 of file DTPerformanceHandler.cc.

41 {}

Member Function Documentation

◆ getNewObjects()

void DTPerformanceHandler::getNewObjects ( )
overridevirtual

Operations

Implements popcon::PopConSourceHandler< DTPerformance >.

Definition at line 46 of file DTPerformanceHandler.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 // edm::Service<cond::service::PoolDBOutputService> dbservice;
64 
65  std::map<std::string, popcon::PayloadIOV> mp = getOfflineInfo();
66  std::map<std::string, popcon::PayloadIOV>::iterator iter = mp.begin();
67  std::map<std::string, popcon::PayloadIOV>::iterator iend = mp.end();
68  std::cout << "list of all tags: " << std::endl;
69  while ( iter != iend ) {
70  std::cout << "Tag: " << iter->first
71  << " , last object valid since " << iter->second.last_since
72  << " to " << iter->second.last_till
73  << std::endl;
74  iter++;
75  }
76 
77  std::cout << "look for tag " << dataTag << std::endl;
78  std::map<std::string, popcon::PayloadIOV>::iterator itag =
79  mp.find( dataTag );
80 */
81 
82  DTPerformance* dtPerf = new DTPerformance(dataTag);
83 
84  int status = 0;
85  std::ifstream ifile(fileName.c_str());
86  int whe;
87  int sta;
88  int sec;
89  int qua;
90  float meanT0;
91  float meanTtrig;
92  float meanMtime;
93  float meanNoise;
94  float meanAfterPulse;
95  float meanResolution;
96  float meanEfficiency;
97  while (ifile >> whe >> sta >> sec >> qua >> meanT0 >> meanTtrig >> meanMtime >> meanNoise >> meanAfterPulse >>
98  meanResolution >> meanEfficiency) {
99  status = dtPerf->set(whe,
100  sta,
101  sec,
102  qua,
103  meanT0,
104  meanTtrig,
105  meanMtime,
106  meanNoise,
107  meanAfterPulse,
108  meanResolution,
109  meanEfficiency,
111  std::cout << whe << " " << sta << " " << sec << " " << qua << std::endl
112  << " === " << meanT0 << " " << meanTtrig << " " << meanMtime << " " << meanNoise << " " << meanAfterPulse
113  << " " << meanResolution << " " << meanEfficiency << std::endl
114  << " -> ";
115  std::cout << "insert status: " << status << std::endl;
116  }
117 
118  /*
119  unsigned int runf = irun;
120  unsigned int runl = 0xffffffff;
121  popcon::IOVPair iop = { runf, runl };
122  std::cout << "APPEND NEW OBJECT: "
123  << runf << " " << runl << " " << dtPerf << std::endl;
124  m_to_transfer->push_back( std::make_pair( dtPerf, iop ) );
125 */
126 
127  //for each payload provide IOV information (say in this case we use since)
128  cond::Time_t snc = runNumber;
129  if (runNumber > last)
130  m_to_transfer.push_back(std::make_pair(dtPerf, snc));
131  else
132  std::cout << "More recent data already present - skipped" << std::endl;
133 
134  return;
135 }

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

◆ id()

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

Implements popcon::PopConSourceHandler< DTPerformance >.

Definition at line 137 of file DTPerformanceHandler.cc.

137 { return dataTag; }

References dataTag.

Member Data Documentation

◆ dataTag

std::string DTPerformanceHandler::dataTag
private

Definition at line 51 of file DTPerformanceHandler.h.

Referenced by getNewObjects(), and id().

◆ fileName

std::string DTPerformanceHandler::fileName
private

Definition at line 52 of file DTPerformanceHandler.h.

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

◆ runNumber

unsigned int DTPerformanceHandler::runNumber
private
popcon::PopConSourceHandler< DTPerformance >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
mps_update.status
status
Definition: mps_update.py:68
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTPerformanceHandler::dataTag
std::string dataTag
Definition: DTPerformanceHandler.h:51
dqmdumpme.last
last
Definition: dqmdumpme.py:56
compare_using_db.ifile
ifile
Definition: compare_using_db.py:251
DTPerformanceHandler::runNumber
unsigned int runNumber
Definition: DTPerformanceHandler.h:53
popcon::PopConSourceHandler< DTPerformance >::tagInfo
cond::TagInfo_t const & tagInfo() const
Definition: PopConSourceHandler.h:78
cond::Iov_t::since
Time_t since
Definition: Types.h:53
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
DTPerformance::set
int set(int wheelId, int stationId, int sectorId, int slId, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit)
Definition: DTPerformance.cc:141
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:94
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition: Types.h:73
DTTimeUnits::counts
Definition: DTTimeUnits.h:32
DTPerformance
Definition: DTPerformance.h:68
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DTPerformanceHandler::fileName
std::string fileName
Definition: DTPerformanceHandler.h:52
cond::TagInfo_t
Definition: Types.h:69