CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
std::string id () const
 
virtual ~DTPerformanceHandler ()
 
- 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 const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry 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< TripletContainer
 
typedef std::vector< std::pair
< DTPerformance
*, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< DTPerformance
self
 
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)
 
- 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 35 of file DTPerformanceHandler.h.

Constructor & Destructor Documentation

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

Constructor

Definition at line 34 of file DTPerformanceHandler.cc.

34  :
35  dataTag( ps.getParameter<std::string> ( "tag" ) ),
36  fileName( ps.getParameter<std::string> ( "file" ) ),
37  runNumber( ps.getParameter<unsigned int> ( "run" ) ) {
38 }
T getParameter(std::string const &) const
DTPerformanceHandler::~DTPerformanceHandler ( )
virtual

Destructor

Definition at line 43 of file DTPerformanceHandler.cc.

43  {
44 }

Member Function Documentation

void DTPerformanceHandler::getNewObjects ( )
virtual

Operations

Implements popcon::PopConSourceHandler< DTPerformance >.

Definition at line 49 of file DTPerformanceHandler.cc.

References DTTimeUnits::counts, gather_cfg::cout, dataTag, fileName, compare_using_db::ifile, prof2calltree::last, cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< DTPerformance >::m_to_transfer, runNumber, DTPerformance::set(), ntuplemaker::status, and popcon::PopConSourceHandler< DTPerformance >::tagInfo().

49  {
50 
51  //to access the information on the tag inside the offline database:
52  cond::TagInfo const & ti = tagInfo();
53  unsigned int last = ti.lastInterval.first;
54 
55  //to access the information on last successful log entry for this tag:
56 // cond::LogDBEntry const & lde = logDBEntry();
57 
58  //to access the lastest payload (Ref is a smart pointer)
59 // Ref payload = lastPayload();
60 
61 /*
62  int irun = event.id().run();
63  int ievt = event.id().event();
64  std::cout << "================ "
65  << irun << " " << ievt << std::endl;
66 
67 // edm::Service<cond::service::PoolDBOutputService> dbservice;
68 
69  std::map<std::string, popcon::PayloadIOV> mp = getOfflineInfo();
70  std::map<std::string, popcon::PayloadIOV>::iterator iter = mp.begin();
71  std::map<std::string, popcon::PayloadIOV>::iterator iend = mp.end();
72  std::cout << "list of all tags: " << std::endl;
73  while ( iter != iend ) {
74  std::cout << "Tag: " << iter->first
75  << " , last object valid since " << iter->second.last_since
76  << " to " << iter->second.last_till
77  << std::endl;
78  iter++;
79  }
80 
81  std::cout << "look for tag " << dataTag << std::endl;
82  std::map<std::string, popcon::PayloadIOV>::iterator itag =
83  mp.find( dataTag );
84 */
85 
86  DTPerformance* dtPerf = new DTPerformance( dataTag );
87 
88  int status = 0;
89  std::ifstream ifile( fileName.c_str() );
90  int whe;
91  int sta;
92  int sec;
93  int qua;
94  float meanT0;
95  float meanTtrig;
96  float meanMtime;
97  float meanNoise;
98  float meanAfterPulse;
99  float meanResolution;
100  float meanEfficiency;
101  while ( ifile >> whe
102  >> sta
103  >> sec
104  >> qua
105  >> meanT0
106  >> meanTtrig
107  >> meanMtime
108  >> meanNoise
109  >> meanAfterPulse
110  >> meanResolution
111  >> meanEfficiency ) {
112  status = dtPerf->set( whe, sta, sec, qua,
113  meanT0, meanTtrig, meanMtime, meanNoise,
114  meanAfterPulse, meanResolution, meanEfficiency,
116  std::cout << whe << " "
117  << sta << " "
118  << sec << " "
119  << qua << std::endl << " === "
120  << meanT0 << " "
121  << meanTtrig << " "
122  << meanMtime << " "
123  << meanNoise << " "
124  << meanAfterPulse << " "
125  << meanResolution << " "
126  << meanEfficiency << std::endl << " -> ";
127  std::cout << "insert status: " << status << std::endl;
128  }
129 
130 /*
131  unsigned int runf = irun;
132  unsigned int runl = 0xffffffff;
133  popcon::IOVPair iop = { runf, runl };
134  std::cout << "APPEND NEW OBJECT: "
135  << runf << " " << runl << " " << dtPerf << std::endl;
136  m_to_transfer->push_back( std::make_pair( dtPerf, iop ) );
137 */
138 
139  //for each payload provide IOV information (say in this case we use since)
140  cond::Time_t snc = runNumber;
141  if ( runNumber > last )
142  m_to_transfer.push_back( std::make_pair( dtPerf, snc ) );
143  else
144  std::cout << "More recent data already present - skipped" << std::endl;
145 
146  return;
147 
148 }
cond::ValidityInterval lastInterval
Definition: Types.h:70
unsigned long long Time_t
Definition: Time.h:16
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)
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245
std::string DTPerformanceHandler::id ( void  ) const
virtual

Implements popcon::PopConSourceHandler< DTPerformance >.

Definition at line 151 of file DTPerformanceHandler.cc.

References dataTag.

151  {
152  return dataTag;
153 }

Member Data Documentation

std::string DTPerformanceHandler::dataTag
private

Definition at line 55 of file DTPerformanceHandler.h.

Referenced by getNewObjects(), and id().

std::string DTPerformanceHandler::fileName
private

Definition at line 56 of file DTPerformanceHandler.h.

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

unsigned int DTPerformanceHandler::runNumber
private

Definition at line 57 of file DTPerformanceHandler.h.

Referenced by getNewObjects().