#include <SiStripPopConConfigDbObjHandler.h>
Public Member Functions | |
void | getNewObjects () |
std::string | id () const |
bool | isTransferNeeded () |
void | setForTransfer () |
SiStripPopConConfigDbObjHandler (const edm::ParameterSet &pset) | |
~SiStripPopConConfigDbObjHandler () | |
Private Attributes | |
edm::Service < SiStripCondObjBuilderFromDb > | condObjBuilder |
bool | m_debugMode |
std::string | m_name |
unsigned long long | m_since |
Definition at line 27 of file SiStripPopConConfigDbObjHandler.h.
popcon::SiStripPopConConfigDbObjHandler< T >::SiStripPopConConfigDbObjHandler | ( | const edm::ParameterSet & | pset | ) | [inline] |
Definition at line 32 of file SiStripPopConConfigDbObjHandler.h.
: m_name(pset.getUntrackedParameter<std::string>("name","SiStripPopPopConConfigDbObjHandler")), m_since(pset.getUntrackedParameter<uint32_t>("since",5)), m_debugMode(pset.getUntrackedParameter<bool>("debug",false)){};
popcon::SiStripPopConConfigDbObjHandler< T >::~SiStripPopConConfigDbObjHandler | ( | ) | [inline] |
Definition at line 39 of file SiStripPopConConfigDbObjHandler.h.
{};
void popcon::SiStripPopConConfigDbObjHandler< T >::getNewObjects | ( | ) | [inline, virtual] |
Implements popcon::PopConSourceHandler< T >.
Definition at line 43 of file SiStripPopConConfigDbObjHandler.h.
References cond::LogDBEntry::destinationDB, cond::LogDBEntry::execmessage, cond::LogDBEntry::exectime, cond::LogDBEntry::iovtag, cond::LogDBEntry::iovtimetype, popcon::SiStripPopConConfigDbObjHandler< T >::isTransferNeeded(), cond::TagInfo::lastInterval, cond::TagInfo::lastPayloadToken, popcon::PopConSourceHandler< T >::logDBEntry(), cond::LogDBEntry::logId, popcon::SiStripPopConConfigDbObjHandler< T >::m_debugMode, popcon::SiStripPopConConfigDbObjHandler< T >::m_name, cond::TagInfo::name, cond::LogDBEntry::payloadClass, cond::LogDBEntry::payloadIdx, cond::LogDBEntry::payloadToken, cond::LogDBEntry::provenance, popcon::SiStripPopConConfigDbObjHandler< T >::setForTransfer(), findQualityFiles::size, cond::TagInfo::size, popcon::PopConSourceHandler< T >::tagInfo(), cond::TagInfo::token, cond::LogDBEntry::usertext, and popcon::PopConSourceHandler< T >::userTextLog().
{ edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[getNewObjects] for PopCon application " << m_name; if (m_debugMode){ std::stringstream ss; ss << "\n\n------- " << m_name << " - > getNewObjects\n"; if (this->tagInfo().size){ //check whats already inside of database ss << "got offlineInfo"<< this->tagInfo().name << ", size " << this->tagInfo().size << " " << this->tagInfo().token << " , last object valid since " << this->tagInfo().lastInterval.first << " token " << this->tagInfo().lastPayloadToken << "\n\n UserText " << this->userTextLog() << "\n LogDBEntry \n" << this->logDBEntry().logId<< "\n" << this->logDBEntry().destinationDB<< "\n" << this->logDBEntry().provenance<< "\n" << this->logDBEntry().usertext<< "\n" << this->logDBEntry().iovtag<< "\n" << this->logDBEntry().iovtimetype<< "\n" << this->logDBEntry().payloadIdx<< "\n" << this->logDBEntry().payloadClass<< "\n" << this->logDBEntry().payloadToken<< "\n" << this->logDBEntry().exectime<< "\n" << this->logDBEntry().execmessage<< "\n" << "\n\n-- user text " << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_last_of("@")) ; } else { ss << " First object for this tag "; } edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << ss.str(); } if (isTransferNeeded()) setForTransfer(); edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[getNewObjects] for PopCon application " << m_name << " Done\n--------------\n"; }
std::string popcon::SiStripPopConConfigDbObjHandler< T >::id | ( | void | ) | const [inline, virtual] |
Implements popcon::PopConSourceHandler< T >.
Definition at line 84 of file SiStripPopConConfigDbObjHandler.h.
References popcon::SiStripPopConConfigDbObjHandler< T >::m_name.
{ return m_name;}
bool popcon::SiStripPopConConfigDbObjHandler< T >::isTransferNeeded | ( | ) | [inline] |
Definition at line 88 of file SiStripPopConConfigDbObjHandler.h.
References popcon::SiStripPopConConfigDbObjHandler< T >::condObjBuilder, cond::LogDBEntry::destinationDB, label, cond::TagInfo::lastInterval, popcon::PopConSourceHandler< T >::logDBEntry(), popcon::PopConSourceHandler< T >::m_userTextLog, mergeVDriftHistosByStation::name, cond::LogDBEntry::payloadClass, popcon::PopConSourceHandler< T >::tagInfo(), and cond::LogDBEntry::usertext.
Referenced by popcon::SiStripPopConConfigDbObjHandler< T >::getNewObjects().
{ edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[isTransferNeeded] checking for transfer: " << typeid(T).name() << std::endl; std::stringstream ss_logdb, ss; //get log information from previous upload if (this->logDBEntry().usertext!="") ss_logdb << this->logDBEntry().usertext.substr(this->logDBEntry().usertext.find_first_of("@")); else ss_logdb << ""; std::string label=""; if(typeid(T)==typeid(SiStripFedCabling)) label="Cabling"; if(typeid(T)==typeid(SiStripApvGain)) label="ApvTiming"; if(typeid(T)==typeid(SiStripLatency)) label="ApvLatency"; if(!condObjBuilder->checkForCompatibility(ss_logdb,ss,label)){ //string are equal, no need to do transfer edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[isTransferNeeded] the selected conditions are already uploaded in the last iov (" << this->tagInfo().lastInterval.first << ") open for the object " << this->logDBEntry().payloadClass << " in the db " << this->logDBEntry().destinationDB << " parameters: " << ss_logdb.str() << "\n NO TRANSFER NEEDED"; return false; } this->m_userTextLog = ss.str(); edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[isTransferNeeded] the selected conditions will be uploaded: " << ss.str() << "\n Going to Upload: "<< ss.str() << "\n Last Upload: " << ss_logdb.str() << "\n Fine"; return true; }
void popcon::SiStripPopConConfigDbObjHandler< T >::setForTransfer | ( | ) | [inline] |
Definition at line 131 of file SiStripPopConConfigDbObjHandler.h.
References popcon::SiStripPopConConfigDbObjHandler< T >::condObjBuilder, cond::TagInfo::lastInterval, popcon::SiStripPopConConfigDbObjHandler< T >::m_debugMode, popcon::SiStripPopConConfigDbObjHandler< T >::m_name, popcon::SiStripPopConConfigDbObjHandler< T >::m_since, popcon::PopConSourceHandler< T >::m_to_transfer, mergeVDriftHistosByStation::name, VarParsing::obj, findQualityFiles::size, and popcon::PopConSourceHandler< T >::tagInfo().
Referenced by popcon::SiStripPopConConfigDbObjHandler< T >::getNewObjects().
{ edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[setForTransfer] " << m_name << " getting data to be transferred " << std::endl; T *obj=0; condObjBuilder->getValue(obj); edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") << "[setForTransfer] " << m_name << " got data to be transferred from condObjBuilder " << std::endl; if(!this->tagInfo().size) m_since=1; else if (m_debugMode) m_since=this->tagInfo().lastInterval.first+1; edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") <<"[setForTransfer] setting since = "<< m_since <<std::endl; if (obj!=0){ edm::LogInfo ("SiStripPopPopConConfigDbObjHandler") <<"[setForTransfer] filling map m_to_transfer" <<std::endl; this->m_to_transfer.push_back(std::make_pair(obj,m_since)); }else{ edm::LogError ("SiStripPopPopConConfigDbObjHandler") <<"[setForTransfer] " << m_name << " : NULL pointer of obj " << typeid(T).name() << " reported by SiStripCondObjBuilderFromDb\n Transfer aborted"<<std::endl; } }
edm::Service<SiStripCondObjBuilderFromDb> popcon::SiStripPopConConfigDbObjHandler< T >::condObjBuilder [private] |
Definition at line 160 of file SiStripPopConConfigDbObjHandler.h.
Referenced by popcon::SiStripPopConConfigDbObjHandler< T >::isTransferNeeded(), and popcon::SiStripPopConConfigDbObjHandler< T >::setForTransfer().
bool popcon::SiStripPopConConfigDbObjHandler< T >::m_debugMode [private] |
Definition at line 159 of file SiStripPopConConfigDbObjHandler.h.
Referenced by popcon::SiStripPopConConfigDbObjHandler< T >::getNewObjects(), and popcon::SiStripPopConConfigDbObjHandler< T >::setForTransfer().
std::string popcon::SiStripPopConConfigDbObjHandler< T >::m_name [private] |
Definition at line 157 of file SiStripPopConConfigDbObjHandler.h.
Referenced by popcon::SiStripPopConConfigDbObjHandler< T >::getNewObjects(), popcon::SiStripPopConConfigDbObjHandler< T >::id(), and popcon::SiStripPopConConfigDbObjHandler< T >::setForTransfer().
unsigned long long popcon::SiStripPopConConfigDbObjHandler< T >::m_since [private] |
Definition at line 158 of file SiStripPopConConfigDbObjHandler.h.
Referenced by popcon::SiStripPopConConfigDbObjHandler< T >::setForTransfer().