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 Member Functions | Private Attributes
popcon::DQMHistoryPopConHandler< U > Class Template Reference

#include <DQMHistoryPopConHandler.h>

Inheritance diagram for popcon::DQMHistoryPopConHandler< U >:
popcon::PopConSourceHandler< HDQMSummary >

Public Member Functions

 DQMHistoryPopConHandler (const edm::ParameterSet &pset)
 
void getNewObjects ()
 
std::string id () const
 
 ~DQMHistoryPopConHandler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< HDQMSummary >
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 Member Functions

bool isTransferNeeded ()
 
void setForTransfer ()
 

Private Attributes

edm::Service< U > condObjBuilder
 
bool m_debugMode
 
bool m_iovSequence
 
std::string m_name
 
unsigned long long m_since
 

Additional Inherited Members

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

Detailed Description

template<typename U>
class popcon::DQMHistoryPopConHandler< U >

Definition at line 22 of file DQMHistoryPopConHandler.h.

Constructor & Destructor Documentation

template<typename U >
popcon::DQMHistoryPopConHandler< U >::DQMHistoryPopConHandler ( const edm::ParameterSet pset)
inline

Definition at line 25 of file DQMHistoryPopConHandler.h.

25  :
26  m_name(pset.getUntrackedParameter<std::string>("name","DQMHistoryPopConHandler")),
27  m_since(pset.getUntrackedParameter<uint32_t>("since",5)),
28  m_debugMode(pset.getUntrackedParameter<bool>("debug",false)),
29  m_iovSequence(pset.getUntrackedParameter<bool>("iovSequence",false)){};
T getUntrackedParameter(std::string const &, T const &) const
template<typename U >
popcon::DQMHistoryPopConHandler< U >::~DQMHistoryPopConHandler ( )
inline

Definition at line 33 of file DQMHistoryPopConHandler.h.

33 {};

Member Function Documentation

template<typename U >
void popcon::DQMHistoryPopConHandler< U >::getNewObjects ( )
inlinevirtual

Implements popcon::PopConSourceHandler< HDQMSummary >.

Definition at line 37 of file DQMHistoryPopConHandler.h.

References popcon::DQMHistoryPopConHandler< U >::condObjBuilder, cond::LogDBEntry::destinationDB, cond::LogDBEntry::execmessage, cond::LogDBEntry::exectime, cond::LogDBEntry::iovtag, cond::LogDBEntry::iovtimetype, popcon::DQMHistoryPopConHandler< U >::isTransferNeeded(), cond::TagInfo::lastInterval, cond::TagInfo::lastPayloadToken, popcon::PopConSourceHandler< HDQMSummary >::logDBEntry(), cond::LogDBEntry::logId, popcon::DQMHistoryPopConHandler< U >::m_name, cond::TagInfo::name, cond::LogDBEntry::payloadClass, cond::LogDBEntry::payloadIdx, cond::LogDBEntry::payloadToken, cond::LogDBEntry::provenance, popcon::DQMHistoryPopConHandler< U >::setForTransfer(), cond::TagInfo::size, findQualityFiles::size, popcon::PopConSourceHandler< HDQMSummary >::tagInfo(), cond::TagInfo::token, cond::LogDBEntry::usertext, and popcon::PopConSourceHandler< HDQMSummary >::userTextLog().

37  {
38  edm::LogInfo ("DQMHistoryPopConHandler") << "[DQMHistoryPopConHandler::getNewObjects] for PopCon application " << m_name;
39 
40  std::stringstream ss;
41  ss << "\n\n------- " << m_name
42  << " - > getNewObjects\n";
43  if (this->tagInfo().size){
44  //check whats already inside of database
45  ss << "\ngot offlineInfo"<< this->tagInfo().name
46  << "\n size " << this->tagInfo().size
47  << "\n" << this->tagInfo().token
48  << "\n last object valid since " << this->tagInfo().lastInterval.first
49  << "\n token " << this->tagInfo().lastPayloadToken
50  << "\n UserText " << this->userTextLog()
51  << "\n LogDBEntry \n"
52  << this->logDBEntry().logId<< "\n"
53  << this->logDBEntry().destinationDB<< "\n"
54  << this->logDBEntry().provenance<< "\n"
55  << this->logDBEntry().usertext<< "\n"
56  << this->logDBEntry().iovtag<< "\n"
57  << this->logDBEntry().iovtimetype<< "\n"
58  << this->logDBEntry().payloadIdx<< "\n"
59  << this->logDBEntry().payloadClass<< "\n"
60  << this->logDBEntry().payloadToken<< "\n"
61  << this->logDBEntry().exectime<< "\n"
62  << this->logDBEntry().execmessage<< "\n";
63  if(this->logDBEntry().usertext!="")
64  ss<< "\n-- user text " << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@")) ;
65 
66  } else {
67  ss << " First object for this tag ";
68  }
69  edm::LogInfo ("DQMHistoryPopConHandler") << ss.str();
70 /* if (m_debugMode){ */
71 /* } */
72 
73  condObjBuilder->initialize();
74 
75  if (isTransferNeeded())
77 
78  edm::LogInfo ("DQMHistoryPopConHandler") << "[DQMHistoryPopConHandler::getNewObjects] for PopCon application " << m_name << " Done\n--------------\n";
79  }
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
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
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.
template<typename U >
std::string popcon::DQMHistoryPopConHandler< U >::id ( void  ) const
inlinevirtual
template<typename U >
bool popcon::DQMHistoryPopConHandler< U >::isTransferNeeded ( )
inlineprivate

Definition at line 91 of file DQMHistoryPopConHandler.h.

References popcon::DQMHistoryPopConHandler< U >::condObjBuilder, cond::LogDBEntry::destinationDB, cond::TagInfo::lastInterval, popcon::PopConSourceHandler< HDQMSummary >::logDBEntry(), popcon::DQMHistoryPopConHandler< U >::m_iovSequence, popcon::DQMHistoryPopConHandler< U >::m_since, popcon::PopConSourceHandler< HDQMSummary >::m_userTextLog, cond::LogDBEntry::payloadClass, popcon::PopConSourceHandler< HDQMSummary >::tagInfo(), and cond::LogDBEntry::usertext.

Referenced by popcon::DQMHistoryPopConHandler< U >::getNewObjects().

91  {
92 
93  edm::LogInfo ("DQMHistoryPopConHandler") << "[DQMHistoryPopConHandler::isTransferNeeded] checking for transfer " << std::endl;
94 
95  if(m_iovSequence && m_since<=this->tagInfo().lastInterval.first){
96  edm::LogInfo ("DQMHistoryPopConHandler")
97  << "[DQMHistoryPopConHandler::isTransferNeeded] \nthe current starting iov " << m_since
98  << "\nis not compatible with the last iov ("
99  << this->tagInfo().lastInterval.first << ") open for the object "
100  << this->logDBEntry().payloadClass << " \nin the db "
101  << this->logDBEntry().destinationDB << " \n NO TRANSFER NEEDED";
102  return false;
103  }
104 
105  std::stringstream ss_logdb, ss;
106 
107  //get log information from previous upload
108  if (this->logDBEntry().usertext!="")
109  ss_logdb << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@")+2);
110 
111 
112  condObjBuilder->getMetaDataString(ss);
113  if ((m_iovSequence && condObjBuilder->checkForCompatibility(ss_logdb.str())) || !m_iovSequence){
114 
115  this->m_userTextLog = "@ " + ss.str();
116 
117  edm::LogInfo ("DQMHistoryPopConHandler")
118  << "[DQMHistoryPopConHandler::isTransferNeeded] \nthe selected conditions will be uploaded: " << ss.str()
119  << "\n Current MetaData - "<< ss.str() << "\n Last Uploaded MetaData- " << ss_logdb.str() << "\n Fine";
120 
121  return true;
122  } else if (m_iovSequence && !condObjBuilder->checkForCompatibility(ss_logdb.str())) {
123  edm::LogInfo ("DQMHistoryPopConHandler")
124  << "[DQMHistoryPopConHandler::isTransferNeeded] \nthe current MetaData conditions " << ss.str()
125  << "\nare not compatible with the MetaData Conditions of the last iov ("
126  << this->tagInfo().lastInterval.first << ") open for the object "
127  << this->logDBEntry().payloadClass << " \nin the db "
128  << this->logDBEntry().destinationDB << " \nConditions: " << ss_logdb.str() << "\n NO TRANSFER NEEDED";
129  return false;
130  }
131  return false;
132  }
std::string usertext
Definition: LogDBEntry.h:20
std::string payloadClass
Definition: LogDBEntry.h:25
std::string destinationDB
Definition: LogDBEntry.h:18
cond::LogDBEntry const & logDBEntry() const
cond::ValidityInterval lastInterval
Definition: TagInfo.h:11
template<typename U >
void popcon::DQMHistoryPopConHandler< U >::setForTransfer ( )
inlineprivate

Definition at line 137 of file DQMHistoryPopConHandler.h.

References popcon::DQMHistoryPopConHandler< U >::condObjBuilder, cond::TagInfo::lastInterval, popcon::DQMHistoryPopConHandler< U >::m_debugMode, popcon::DQMHistoryPopConHandler< U >::m_name, popcon::DQMHistoryPopConHandler< U >::m_since, popcon::PopConSourceHandler< HDQMSummary >::m_to_transfer, getGTfromDQMFile::obj, findQualityFiles::size, and popcon::PopConSourceHandler< HDQMSummary >::tagInfo().

Referenced by popcon::DQMHistoryPopConHandler< U >::getNewObjects().

137  {
138  edm::LogInfo ("DQMHistoryPopConHandler") << "[DQMHistoryPopConHandler::setForTransfer] " << m_name << " getting data to be transferred " << std::endl;
139 
140  HDQMSummary *obj=0;
141  condObjBuilder->getObj(obj);
142 
143  if(!this->tagInfo().size)
144  m_since=1;
145  else
146  if (m_debugMode)
147  m_since=this->tagInfo().lastInterval.first+1;
148 
149  if (obj!=0){
150 
151  edm::LogInfo ("DQMHistoryPopConHandler") <<"setting since = "<< m_since <<std::endl;
152  this->m_to_transfer.push_back(std::make_pair(obj,m_since));
153  }else{
154  edm::LogError ("DQMHistoryPopConHandler") <<"[DQMHistoryPopConHandler::setForTransfer] " << m_name << " : NULL pointer of obj HDQMSummary reported by SiStripCondObjBuilderFromDb\n Transfer aborted"<<std::endl;
155  }
156  }
cond::ValidityInterval lastInterval
Definition: TagInfo.h:11
tuple size
Write out results.

Member Data Documentation

template<typename U >
edm::Service<U> popcon::DQMHistoryPopConHandler< U >::condObjBuilder
private
template<typename U >
bool popcon::DQMHistoryPopConHandler< U >::m_debugMode
private
template<typename U >
bool popcon::DQMHistoryPopConHandler< U >::m_iovSequence
private
template<typename U >
std::string popcon::DQMHistoryPopConHandler< U >::m_name
private
template<typename U >
unsigned long long popcon::DQMHistoryPopConHandler< U >::m_since
private