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
popcon::DQMXMLFileSourceHandler Class Reference

#include <DQMXMLFileSourceHandler.h>

Inheritance diagram for popcon::DQMXMLFileSourceHandler:
popcon::PopConSourceHandler< FileBlob >

Public Member Functions

 DQMXMLFileSourceHandler (const edm::ParameterSet &pset)
 
void getNewObjects ()
 
std::string id () const
 
 ~DQMXMLFileSourceHandler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< FileBlob >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (cond::DbSession dbSession, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (cond::DbSession session, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Attributes

bool m_debugMode
 
std::string m_file
 
std::string m_name
 
unsigned long long m_since
 
bool m_zip
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< FileBlob >
typedef std::vector< TripletContainer
 
typedef std::vector< std::pair
< FileBlob *, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< FileBlob
self
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef FileBlob value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< FileBlob >
int add (value_type *payload, Summary *summary, Time_t time)
 
- Protected Attributes inherited from popcon::PopConSourceHandler< FileBlob >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 11 of file DQMXMLFileSourceHandler.h.

Constructor & Destructor Documentation

popcon::DQMXMLFileSourceHandler::DQMXMLFileSourceHandler ( const edm::ParameterSet pset)

Definition at line 10 of file DQMXMLFileSourceHandler.cc.

10  :
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  }
T getUntrackedParameter(std::string const &, T const &) const
popcon::DQMXMLFileSourceHandler::~DQMXMLFileSourceHandler ( )

Definition at line 18 of file DQMXMLFileSourceHandler.cc.

18 {}

Member Function Documentation

void popcon::DQMXMLFileSourceHandler::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< FileBlob >.

Definition at line 20 of file DQMXMLFileSourceHandler.cc.

References cond::LogDBEntry::destinationDB, cond::LogDBEntry::execmessage, cond::LogDBEntry::exectime, cond::LogDBEntry::iovtag, cond::LogDBEntry::iovtimetype, cond::TagInfo::lastInterval, popcon::PopConSourceHandler< FileBlob >::lastPayload(), cond::TagInfo::lastPayloadToken, popcon::PopConSourceHandler< FileBlob >::logDBEntry(), cond::LogDBEntry::logId, m_debugMode, m_file, m_name, m_since, popcon::PopConSourceHandler< FileBlob >::m_to_transfer, m_zip, cond::TagInfo::name, cond::LogDBEntry::payloadClass, cond::LogDBEntry::payloadIdx, cond::LogDBEntry::payloadToken, cond::LogDBEntry::provenance, cond::TagInfo::size, FileBlob::size(), findQualityFiles::size, popcon::PopConSourceHandler< FileBlob >::tagInfo(), cond::TagInfo::token, cond::LogDBEntry::usertext, and popcon::PopConSourceHandler< FileBlob >::userTextLog().

20  {
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 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("DQMXMLFileSourceHandler") << ss.str();
53  }
54  edm::LogInfo("DQMXMLFileSourceHandler") << "runnumber/first since = " << m_since << std::endl;
55  if(m_since<=this->tagInfo().lastInterval.first){
56  edm::LogInfo("DQMXMLFileSourceHandler")
57  << "[DQMXMLFileSourceHandler::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("DQMXMLFileSourceHandler")
66  << "[DQMXMLFileSourceHandler::getNewObjects] " << m_name << " getting data to be transferred " << std::endl;
67  FileBlob* XMLFile = 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(XMLFile->size() != 0){
74  edm::LogInfo("DQMXMLFileSourceHandler") << "setting runnumber/first since = " << m_since << std::endl;
75  this->m_to_transfer.push_back(std::make_pair(XMLFile,m_since));
76  } else {
77  edm::LogError("DQMSummarySourceHandler") << "XML file " << m_file << " does not exist" << std::endl;
78  }
79  edm::LogInfo("DQMSummarySourceHandler") << "------- "
80  << m_name << " - > getNewObjects"
81  << std::endl;
82  }
std::string exectime
Definition: LogDBEntry.h:27
std::string usertext
Definition: LogDBEntry.h:20
std::string iovtimetype
Definition: LogDBEntry.h:22
unsigned int payloadIdx
Definition: LogDBEntry.h:23
std::string payloadToken
Definition: LogDBEntry.h:26
unsigned long long logId
Definition: LogDBEntry.h:17
std::string payloadClass
Definition: LogDBEntry.h:25
std::string destinationDB
Definition: LogDBEntry.h:18
std::string lastPayloadToken
Definition: TagInfo.h:12
cond::TagInfo const & tagInfo() const
std::string name
Definition: TagInfo.h:9
cond::LogDBEntry const & logDBEntry() const
std::string execmessage
Definition: LogDBEntry.h:28
size_t size
Definition: TagInfo.h:13
int size() const
Definition: FileBlob.h:31
std::string token
Definition: TagInfo.h:10
std::string provenance
Definition: LogDBEntry.h:19
cond::ValidityInterval lastInterval
Definition: TagInfo.h:11
std::string iovtag
Definition: LogDBEntry.h:21
tuple size
Write out results.
std::string popcon::DQMXMLFileSourceHandler::id ( void  ) const
virtual

Implements popcon::PopConSourceHandler< FileBlob >.

Definition at line 84 of file DQMXMLFileSourceHandler.cc.

References m_name.

Member Data Documentation

bool popcon::DQMXMLFileSourceHandler::m_debugMode
private

Definition at line 23 of file DQMXMLFileSourceHandler.h.

Referenced by getNewObjects().

std::string popcon::DQMXMLFileSourceHandler::m_file
private

Definition at line 19 of file DQMXMLFileSourceHandler.h.

Referenced by getNewObjects().

std::string popcon::DQMXMLFileSourceHandler::m_name
private

Definition at line 18 of file DQMXMLFileSourceHandler.h.

Referenced by getNewObjects(), and id().

unsigned long long popcon::DQMXMLFileSourceHandler::m_since
private

Definition at line 22 of file DQMXMLFileSourceHandler.h.

Referenced by getNewObjects().

bool popcon::DQMXMLFileSourceHandler::m_zip
private

Definition at line 20 of file DQMXMLFileSourceHandler.h.

Referenced by getNewObjects().