CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
SiStripDQMPopConSourceHandler< T > Class Template Referenceabstract

#include <SiStripDQMPopConSourceHandler.h>

Inheritance diagram for SiStripDQMPopConSourceHandler< T >:
popcon::PopConSourceHandler< T >

Public Member Functions

virtual bool checkForCompatibility (const std::string &otherMetaData) const
 
virtual void dqmEndJob (DQMStore::IBooker &booker, DQMStore::IGetter &getter)
 
virtual std::string getMetaDataString () const
 
void getNewObjects () override
 
virtual TgetObj () const =0
 
std::string id () const override
 
virtual void initES (const edm::EventSetup &)
 
 SiStripDQMPopConSourceHandler (const edm::ParameterSet &pset)
 
 ~SiStripDQMPopConSourceHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< T >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const *, std::string const > operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Protected Member Functions

uint32_t getRunNumber () const
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< T >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 

Private Member Functions

bool isTransferNeeded ()
 
void setForTransfer ()
 

Private Attributes

bool m_debugMode
 
bool m_iovSequence
 
std::string m_name
 
uint32_t m_runNumber
 
unsigned long long m_since
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< T >
typedef std::vector< TripletContainer
 
typedef std::vector< std::pair< T *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< Tself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef T value_type
 
- Protected Attributes inherited from popcon::PopConSourceHandler< T >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

template<typename T>
class SiStripDQMPopConSourceHandler< T >

Author
M. De Mattia
P. David (merge service functionality into base class)

Base class for SiStrip popcon::PopConSourceHandler (reading from DQM) and writing in the Database.

Definition at line 18 of file SiStripDQMPopConSourceHandler.h.

Constructor & Destructor Documentation

template<typename T>
SiStripDQMPopConSourceHandler< T >::SiStripDQMPopConSourceHandler ( const edm::ParameterSet pset)
inlineexplicit

Definition at line 21 of file SiStripDQMPopConSourceHandler.h.

22  : m_name{pset.getUntrackedParameter<std::string>("name", "SiStripPopConDbObjHandler")}
23  , m_since{pset.getUntrackedParameter<uint32_t>("since", 5)}
24  , m_runNumber{pset.getParameter<uint32_t>("RunNb")}
25  , m_iovSequence{pset.getUntrackedParameter<bool>("iovSequence", true)} // flag: check compatibility
26  , m_debugMode{pset.getUntrackedParameter<bool>("debug", false)}
27  {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
template<typename T>
SiStripDQMPopConSourceHandler< T >::~SiStripDQMPopConSourceHandler ( )
inlineoverride

Definition at line 29 of file SiStripDQMPopConSourceHandler.h.

29 {}

Member Function Documentation

template<typename T>
virtual bool SiStripDQMPopConSourceHandler< T >::checkForCompatibility ( const std::string &  otherMetaData) const
inlinevirtual

Reimplemented in SiStripPopConHistoryDQMBase.

Definition at line 38 of file SiStripDQMPopConSourceHandler.h.

Referenced by SiStripDQMPopConSourceHandler< T >::isTransferNeeded().

38 { return otherMetaData != getMetaDataString(); }
virtual std::string getMetaDataString() const
template<typename T>
virtual void SiStripDQMPopConSourceHandler< T >::dqmEndJob ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
inlinevirtual
template<class T >
std::string SiStripDQMPopConSourceHandler< T >::getMetaDataString ( ) const
virtual

Reimplemented in SiStripPopConBadComponentsHandlerFromDQM.

Definition at line 170 of file SiStripDQMPopConSourceHandler.h.

References gather_cfg::cout, and SiStripDQMPopConSourceHandler< T >::m_runNumber.

Referenced by SiStripDQMPopConSourceHandler< SiStripBadStrip >::checkForCompatibility(), SiStripDQMPopConSourceHandler< SiStripBadStrip >::id(), and SiStripDQMPopConSourceHandler< T >::isTransferNeeded().

171 {
172  std::cout << "SiStripPedestalsDQMService::getMetaDataString" << std::endl;
173  std::stringstream ss;
174  ss << "Run " << m_runNumber << std::endl;
175  return ss.str();
176 }
template<typename T >
void SiStripDQMPopConSourceHandler< T >::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< T >.

Definition at line 64 of file SiStripDQMPopConSourceHandler.h.

References cond::LogDBEntry_t::destinationDB, cond::LogDBEntry_t::execmessage, cond::LogDBEntry_t::exectime, cond::LogDBEntry_t::iovtag, cond::LogDBEntry_t::iovtimetype, SiStripDQMPopConSourceHandler< T >::isTransferNeeded(), cond::TagInfo_t::lastInterval, cond::TagInfo_t::lastPayloadToken, popcon::PopConSourceHandler< T >::logDBEntry(), cond::LogDBEntry_t::logId, SiStripDQMPopConSourceHandler< T >::m_debugMode, SiStripDQMPopConSourceHandler< T >::m_name, cond::TagInfo_t::name, cond::LogDBEntry_t::payloadClass, cond::LogDBEntry_t::payloadIdx, cond::LogDBEntry_t::payloadToken, cond::LogDBEntry_t::provenance, SiStripDQMPopConSourceHandler< T >::setForTransfer(), cond::TagInfo_t::size, findQualityFiles::size, popcon::PopConSourceHandler< T >::tagInfo(), cond::TagInfo_t::token, cond::LogDBEntry_t::usertext, and popcon::PopConSourceHandler< T >::userTextLog().

Referenced by SiStripDQMPopConSourceHandler< SiStripBadStrip >::~SiStripDQMPopConSourceHandler().

65 {
66  edm::LogInfo("SiStripPopConDbObjHandler") << "[SiStripPopConDbObjHandler::getNewObjects] for PopCon application " << m_name;
67 
68  if ( m_debugMode ) {
69  std::stringstream ss;
70  ss << "\n\n------- " << m_name
71  << " - > getNewObjects\n";
72  if ( this->tagInfo().size ){
73  //check whats already inside of database
74  ss << "\ngot offlineInfo" << this->tagInfo().name
75  << "\n size " << this->tagInfo().size
76  << "\n" << this->tagInfo().token
77  << "\n last object valid since " << this->tagInfo().lastInterval.first
78  << "\n token " << this->tagInfo().lastPayloadToken
79  << "\n UserText " << this->userTextLog()
80  << "\n LogDBEntry \n"
81  << this->logDBEntry().logId << "\n"
82  << this->logDBEntry().destinationDB << "\n"
83  << this->logDBEntry().provenance << "\n"
84  << this->logDBEntry().usertext << "\n"
85  << this->logDBEntry().iovtag << "\n"
86  << this->logDBEntry().iovtimetype << "\n"
87  << this->logDBEntry().payloadIdx << "\n"
88  << this->logDBEntry().payloadClass << "\n"
89  << this->logDBEntry().payloadToken << "\n"
90  << this->logDBEntry().exectime << "\n"
91  << this->logDBEntry().execmessage << "\n";
92  if ( !this->logDBEntry().usertext.empty() )
93  ss<< "\n-- user text " << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@")) ;
94  } else {
95  ss << " First object for this tag ";
96  }
97  edm::LogInfo("SiStripPopConDbObjHandler") << ss.str();
98  }
99 
100  if (isTransferNeeded())
101  setForTransfer();
102 
103  edm::LogInfo("SiStripPopConDbObjHandler") << "[SiStripPopConDbObjHandler::getNewObjects] for PopCon application " << m_name << " Done\n--------------\n";
104 }
size
Write out results.
std::string const & userTextLog() const
unsigned long long logId
Definition: Types.h:93
std::string provenance
Definition: Types.h:95
std::string payloadToken
Definition: Types.h:102
size_t size
Definition: Types.h:78
std::string execmessage
Definition: Types.h:104
std::string name
Definition: Types.h:74
cond::ValidityInterval lastInterval
Definition: Types.h:76
std::string payloadClass
Definition: Types.h:101
cond::LogDBEntry_t const & logDBEntry() const
std::string destinationDB
Definition: Types.h:94
std::string exectime
Definition: Types.h:103
std::string lastPayloadToken
Definition: Types.h:77
unsigned int payloadIdx
Definition: Types.h:99
std::string usertext
Definition: Types.h:96
std::string token
Definition: Types.h:75
cond::TagInfo_t const & tagInfo() const
std::string iovtimetype
Definition: Types.h:98
std::string iovtag
Definition: Types.h:97
template<typename T>
virtual T* SiStripDQMPopConSourceHandler< T >::getObj ( ) const
pure virtual
template<typename T>
uint32_t SiStripDQMPopConSourceHandler< T >::getRunNumber ( ) const
inlineprotected

Definition at line 45 of file SiStripDQMPopConSourceHandler.h.

template<typename T>
std::string SiStripDQMPopConSourceHandler< T >::id ( void  ) const
inlineoverridevirtual
template<typename T>
virtual void SiStripDQMPopConSourceHandler< T >::initES ( const edm::EventSetup )
inlinevirtual
template<typename T >
bool SiStripDQMPopConSourceHandler< T >::isTransferNeeded ( )
private

Definition at line 107 of file SiStripDQMPopConSourceHandler.h.

References SiStripDQMPopConSourceHandler< T >::checkForCompatibility(), cond::LogDBEntry_t::destinationDB, SiStripDQMPopConSourceHandler< T >::getMetaDataString(), cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< T >::logDBEntry(), SiStripDQMPopConSourceHandler< T >::m_iovSequence, SiStripDQMPopConSourceHandler< T >::m_since, popcon::PopConSourceHandler< T >::m_userTextLog, cond::LogDBEntry_t::payloadClass, AlCaHLTBitMon_QueryRunRegistry::string, popcon::PopConSourceHandler< T >::tagInfo(), and cond::LogDBEntry_t::usertext.

Referenced by SiStripDQMPopConSourceHandler< T >::getNewObjects().

108 {
109  edm::LogInfo("SiStripPopConDbObjHandler") << "[SiStripPopConDbObjHandler::isTransferNeeded] checking for transfer ";
110 
111  if ( m_iovSequence && ( m_since <= this->tagInfo().lastInterval.first ) ) {
112  edm::LogInfo ("SiStripPopConDbObjHandler")
113  << "[SiStripPopConDbObjHandler::isTransferNeeded] \nthe current starting iov " << m_since
114  << "\nis not compatible with the last iov ("
115  << this->tagInfo().lastInterval.first << ") open for the object "
116  << this->logDBEntry().payloadClass << " \nin the db "
117  << this->logDBEntry().destinationDB << " \n NO TRANSFER NEEDED";
118  return false;
119  }
120 
121  std::string ss_logdb{};
122 
123  //get log information from previous upload
124  if ( !this->logDBEntry().usertext.empty() )
125  ss_logdb = this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@")+2);
126 
128  if ( ( ! m_iovSequence ) || checkForCompatibility(ss_logdb) ) {
129  this->m_userTextLog = "@ " + ss;
130 
131  edm::LogInfo ("SiStripPopConDbObjHandler")
132  << "[SiStripPopConDbObjHandler::isTransferNeeded] \nthe selected conditions will be uploaded: " << ss
133  << "\n Current MetaData - " << ss << "\n Last Uploaded MetaData- " << ss_logdb << "\n Fine";
134 
135  return true;
136  } else if ( m_iovSequence ) {
137  edm::LogInfo ("SiStripPopConDbObjHandler")
138  << "[SiStripPopConDbObjHandler::isTransferNeeded] \nthe current MetaData conditions " << ss
139  << "\nare not compatible with the MetaData Conditions of the last iov ("
140  << this->tagInfo().lastInterval.first << ") open for the object "
141  << this->logDBEntry().payloadClass << " \nin the db "
142  << this->logDBEntry().destinationDB << " \nConditions: " << ss_logdb << "\n NO TRANSFER NEEDED";
143  return false;
144  } else {
145  return true;
146  }
147 }
virtual std::string getMetaDataString() const
cond::ValidityInterval lastInterval
Definition: Types.h:76
std::string payloadClass
Definition: Types.h:101
cond::LogDBEntry_t const & logDBEntry() const
std::string destinationDB
Definition: Types.h:94
std::string usertext
Definition: Types.h:96
virtual bool checkForCompatibility(const std::string &otherMetaData) const
cond::TagInfo_t const & tagInfo() const
template<typename T >
void SiStripDQMPopConSourceHandler< T >::setForTransfer ( )
private

Definition at line 150 of file SiStripDQMPopConSourceHandler.h.

References SiStripDQMPopConSourceHandler< T >::getObj(), cond::TagInfo_t::lastInterval, SiStripDQMPopConSourceHandler< T >::m_debugMode, SiStripDQMPopConSourceHandler< T >::m_name, SiStripDQMPopConSourceHandler< T >::m_since, popcon::PopConSourceHandler< T >::m_to_transfer, dataset::name, haddnano::obj, findQualityFiles::size, and popcon::PopConSourceHandler< T >::tagInfo().

Referenced by SiStripDQMPopConSourceHandler< T >::getNewObjects().

151 {
152  edm::LogInfo ("SiStripPopConDbObjHandler") << "[SiStripPopConDbObjHandler::setForTransfer] " << m_name << " getting data to be transferred ";
153 
154  if ( ! this->tagInfo().size )
155  m_since=1;
156  else
157  if (m_debugMode)
158  m_since = this->tagInfo().lastInterval.first+1;
159 
160  T* obj = this->getObj();
161  if ( obj ) {
162  edm::LogInfo ("SiStripPopConDbObjHandler") <<"setting since = "<< m_since;
163  this->m_to_transfer.push_back(std::make_pair(obj,m_since));
164  } else {
165  edm::LogError ("SiStripPopConDbObjHandler") <<"[SiStripPopConDbObjHandler::setForTransfer] " << m_name << " : NULL pointer of obj " << typeid(T).name() << " reported by SiStripCondObjBuilderFromDb\n Transfer aborted";
166  }
167 }
size
Write out results.
cond::ValidityInterval lastInterval
Definition: Types.h:76
long double T
virtual T * getObj() const =0
cond::TagInfo_t const & tagInfo() const

Member Data Documentation

template<typename T>
bool SiStripDQMPopConSourceHandler< T >::m_debugMode
private
template<typename T>
bool SiStripDQMPopConSourceHandler< T >::m_iovSequence
private
template<typename T>
std::string SiStripDQMPopConSourceHandler< T >::m_name
private
template<typename T>
uint32_t SiStripDQMPopConSourceHandler< T >::m_runNumber
private
template<typename T>
unsigned long long SiStripDQMPopConSourceHandler< T >::m_since
private