CMS 3D CMS Logo

DTT0Handler.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:49 $
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  std::cout << "last: " << last << std::endl;
51 
52  //to access the information on last successful log entry for this tag:
53  // cond::LogDBEntry const & lde = logDBEntry();
54 
55  //to access the lastest payload (Ref is a smart pointer)
56  // Ref payload = lastPayload();
57 
58  /*
59  int irun = event.id().run();
60  int ievt = event.id().event();
61  std::cout << "================ "
62  << irun << " " << ievt << std::endl;
63 
64  std::map<std::string, popcon::PayloadIOV> mp = getOfflineInfo();
65  std::map<std::string, popcon::PayloadIOV>::iterator iter = mp.begin();
66  std::map<std::string, popcon::PayloadIOV>::iterator iend = mp.end();
67  std::cout << "list of all tags: " << std::endl;
68  while ( iter != iend ) {
69  std::cout << "Tag: " << iter->first
70  << " , last object valid since " << iter->second.last_since
71  << " to " << iter->second.last_till
72  << std::endl;
73  iter++;
74  }
75 
76  std::cout << "look for tag " << dataTag << std::endl;
77  std::map<std::string, popcon::PayloadIOV>::iterator itag =
78  mp.find( dataTag );
79 */
80 
81  DTT0* t0 = new DTT0(dataTag);
82 
83  int status = 0;
84  std::ifstream ifile(fileName.c_str());
85  int whe;
86  int sta;
87  int sec;
88  int qua;
89  int lay;
90  int cel;
91  float t0mean;
92  float t0rms;
93  while (ifile >> whe >> sta >> sec >> qua >> lay >> cel >> t0mean >> t0rms) {
94  status = t0->set(whe, sta, sec, qua, lay, cel, t0mean, t0rms, DTTimeUnits::counts);
95  std::cout << whe << " " << sta << " " << sec << " " << qua << " " << lay << " " << cel << " " << t0mean << " "
96  << t0rms << " -> ";
97  std::cout << "insert status: " << status << std::endl;
98  }
99 
100  /*
101  unsigned int runf = irun;
102  unsigned int runl = 0xffffffff;
103  popcon::IOVPair iop = { runf, runl };
104  std::cout << "APPEND NEW OBJECT: "
105  << runf << " " << runl << " " << t0 << std::endl;
106  m_to_transfer->push_back( std::make_pair( t0, iop ) );
107 */
108 
109  //for each payload provide IOV information (say in this case we use since)
110  cond::Time_t snc = runNumber;
111  if (runNumber > last)
112  m_to_transfer.push_back(std::make_pair(t0, snc));
113  else {
114  std::cout << "More recent data already present - skipped" << std::endl;
115  delete t0;
116  }
117 
118  return;
119 }
120 
popcon::PopConSourceHandler< DTT0 >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
DTT0Handler::DTT0Handler
DTT0Handler(const edm::ParameterSet &ps)
Definition: DTT0Handler.cc:33
mps_update.status
status
Definition: mps_update.py:68
DTT0.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTT0Handler.h
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
DTT0Handler::getNewObjects
void getNewObjects() override
Definition: DTT0Handler.cc:46
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
dqmdumpme.last
last
Definition: dqmdumpme.py:56
FrontierCondition_GT_autoExpress_cfi.t0
t0
Definition: FrontierCondition_GT_autoExpress_cfi.py:149
compare_using_db.ifile
ifile
Definition: compare_using_db.py:251
edm::ParameterSet
Definition: ParameterSet.h:47
popcon::PopConSourceHandler< DTT0 >::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
DTT0Handler::~DTT0Handler
~DTT0Handler() override
Definition: DTT0Handler.cc:41
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
DTT0Handler::fileName
std::string fileName
Definition: DTT0Handler.h:52
std
Definition: JetResolutionObject.h:76
DTTimeUnits::counts
Definition: DTTimeUnits.h:32
DTT0Handler::id
std::string id() const override
Definition: DTT0Handler.cc:121
DTT0
Definition: DTT0.h:48
gctErrorAnalyzer_cfi.dataTag
dataTag
Definition: gctErrorAnalyzer_cfi.py:28
DTT0Handler::runNumber
unsigned int runNumber
Definition: DTT0Handler.h:53
cond::TagInfo_t
Definition: Types.h:69
DTT0Handler::dataTag
std::string dataTag
Definition: DTT0Handler.h:51