CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
popcon::SiStripPopConConfigDbObjHandler< T > Class Template Reference

#include <SiStripPopConConfigDbObjHandler.h>

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

Public Member Functions

void getNewObjects () override
 
std::string id () const override
 
bool isTransferNeeded ()
 
void setForTransfer ()
 
 SiStripPopConConfigDbObjHandler (const edm::ParameterSet &pset)
 
 ~SiStripPopConConfigDbObjHandler () 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 ()
 

Private Attributes

edm::Service< SiStripCondObjBuilderFromDbcondObjBuilder
 
bool m_debugMode
 
std::string m_name
 
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 Member Functions inherited from popcon::PopConSourceHandler< T >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< T >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

template<typename T>
class popcon::SiStripPopConConfigDbObjHandler< T >

Definition at line 26 of file SiStripPopConConfigDbObjHandler.h.

Constructor & Destructor Documentation

◆ SiStripPopConConfigDbObjHandler()

Definition at line 30 of file SiStripPopConConfigDbObjHandler.h.

31  : m_name(pset.getUntrackedParameter<std::string>("name", "SiStripPopPopConConfigDbObjHandler")),
32  m_since(pset.getUntrackedParameter<uint32_t>("since", 5)),
33  m_debugMode(pset.getUntrackedParameter<bool>("debug", false)){};

◆ ~SiStripPopConConfigDbObjHandler()

template<typename T >
popcon::SiStripPopConConfigDbObjHandler< T >::~SiStripPopConConfigDbObjHandler ( )
inlineoverride

Definition at line 37 of file SiStripPopConConfigDbObjHandler.h.

37 {};

Member Function Documentation

◆ getNewObjects()

template<typename T >
void popcon::SiStripPopConConfigDbObjHandler< T >::getNewObjects ( )
inlineoverridevirtual

Implements popcon::PopConSourceHandler< T >.

Definition at line 41 of file SiStripPopConConfigDbObjHandler.h.

41  {
42  edm::LogInfo("SiStripPopPopConConfigDbObjHandler") << "[getNewObjects] for PopCon application " << m_name;
43 
44  if (m_debugMode) {
45  std::stringstream ss;
46  ss << "\n\n------- " << m_name << " - > getNewObjects\n";
47  if (this->tagInfo().size) {
48  //check whats already inside of database
49  ss << "got offlineInfo" << this->tagInfo().name << ", size " << this->tagInfo().size
50  << " , last object valid since " << this->tagInfo().lastInterval.since << " token "
51  << this->tagInfo().lastInterval.payloadId << "\n\n UserText " << this->userTextLog() << "\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  << "\n\n-- user text "
64  << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@"));
65  } else {
66  ss << " First object for this tag ";
67  }
68  edm::LogInfo("SiStripPopPopConConfigDbObjHandler") << ss.str();
69  }
70  if (isTransferNeeded())
72 
73  edm::LogInfo("SiStripPopPopConConfigDbObjHandler")
74  << "[getNewObjects] for PopCon application " << m_name << " Done\n--------------\n";
75  }

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

◆ id()

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

◆ isTransferNeeded()

template<typename T >
bool popcon::SiStripPopConConfigDbObjHandler< T >::isTransferNeeded ( )
inline

Definition at line 83 of file SiStripPopConConfigDbObjHandler.h.

83  {
84  edm::LogInfo("SiStripPopPopConConfigDbObjHandler")
85  << "[isTransferNeeded] checking for transfer: " << typeid(T).name() << std::endl;
86  std::stringstream ss_logdb, ss;
87 
88  //get log information from previous upload
89  if (!this->logDBEntry().usertext.empty())
90  ss_logdb << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_first_of("@"));
91  else
92  ss_logdb << "";
93 
94  std::string label = "";
95  if (typeid(T) == typeid(SiStripFedCabling))
96  label = "Cabling";
97 
98  if (typeid(T) == typeid(SiStripApvGain))
99  label = "ApvTiming";
100 
101  if (typeid(T) == typeid(SiStripLatency))
102  label = "ApvLatency";
103 
104  if (!condObjBuilder->checkForCompatibility(ss_logdb, ss, label)) {
105  //string are equal, no need to do transfer
106  edm::LogInfo("SiStripPopPopConConfigDbObjHandler")
107  << "[isTransferNeeded] the selected conditions are already uploaded in the last iov ("
108  << this->tagInfo().lastInterval.since << ") open for the object " << this->logDBEntry().payloadClass
109  << " in the db " << this->logDBEntry().destinationDB << " parameters: " << ss_logdb.str()
110  << "\n NO TRANSFER NEEDED";
111  return false;
112  }
113 
114  this->m_userTextLog = ss.str();
115  edm::LogInfo("SiStripPopPopConConfigDbObjHandler")
116  << "[isTransferNeeded] the selected conditions will be uploaded: " << ss.str()
117  << "\n Going to Upload: " << ss.str() << "\n Last Upload: " << ss_logdb.str() << "\n Fine";
118 
119  return true;
120  }

References SiStripCondObjBuilderFromDb::checkForCompatibility(), popcon::SiStripPopConConfigDbObjHandler< T >::condObjBuilder, cond::LogDBEntry_t::destinationDB, label, cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< T >::logDBEntry(), popcon::PopConSourceHandler< T >::m_userTextLog, Skims_PA_cff::name, cond::LogDBEntry_t::payloadClass, cond::Iov_t::since, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, popcon::PopConSourceHandler< T >::tagInfo(), and cond::LogDBEntry_t::usertext.

Referenced by popcon::SiStripPopConConfigDbObjHandler< T >::getNewObjects().

◆ setForTransfer()

template<typename T >
void popcon::SiStripPopConConfigDbObjHandler< T >::setForTransfer ( )
inline

Definition at line 124 of file SiStripPopConConfigDbObjHandler.h.

124  {
125  edm::LogInfo("SiStripPopPopConConfigDbObjHandler")
126  << "[setForTransfer] " << m_name << " getting data to be transferred " << std::endl;
127 
128  T* obj = nullptr;
130 
131  edm::LogInfo("SiStripPopPopConConfigDbObjHandler")
132  << "[setForTransfer] " << m_name << " got data to be transferred from condObjBuilder " << std::endl;
133 
134  if (!this->tagInfo().size)
135  m_since = 1;
136  else if (m_debugMode)
137  m_since = this->tagInfo().lastInterval.since + 1;
138  edm::LogInfo("SiStripPopPopConConfigDbObjHandler") << "[setForTransfer] setting since = " << m_since << std::endl;
139 
140  if (obj != nullptr) {
141  edm::LogInfo("SiStripPopPopConConfigDbObjHandler") << "[setForTransfer] filling map m_to_transfer" << std::endl;
142  this->m_to_transfer.push_back(std::make_pair(obj, m_since));
143  } else {
144  edm::LogError("SiStripPopPopConConfigDbObjHandler")
145  << "[setForTransfer] " << m_name << " : NULL pointer of obj " << typeid(T).name()
146  << " reported by SiStripCondObjBuilderFromDb\n Transfer aborted" << std::endl;
147  }
148  }

References popcon::SiStripPopConConfigDbObjHandler< T >::condObjBuilder, SiStripCondObjBuilderFromDb::getValue(), cond::TagInfo_t::lastInterval, popcon::SiStripPopConConfigDbObjHandler< T >::m_debugMode, popcon::SiStripPopConConfigDbObjHandler< T >::m_name, popcon::SiStripPopConConfigDbObjHandler< T >::m_since, popcon::PopConSourceHandler< T >::m_to_transfer, Skims_PA_cff::name, getGTfromDQMFile::obj, cond::Iov_t::since, findQualityFiles::size, and popcon::PopConSourceHandler< T >::tagInfo().

Referenced by popcon::SiStripPopConConfigDbObjHandler< T >::getNewObjects().

Member Data Documentation

◆ condObjBuilder

template<typename T >
edm::Service<SiStripCondObjBuilderFromDb> popcon::SiStripPopConConfigDbObjHandler< T >::condObjBuilder
private

◆ m_debugMode

template<typename T >
bool popcon::SiStripPopConConfigDbObjHandler< T >::m_debugMode
private

◆ m_name

template<typename T >
std::string popcon::SiStripPopConConfigDbObjHandler< T >::m_name
private

◆ m_since

template<typename T >
unsigned long long popcon::SiStripPopConConfigDbObjHandler< T >::m_since
private
popcon::SiStripPopConConfigDbObjHandler::isTransferNeeded
bool isTransferNeeded()
Definition: SiStripPopConConfigDbObjHandler.h:83
popcon::PopConSourceHandler::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
SiStripCondObjBuilderFromDb::getValue
void getValue(SiStripFedCabling *&val)
Definition: SiStripCondObjBuilderFromDb.h:121
SiStripCondObjBuilderFromDb::checkForCompatibility
bool checkForCompatibility(std::stringstream &input, std::stringstream &output, std::string &label)
Definition: SiStripCondObjBuilderFromDb.cc:162
edm::LogInfo
Definition: MessageLogger.h:254
SiStripFedCabling
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses,...
Definition: SiStripFedCabling.h:25
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
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
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
cond::LogDBEntry_t::iovtag
std::string iovtag
Definition: Types.h:91
cond::LogDBEntry_t::destinationDB
std::string destinationDB
Definition: Types.h:88
popcon::SiStripPopConConfigDbObjHandler::condObjBuilder
edm::Service< SiStripCondObjBuilderFromDb > condObjBuilder
Definition: SiStripPopConConfigDbObjHandler.h:155
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition: Types.h:73
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
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
popcon::SiStripPopConConfigDbObjHandler::m_debugMode
bool m_debugMode
Definition: SiStripPopConConfigDbObjHandler.h:154
popcon::SiStripPopConConfigDbObjHandler::m_since
unsigned long long m_since
Definition: SiStripPopConConfigDbObjHandler.h:153
SiStripLatency
Definition: SiStripLatency.h:59
SiStripApvGain
Definition: SiStripApvGain.h:25
cond::LogDBEntry_t::payloadIdx
unsigned int payloadIdx
Definition: Types.h:93
popcon::PopConSourceHandler::m_userTextLog
std::string m_userTextLog
Definition: PopConSourceHandler.h:168
popcon::SiStripPopConConfigDbObjHandler::setForTransfer
void setForTransfer()
Definition: SiStripPopConConfigDbObjHandler.h:124
popcon::SiStripPopConConfigDbObjHandler::m_name
std::string m_name
Definition: SiStripPopConConfigDbObjHandler.h:152
label
const char * label
Definition: PFTauDecayModeTools.cc:11
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