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::payloadContainer, cond::LogDBEntry::payloadIdx, cond::LogDBEntry::payloadName, 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().payloadName<< "\n"
60  << this->logDBEntry().payloadToken<< "\n"
61  << this->logDBEntry().payloadContainer<< "\n"
62  << this->logDBEntry().exectime<< "\n"
63  << this->logDBEntry().execmessage<< "\n";
64  if(this->logDBEntry().usertext!="")
65  ss<< "\n-- user text " << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@")) ;
66 
67  } else {
68  ss << " First object for this tag ";
69  }
70  edm::LogInfo ("DQMHistoryPopConHandler") << ss.str();
71 /* if (m_debugMode){ */
72 /* } */
73 
74  condObjBuilder->initialize();
75 
76  if (isTransferNeeded())
78 
79  edm::LogInfo ("DQMHistoryPopConHandler") << "[DQMHistoryPopConHandler::getNewObjects] for PopCon application " << m_name << " Done\n--------------\n";
80  }
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
std::string name
Definition: TagInfo.h:9
cond::LogDBEntry const & logDBEntry() const
std::string execmessage
Definition: LogDBEntry.h:19
size_t size
Definition: TagInfo.h:13
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.
template<typename U >
std::string popcon::DQMHistoryPopConHandler< U >::id ( void  ) const
inlinevirtual
template<typename U >
bool popcon::DQMHistoryPopConHandler< U >::isTransferNeeded ( )
inlineprivate

Definition at line 92 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::payloadName, popcon::PopConSourceHandler< HDQMSummary >::tagInfo(), and cond::LogDBEntry::usertext.

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

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

Definition at line 138 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, VarParsing::obj, findQualityFiles::size, and popcon::PopConSourceHandler< HDQMSummary >::tagInfo().

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

138  {
139  edm::LogInfo ("DQMHistoryPopConHandler") << "[DQMHistoryPopConHandler::setForTransfer] " << m_name << " getting data to be transferred " << std::endl;
140 
141  HDQMSummary *obj=0;
142  condObjBuilder->getObj(obj);
143 
144  if(!this->tagInfo().size)
145  m_since=1;
146  else
147  if (m_debugMode)
148  m_since=this->tagInfo().lastInterval.first+1;
149 
150  if (obj!=0){
151 
152  edm::LogInfo ("DQMHistoryPopConHandler") <<"setting since = "<< m_since <<std::endl;
153  this->m_to_transfer.push_back(std::make_pair(obj,m_since));
154  }else{
155  edm::LogError ("DQMHistoryPopConHandler") <<"[DQMHistoryPopConHandler::setForTransfer] " << m_name << " : NULL pointer of obj HDQMSummary reported by SiStripCondObjBuilderFromDb\n Transfer aborted"<<std::endl;
156  }
157  }
tuple obj
Example code starts here #.
Definition: VarParsing.py:655
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