CMS 3D CMS Logo

List of all members | Public Types | 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 Types

typedef dqm::legacy::DQMStore DQMStore
 
- 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
 

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

- 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.

Member Typedef Documentation

◆ DQMStore

Definition at line 20 of file SiStripDQMPopConSourceHandler.h.

Constructor & Destructor Documentation

◆ SiStripDQMPopConSourceHandler()

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

Definition at line 22 of file SiStripDQMPopConSourceHandler.h.

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

◆ ~SiStripDQMPopConSourceHandler()

template<typename T>
SiStripDQMPopConSourceHandler< T >::~SiStripDQMPopConSourceHandler ( )
inlineoverride

Definition at line 30 of file SiStripDQMPopConSourceHandler.h.

30 {}

Member Function Documentation

◆ checkForCompatibility()

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

Definition at line 39 of file SiStripDQMPopConSourceHandler.h.

39  {
40  return otherMetaData != getMetaDataString();
41  }

◆ dqmEndJob()

template<typename T>
virtual void SiStripDQMPopConSourceHandler< T >::dqmEndJob ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
inlinevirtual

◆ getMetaDataString()

template<class T >
std::string SiStripDQMPopConSourceHandler< T >::getMetaDataString ( ) const
virtual

Reimplemented in SiStripPopConBadComponentsHandlerFromDQM.

Definition at line 167 of file SiStripDQMPopConSourceHandler.h.

167  {
168  std::cout << "SiStripPedestalsDQMService::getMetaDataString" << std::endl;
169  std::stringstream ss;
170  ss << "Run " << m_runNumber << std::endl;
171  return ss.str();
172 }

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

◆ getNewObjects()

template<typename T >
void SiStripDQMPopConSourceHandler< T >::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< T >.

Definition at line 67 of file SiStripDQMPopConSourceHandler.h.

67  {
68  edm::LogInfo("SiStripPopConDbObjHandler")
69  << "[SiStripPopConDbObjHandler::getNewObjects] for PopCon application " << m_name;
70 
71  if (m_debugMode) {
72  std::stringstream ss;
73  ss << "\n\n------- " << m_name << " - > getNewObjects\n";
74  if (this->tagInfo().size) {
75  //check whats already inside of database
76  ss << "\ngot offlineInfo" << this->tagInfo().name << "\n size " << this->tagInfo().size
77  << "\n last object valid since " << this->tagInfo().lastInterval.since << "\n token "
78  << this->tagInfo().lastInterval.payloadId << "\n UserText " << this->userTextLog() << "\n LogDBEntry \n"
79  << this->logDBEntry().logId << "\n"
80  << this->logDBEntry().destinationDB << "\n"
81  << this->logDBEntry().provenance << "\n"
82  << this->logDBEntry().usertext << "\n"
83  << this->logDBEntry().iovtag << "\n"
84  << this->logDBEntry().iovtimetype << "\n"
85  << this->logDBEntry().payloadIdx << "\n"
86  << this->logDBEntry().payloadClass << "\n"
87  << this->logDBEntry().payloadToken << "\n"
88  << this->logDBEntry().exectime << "\n"
89  << this->logDBEntry().execmessage << "\n";
90  if (!this->logDBEntry().usertext.empty())
91  ss << "\n-- user text " << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@"));
92  } else {
93  ss << " First object for this tag ";
94  }
95  edm::LogInfo("SiStripPopConDbObjHandler") << ss.str();
96  }
97 
98  if (isTransferNeeded())
100 
101  edm::LogInfo("SiStripPopConDbObjHandler")
102  << "[SiStripPopConDbObjHandler::getNewObjects] for PopCon application " << m_name << " Done\n--------------\n";
103 }

◆ getObj()

template<typename T>
virtual T* SiStripDQMPopConSourceHandler< T >::getObj ( ) const
pure virtual

◆ getRunNumber()

template<typename T>
uint32_t SiStripDQMPopConSourceHandler< T >::getRunNumber ( ) const
inlineprotected

Definition at line 48 of file SiStripDQMPopConSourceHandler.h.

48 { return m_runNumber; }

◆ id()

template<typename T>
std::string SiStripDQMPopConSourceHandler< T >::id ( void  ) const
inlineoverridevirtual

Implements popcon::PopConSourceHandler< T >.

Definition at line 34 of file SiStripDQMPopConSourceHandler.h.

34 { return m_name; }

◆ initES()

template<typename T>
virtual void SiStripDQMPopConSourceHandler< T >::initES ( const edm::EventSetup )
inlinevirtual

◆ isTransferNeeded()

template<typename T >
bool SiStripDQMPopConSourceHandler< T >::isTransferNeeded ( )
private

Definition at line 106 of file SiStripDQMPopConSourceHandler.h.

106  {
107  edm::LogInfo("SiStripPopConDbObjHandler") << "[SiStripPopConDbObjHandler::isTransferNeeded] checking for transfer ";
108 
109  if (m_iovSequence && (m_since <= this->tagInfo().lastInterval.since)) {
110  edm::LogInfo("SiStripPopConDbObjHandler")
111  << "[SiStripPopConDbObjHandler::isTransferNeeded] \nthe current starting iov " << m_since
112  << "\nis not compatible with the last iov (" << this->tagInfo().lastInterval.since << ") open for the object "
113  << this->logDBEntry().payloadClass << " \nin the db " << this->logDBEntry().destinationDB
114  << " \n NO TRANSFER NEEDED";
115  return false;
116  }
117 
118  std::string ss_logdb{};
119 
120  //get log information from previous upload
121  if (!this->logDBEntry().usertext.empty())
122  ss_logdb = this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@") + 2);
123 
125  if ((!m_iovSequence) || checkForCompatibility(ss_logdb)) {
126  this->m_userTextLog = "@ " + ss;
127 
128  edm::LogInfo("SiStripPopConDbObjHandler")
129  << "[SiStripPopConDbObjHandler::isTransferNeeded] \nthe selected conditions will be uploaded: " << ss
130  << "\n Current MetaData - " << ss << "\n Last Uploaded MetaData- " << ss_logdb << "\n Fine";
131 
132  return true;
133  } else if (m_iovSequence) {
134  edm::LogInfo("SiStripPopConDbObjHandler")
135  << "[SiStripPopConDbObjHandler::isTransferNeeded] \nthe current MetaData conditions " << ss
136  << "\nare not compatible with the MetaData Conditions of the last iov (" << this->tagInfo().lastInterval.since
137  << ") open for the object " << this->logDBEntry().payloadClass << " \nin the db "
138  << this->logDBEntry().destinationDB << " \nConditions: " << ss_logdb << "\n NO TRANSFER NEEDED";
139  return false;
140  } else {
141  return true;
142  }
143 }

◆ setForTransfer()

template<typename T >
void SiStripDQMPopConSourceHandler< T >::setForTransfer ( )
private

Definition at line 146 of file SiStripDQMPopConSourceHandler.h.

146  {
147  edm::LogInfo("SiStripPopConDbObjHandler")
148  << "[SiStripPopConDbObjHandler::setForTransfer] " << m_name << " getting data to be transferred ";
149 
150  if (!this->tagInfo().size)
151  m_since = 1;
152  else if (m_debugMode)
153  m_since = this->tagInfo().lastInterval.since + 1;
154 
155  T* obj = this->getObj();
156  if (obj) {
157  edm::LogInfo("SiStripPopConDbObjHandler") << "setting since = " << m_since;
158  this->m_to_transfer.push_back(std::make_pair(obj, m_since));
159  } else {
160  edm::LogError("SiStripPopConDbObjHandler")
161  << "[SiStripPopConDbObjHandler::setForTransfer] " << m_name << " : NULL pointer of obj " << typeid(T).name()
162  << " reported by SiStripCondObjBuilderFromDb\n Transfer aborted";
163  }
164 }

Member Data Documentation

◆ m_debugMode

template<typename T>
bool SiStripDQMPopConSourceHandler< T >::m_debugMode
private

Definition at line 55 of file SiStripDQMPopConSourceHandler.h.

◆ m_iovSequence

template<typename T>
bool SiStripDQMPopConSourceHandler< T >::m_iovSequence
private

Definition at line 54 of file SiStripDQMPopConSourceHandler.h.

◆ m_name

template<typename T>
std::string SiStripDQMPopConSourceHandler< T >::m_name
private

◆ m_runNumber

template<typename T>
uint32_t SiStripDQMPopConSourceHandler< T >::m_runNumber
private

◆ m_since

template<typename T>
unsigned long long SiStripDQMPopConSourceHandler< T >::m_since
private

Definition at line 52 of file SiStripDQMPopConSourceHandler.h.

popcon::PopConSourceHandler::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
gather_cfg.cout
cout
Definition: gather_cfg.py:144
SiStripDQMPopConSourceHandler::m_name
std::string m_name
Definition: SiStripDQMPopConSourceHandler.h:51
edm::LogInfo
Definition: MessageLogger.h:254
SiStripDQMPopConSourceHandler::isTransferNeeded
bool isTransferNeeded()
Definition: SiStripDQMPopConSourceHandler.h:106
SiStripDQMPopConSourceHandler::checkForCompatibility
virtual bool checkForCompatibility(const std::string &otherMetaData) const
Definition: SiStripDQMPopConSourceHandler.h:39
cond::LogDBEntry_t::execmessage
std::string execmessage
Definition: Types.h:98
cond::TagInfo_t::name
std::string name
Definition: Types.h:72
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripDQMPopConSourceHandler::m_iovSequence
bool m_iovSequence
Definition: SiStripDQMPopConSourceHandler.h:54
cond::LogDBEntry_t::provenance
std::string provenance
Definition: Types.h:89
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripDQMPopConSourceHandler::setForTransfer
void setForTransfer()
Definition: SiStripDQMPopConSourceHandler.h:146
SiStripDQMPopConSourceHandler::m_runNumber
uint32_t m_runNumber
Definition: SiStripDQMPopConSourceHandler.h:53
cond::LogDBEntry_t::payloadToken
std::string payloadToken
Definition: Types.h:96
edm::LogError
Definition: MessageLogger.h:183
popcon::PopConSourceHandler::tagInfo
cond::TagInfo_t const & tagInfo() const
Definition: PopConSourceHandler.h:78
cond::Iov_t::payloadId
Hash payloadId
Definition: Types.h:55
cond::LogDBEntry_t::usertext
std::string usertext
Definition: Types.h:90
cond::Iov_t::since
Time_t since
Definition: Types.h:53
SiStripDQMPopConSourceHandler::getMetaDataString
virtual std::string getMetaDataString() const
Definition: SiStripDQMPopConSourceHandler.h:167
cond::LogDBEntry_t::iovtag
std::string iovtag
Definition: Types.h:91
cond::LogDBEntry_t::destinationDB
std::string destinationDB
Definition: Types.h:88
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition: Types.h:73
SiStripDQMPopConSourceHandler::m_debugMode
bool m_debugMode
Definition: SiStripDQMPopConSourceHandler.h:55
cond::LogDBEntry_t::iovtimetype
std::string iovtimetype
Definition: Types.h:92
cond::LogDBEntry_t::payloadClass
std::string payloadClass
Definition: Types.h:95
T
long double T
Definition: Basic3DVectorLD.h:48
cond::LogDBEntry_t::logId
unsigned long long logId
Definition: Types.h:87
SiStripDQMPopConSourceHandler::m_since
unsigned long long m_since
Definition: SiStripDQMPopConSourceHandler.h:52
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
SiStripDQMPopConSourceHandler::getObj
virtual T * getObj() const =0
cond::LogDBEntry_t::payloadIdx
unsigned int payloadIdx
Definition: Types.h:93
popcon::PopConSourceHandler::m_userTextLog
std::string m_userTextLog
Definition: PopConSourceHandler.h:168
popcon::PopConSourceHandler::logDBEntry
cond::LogDBEntry_t const & logDBEntry() const
Definition: PopConSourceHandler.h:84
popcon::PopConSourceHandler::userTextLog
std::string const & userTextLog() const
Definition: PopConSourceHandler.h:111
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
cond::TagInfo_t::size
size_t size
Definition: Types.h:74
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
cond::LogDBEntry_t::exectime
std::string exectime
Definition: Types.h:97