CMS 3D CMS Logo

DTPerformanceHandler.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2008/02/15 18:14:45 $
5  * $Revision: 1.3 $
6  * \author Paolo Ronchese INFN Padova
7  *
8  */
9 
10 //-----------------------
11 // This Class' Header --
12 //-----------------------
14 
15 //-------------------------------
16 // Collaborating Class Headers --
17 //-------------------------------
19 
20 //---------------
21 // C++ Headers --
22 //---------------
23 #include <iostream>
24 #include <fstream>
25 
26 //-------------------
27 // Initializations --
28 //-------------------
29 
30 //----------------
31 // Constructors --
32 //----------------
34  : dataTag(ps.getParameter<std::string>("tag")),
35  fileName(ps.getParameter<std::string>("file")),
36  runNumber(ps.getParameter<unsigned int>("run")) {}
37 
38 //--------------
39 // Destructor --
40 //--------------
42 
43 //--------------
44 // Operations --
45 //--------------
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 }
136 
popcon::PopConSourceHandler< DTPerformance >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
DTPerformance.h
mps_update.status
status
Definition: mps_update.py:69
gather_cfg.cout
cout
Definition: gather_cfg.py:144
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
DTPerformanceHandler::DTPerformanceHandler
DTPerformanceHandler(const edm::ParameterSet &ps)
Definition: DTPerformanceHandler.cc:33
DTPerformanceHandler::dataTag
std::string dataTag
Definition: DTPerformanceHandler.h:51
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
dqmdumpme.last
last
Definition: dqmdumpme.py:56
compare_using_db.ifile
ifile
Definition: compare_using_db.py:251
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DTPerformanceHandler::~DTPerformanceHandler
~DTPerformanceHandler() override
Definition: DTPerformanceHandler.cc:41
DTPerformanceHandler::runNumber
unsigned int runNumber
Definition: DTPerformanceHandler.h:53
edm::ParameterSet
Definition: ParameterSet.h:47
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
createfilelist.int
int
Definition: createfilelist.py:10
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
DTPerformanceHandler::getNewObjects
void getNewObjects() override
Definition: DTPerformanceHandler.cc:46
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:87
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition: Types.h:73
std
Definition: JetResolutionObject.h:76
DTPerformanceHandler::id
std::string id() const override
Definition: DTPerformanceHandler.cc:137
DTTimeUnits::counts
Definition: DTTimeUnits.h:32
DTPerformance
Definition: DTPerformance.h:68
gctErrorAnalyzer_cfi.dataTag
dataTag
Definition: gctErrorAnalyzer_cfi.py:28
DTPerformanceHandler::fileName
std::string fileName
Definition: DTPerformanceHandler.h:52
DTPerformanceHandler.h
cond::TagInfo_t
Definition: Types.h:69