CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMReferenceHistogramRootFileSourceHandler.cc
Go to the documentation of this file.
5 #include <iostream>
6 #include <sstream>
7 #include <vector>
8 
9 namespace popcon {
11  m_name(pset.getUntrackedParameter<std::string>("name","DQMReferenceHistogramRootFileSourceHandler")),
12  m_file(pset.getUntrackedParameter<std::string>("ROOTFile","./file.root")),
13  m_zip(pset.getUntrackedParameter<bool>("zip",false)),
14  m_since(pset.getUntrackedParameter<unsigned long long>("firstSince",1)),
15  m_debugMode(pset.getUntrackedParameter<bool>("debug",false)) {
16  }
17 
19 
21  edm::LogInfo("DQMReferenceHistogramRootFileSourceHandler") << "[DQMReferenceHistogramRootFileSourceHandler::getNewObjects] for PopCon application " << m_name;
22  if(m_debugMode){
23  std::stringstream ss;
24  ss << "\n------- " << m_name
25  << " - > getNewObjects\n";
26  if (this->tagInfo().size > 0){
27  //check what is already inside of the database
28  ss << "\ngot offlineInfo "<< this->tagInfo().name
29  << ",\n size " << this->tagInfo().size
30  << ",\n" << this->tagInfo().token
31  << ",\n last object valid since " << this->tagInfo().lastInterval.first
32  << ",\n token " << this->tagInfo().lastPayloadToken
33  << ",\n UserText " << this->userTextLog()
34  << ";\n last entry info regarding the payload (if existing):"
35  << ",\n logId"<<this->logDBEntry().logId
36  << ",\n last record with the correct tag (if existing) has been written in the db " << this->logDBEntry().destinationDB
37  << ",\n provenance " << this->logDBEntry().provenance
38  << ",\n usertext " << this->logDBEntry().usertext
39  << ",\n iovtag " << this->logDBEntry().iovtag
40  << ",\n timetype " << this->logDBEntry().iovtimetype
41  << ",\n payload index " << this->logDBEntry().payloadIdx
42  << ",\n payload class " << this->logDBEntry().payloadClass
43  << ",\n payload token " << this->logDBEntry().payloadToken
44  << ",\n execution time " << this->logDBEntry().exectime
45  << ",\n execution message " << this->logDBEntry().execmessage
46  << std::endl;
47  Ref payload = this->lastPayload();
48  ss << "size of last payload " << payload->size() << std::endl;
49  } else {
50  ss << " First object for this tag " << std::endl;
51  }
52  edm::LogInfo("DQMReferenceHistogramRootFileSourceHandler") << ss.str();
53  }
54  edm::LogInfo("DQMReferenceHistogramRootFileSourceHandler") << "runnumber/first since = " << m_since << std::endl;
55  if(m_since<=this->tagInfo().lastInterval.first){
56  edm::LogInfo("DQMReferenceHistogramRootFileSourceHandler")
57  << "[DQMReferenceHistogramRootFileSourceHandler::getNewObjects] \nthe current starting iov " << m_since
58  << "\nis not compatible with the last iov ("
59  << this->tagInfo().lastInterval.first << ") open for the object "
60  << this->logDBEntry().payloadClass << " \nin the db "
61  << this->logDBEntry().destinationDB << " \n NO TRANSFER NEEDED"
62  << std::endl;
63  return;
64  }
65  edm::LogInfo("DQMReferenceHistogramRootFileSourceHandler")
66  << "[DQMReferenceHistogramRootFileSourceHandler::getNewObjects] " << m_name << " getting data to be transferred " << std::endl;
67  FileBlob* rootFile = new FileBlob(m_file,m_zip);
68  /*if(!this->tagInfo().size)
69  m_since=1;
70  else
71  if (m_debugMode)
72  m_since=this->tagInfo().lastInterval.first+1; */
73  if(rootFile->size() != 0){
74  edm::LogInfo("DQMReferenceHistogramRootFileSourceHandler") << "setting runnumber/first since = " << m_since << std::endl;
75  this->m_to_transfer.push_back(std::make_pair(rootFile,m_since));
76  } else {
77  edm::LogError("DQMSummarySourceHandler") << "Root file " << m_file << " does not exist" << std::endl;
78  }
79  edm::LogInfo("DQMSummarySourceHandler") << "------- "
80  << m_name << " - > getNewObjects"
81  << std::endl;
82  }
83 
85 }
unsigned long long logId
Definition: Types.h:87
std::string provenance
Definition: Types.h:89
std::string payloadToken
Definition: Types.h:96
size_t size
Definition: Types.h:72
std::string execmessage
Definition: Types.h:98
std::string name
Definition: Types.h:68
cond::ValidityInterval lastInterval
Definition: Types.h:70
std::string payloadClass
Definition: Types.h:95
cond::LogDBEntry_t const & logDBEntry() const
std::string destinationDB
Definition: Types.h:88
int size() const
Definition: FileBlob.h:33
std::string exectime
Definition: Types.h:97
std::string lastPayloadToken
Definition: Types.h:71
unsigned int payloadIdx
Definition: Types.h:93
std::string usertext
Definition: Types.h:90
volatile std::atomic< bool > shutdown_flag false
tuple size
Write out results.
std::string token
Definition: Types.h:69
cond::TagInfo_t const & tagInfo() const
std::string iovtimetype
Definition: Types.h:92
std::string iovtag
Definition: Types.h:91