CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMXMLFileSourceHandler.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","DQMXMLFileSourceHandler")),
12  m_file(pset.getUntrackedParameter<std::string>("XMLFile","./file.xml")),
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("DQMXMLFileSourceHandler") << "[DQMXMLFileSourceHandler::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 name " << this->logDBEntry().payloadName
43  << ",\n payload token " << this->logDBEntry().payloadToken
44  << ",\n payload container " << this->logDBEntry().payloadContainer
45  << ",\n execution time " << this->logDBEntry().exectime
46  << ",\n execution message " << this->logDBEntry().execmessage
47  << std::endl;
48  Ref payload = this->lastPayload();
49  ss << "size of last payload " << payload->size() << std::endl;
50  } else {
51  ss << " First object for this tag " << std::endl;
52  }
53  edm::LogInfo("DQMXMLFileSourceHandler") << ss.str();
54  }
55  edm::LogInfo("DQMXMLFileSourceHandler") << "runnumber/first since = " << m_since << std::endl;
56  if(m_since<=this->tagInfo().lastInterval.first){
57  edm::LogInfo("DQMXMLFileSourceHandler")
58  << "[DQMXMLFileSourceHandler::getNewObjects] \nthe current starting iov " << m_since
59  << "\nis not compatible with the last iov ("
60  << this->tagInfo().lastInterval.first << ") open for the object "
61  << this->logDBEntry().payloadName << " \nin the db "
62  << this->logDBEntry().destinationDB << " \n NO TRANSFER NEEDED"
63  << std::endl;
64  return;
65  }
66  edm::LogInfo("DQMXMLFileSourceHandler")
67  << "[DQMXMLFileSourceHandler::getNewObjects] " << m_name << " getting data to be transferred " << std::endl;
68  FileBlob* XMLFile = new FileBlob(m_file,m_zip);
69  /*if(!this->tagInfo().size)
70  m_since=1;
71  else
72  if (m_debugMode)
73  m_since=this->tagInfo().lastInterval.first+1; */
74  if(XMLFile->size() != 0){
75  edm::LogInfo("DQMXMLFileSourceHandler") << "setting runnumber/first since = " << m_since << std::endl;
76  this->m_to_transfer.push_back(std::make_pair(XMLFile,m_since));
77  } else {
78  edm::LogError("DQMSummarySourceHandler") << "XML file " << m_file << " does not exist" << std::endl;
79  }
80  edm::LogInfo("DQMSummarySourceHandler") << "------- "
81  << m_name << " - > getNewObjects"
82  << std::endl;
83  }
84 
85  std::string DQMXMLFileSourceHandler::id() const {return m_name;}
86 }
std::string exectime
Definition: LogDBEntry.h:18
std::string usertext
Definition: LogDBEntry.h:10
std::string iovtimetype
Definition: LogDBEntry.h:12
unsigned int payloadIdx
Definition: LogDBEntry.h:13
std::string payloadToken
Definition: LogDBEntry.h:16
unsigned long long logId
Definition: LogDBEntry.h:7
std::string payloadName
Definition: LogDBEntry.h:15
std::string destinationDB
Definition: LogDBEntry.h:8
std::string lastPayloadToken
Definition: TagInfo.h:12
cond::TagInfo const & tagInfo() const
std::string name
Definition: TagInfo.h:9
cond::LogDBEntry const & logDBEntry() const
DQMXMLFileSourceHandler(const edm::ParameterSet &pset)
std::string execmessage
Definition: LogDBEntry.h:19
tuple pset
Definition: CrabTask.py:85
size_t size
Definition: TagInfo.h:13
int size() const
Definition: FileBlob.h:31
std::string payloadContainer
Definition: LogDBEntry.h:17
std::string token
Definition: TagInfo.h:10
std::string provenance
Definition: LogDBEntry.h:9
cond::ValidityInterval lastInterval
Definition: TagInfo.h:11
std::string iovtag
Definition: LogDBEntry.h:11
tuple size
Write out results.