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 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< DTPerformance >
typedef std::map< Time_t, std::shared_ptr< DTPerformance > > Container
 
typedef std::unique_ptr< DTPerformanceRef
 
typedef PopConSourceHandler< DTPerformanceself
 
typedef cond::Time_t Time_t
 
typedef DTPerformance value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< DTPerformance >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< DTPerformance >
Container m_iovs
 
std::vector< std::pair< DTPerformance *, Time_t > > 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")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~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.

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().

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 }
Iov_t lastInterval
Definition: Types.h:73
Time_t since
Definition: Types.h:53
unsigned long long Time_t
Definition: Time.h:14
std::vector< std::pair< DTPerformance *, Time_t > > m_to_transfer
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)

◆ id()

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

Implements popcon::PopConSourceHandler< DTPerformance >.

Definition at line 137 of file DTPerformanceHandler.cc.

References dataTag.

137 { return 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