CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
cond::service::PoolDBOutputService Class Reference

#include <PoolDBOutputService.h>

Classes

struct  Record
 

Public Member Functions

template<typename T >
void appendSinceTime (T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
 
void appendSinceTime (const std::string &payloadId, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
 
cond::Time_t beginOfTime () const
 
void closeIOV (Time_t lastTill, const std::string &recordName, bool withlogging=false)
 
template<typename T >
void createNewIOV (T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
 
void createNewIOV (const std::string &firstPayloadId, const std::string payloadType, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
 
void createNewIOV (const std::string &firstPayloadId, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
 
cond::Time_t currentTime () const
 
cond::Time_t endOfTime () const
 
void forceInit ()
 
bool isNewTagRequest (const std::string &recordName)
 
 PoolDBOutputService (const edm::ParameterSet &iConfig, edm::ActivityRegistry &iAR)
 
void postEndJob ()
 
cond::persistency::Session session () const
 
void setLogHeaderForRecord (const std::string &recordName, const std::string &provenance, const std::string &usertext)
 
std::string tag (const std::string &recordName)
 
void tagInfo (const std::string &recordName, cond::TagInfo_t &result)
 
template<typename T >
void writeOne (T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
 
virtual ~PoolDBOutputService ()
 

Private Member Functions

void connect ()
 
void disconnect ()
 
void fillRecord (edm::ParameterSet &pset)
 
void initDB (bool dummy=false)
 
RecordlookUpRecord (const std::string &recordName)
 
cond::UserLogInfolookUpUserLogInfo (const std::string &recordName)
 
void postModuleEvent (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void preEventProcessing (edm::StreamContext const &)
 
void preGlobalBeginLumi (edm::GlobalContext const &)
 
void preGlobalBeginRun (edm::GlobalContext const &)
 
void preModuleEvent (edm::StreamContext const &, edm::ModuleCallingContext const &)
 

Private Attributes

std::map< std::string, Recordm_callbacks
 
bool m_closeIOV
 
std::vector< cond::Time_tm_currentTimes
 
bool m_dbstarted
 
std::map< std::string, cond::UserLogInfom_logheaders
 
std::recursive_mutex m_mutex
 
std::vector< std::pair< std::string, std::string > > m_newtags
 
cond::persistency::Session m_session
 
cond::TimeType m_timetype
 
std::string m_timetypestr
 

Detailed Description

Definition at line 36 of file PoolDBOutputService.h.

Constructor & Destructor Documentation

PoolDBOutputService::PoolDBOutputService ( const edm::ParameterSet iConfig,
edm::ActivityRegistry iAR 
)

Definition at line 39 of file PoolDBOutputService.cc.

References fillRecord(), edm::ParameterSet::getParameter(), cond::lumiid, m_callbacks, m_closeIOV, m_currentTimes, m_dbstarted, m_logheaders, m_session, m_timetype, m_timetypestr, edm::service::SystemBounds::maxNumberOfStreams(), postEndJob(), postModuleEvent(), preEventProcessing(), preGlobalBeginLumi(), preGlobalBeginRun(), preModuleEvent(), cond::runnumber, s_streamIndex, cond::persistency::ConnectionPool::setParameters(), AlCaHLTBitMon_QueryRunRegistry::string, cond::timestamp, cond::time::timeTypeFromName(), and DBConfiguration_cff::toPut.

39  :
40  m_timetypestr(""),
42  m_session(),
43  m_dbstarted( false ),
44  m_callbacks(),
45  m_closeIOV(false),
46  m_logheaders()
47 {
48  m_closeIOV=iConfig.getUntrackedParameter<bool>("closeIOV",m_closeIOV);
49 
50  m_timetypestr=iConfig.getUntrackedParameter< std::string >("timetype","runnumber");
51  m_timetype = cond::time::timeTypeFromName( m_timetypestr );
52 
53  edm::ParameterSet connectionPset = iConfig.getParameter<edm::ParameterSet>("DBParameters");
55  connection.setParameters( connectionPset );
56  connection.configure();
57  std::string connectionString = iConfig.getParameter<std::string>("connect");
58  m_session = connection.createSession( connectionString, true );
59 
60  typedef std::vector< edm::ParameterSet > Parameters;
61  Parameters toPut=iConfig.getParameter<Parameters>("toPut");
62  for(Parameters::iterator itToPut = toPut.begin(); itToPut != toPut.end(); ++itToPut)
63  fillRecord( *itToPut);
64 
65 
67  iAR.watchPreallocate([this](edm::service::SystemBounds const& iBounds) {
68  m_currentTimes.resize(iBounds.maxNumberOfStreams());
69  });
70  if( m_timetype == cond::timestamp ){ //timestamp
74  } else if( m_timetype == cond::runnumber ){//runnumber
75  //NOTE: this assumes only one run is being processed at a time.
76  // This is true for 7_1_X but plan are to allow multiple in flight at a time
77  s_streamIndex = 0;
79  } else if( m_timetype == cond::lumiid ){
80  //NOTE: this assumes only one lumi is being processed at a time.
81  // This is true for 7_1_X but plan are to allow multiple in flight at a time
82  s_streamIndex = 0;
84  }
85 }
static thread_local int s_streamIndex
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void watchPreEvent(PreEvent::slot_type const &iSlot)
void watchPreallocate(Preallocate::slot_type const &iSlot)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void preEventProcessing(edm::StreamContext const &)
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
void fillRecord(edm::ParameterSet &pset)
std::map< std::string, cond::UserLogInfo > m_logheaders
void watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
std::vector< cond::Time_t > m_currentTimes
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
void preGlobalBeginLumi(edm::GlobalContext const &)
void setParameters(const edm::ParameterSet &connectionPset)
unsigned int maxNumberOfStreams() const
Definition: SystemBounds.h:43
vector< ParameterSet > Parameters
TimeType timeTypeFromName(const std::string &name)
Definition: Time.cc:24
cond::persistency::Session m_session
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
void preGlobalBeginRun(edm::GlobalContext const &)
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::map< std::string, Record > m_callbacks
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
PoolDBOutputService::~PoolDBOutputService ( )
virtual

Member Function Documentation

template<typename T >
void cond::service::PoolDBOutputService::appendSinceTime ( T payloadObj,
cond::Time_t  sinceTime,
const std::string &  recordName,
bool  withlogging = false 
)
inline

Definition at line 104 of file PoolDBOutputService.h.

References align_cfg::recordName, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, and cond::persistency::throwException().

Referenced by SiStripBadChannelBuilder::algoAnalyze(), DBWriter::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripApvGainBuilder::analyze(), WriteEcalMiscalibConstants::analyze(), WriteEcalMiscalibConstantsMC::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), EcalTestDevDB::analyze(), BTagCalibrationDbCreator::beginJob(), PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::beginJob(), QGLikelihoodSystematicsDBWriter::beginJob(), JetCorrectorDBWriter::beginJob(), QGLikelihoodDBWriter::beginJob(), SiStripFedCablingBuilder::beginRun(), CocoaDBMgr::DumpCocoaResults(), BeamSpotWrite2DB::endJob(), CentralityTableProducer::endJob(), StoreESCondition::endJob(), StoreEcalCondition::endJob(), SiStripFedCablingManipulator::endRun(), HLTPrescaleRecorder::endRun(), l1t::DataWriterExt::updateIOV(), l1t::DataWriter::updateIOV(), CaloGeometryDBWriter::write(), BeamFitter::write2DB(), AlCaRecoTriggerBitsRcdUpdate::writeBitsToDB(), and CaloGeometryDBWriter::writeIndexed().

107  {
108  if( !payloadObj ) throwException( "Provided payload pointer is invalid.","PoolDBOutputService::appendSinceTime");
109  appendSinceTime( m_session.storePayload( *payloadObj ),
110  sinceTime,
111  recordName,
112  withlogging);
113  }
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:21
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
cond::persistency::Session m_session
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
Definition: Session.h:189
void PoolDBOutputService::appendSinceTime ( const std::string &  payloadId,
cond::Time_t  sinceTime,
const std::string &  recordName,
bool  withlogging = false 
)

Definition at line 247 of file PoolDBOutputService.cc.

References a, cond::persistency::Session::editIov(), idDealer::editor, cppFunctionSkipper::exception, cond::persistency::IOVEditor::flush(), cond::persistency::IOVEditor::insert(), CommonMethods::lock(), lookUpRecord(), lookUpUserLogInfo(), m_mutex, m_session, SiPixelClusterizer_cfi::payloadType, cond::persistency::IOVEditor::payloadType(), AlCaHLTBitMon_QueryRunRegistry::string, cond::throwException(), cond::persistency::Session::transaction(), and cond::UserLogInfo::usertext.

250  {
251  std::lock_guard<std::recursive_mutex> lock(m_mutex);
253  Record& myrecord=this->lookUpRecord(recordName);
254  if( myrecord.m_isNewTag ) {
255  cond::throwException(std::string("Cannot append to non-existing tag ") + myrecord.m_tag,
256  "PoolDBOutputService::appendSinceTime");
257  }
259  try{
261  payloadType = editor.payloadType();
262  editor.insert( time, payloadId );
264  editor.flush( a.usertext );
265 
266  }catch(const std::exception& er){
268  "PoolDBOutputService::appendSinceTime");
269  }
270  scope.close();
271 }
Transaction & transaction()
Definition: Session.cc:66
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:21
Record & lookUpRecord(const std::string &recordName)
cond::persistency::Session m_session
IOVEditor editIov(const std::string &tag)
Definition: Session.cc:148
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
Definition: IOVEditor.cc:152
std::string usertext
Definition: Types.h:24
double a
Definition: hdecay.h:121
std::string payloadType() const
Definition: IOVEditor.cc:96
cond::UserLogInfo & lookUpUserLogInfo(const std::string &recordName)
cond::Time_t PoolDBOutputService::beginOfTime ( ) const

Definition at line 175 of file PoolDBOutputService.cc.

References cond::TimeTypeSpecs::beginValue, m_timetype, and cond::timeTypeSpecs.

Referenced by SiStripBadChannelBuilder::algoAnalyze(), L1TMuonOverlapParamsWriter::analyze(), DBWriter::analyze(), L1KeyListWriter::analyze(), L1KeyWriter::analyze(), L1TCaloParamsUpdater::analyze(), L1TCaloStage2ParamsWriter::analyze(), L1TGlobalPrescalesVetosWriter::analyze(), L1TMuonBarrelParamsWriter::analyze(), L1TMuonGlobalParamsWriter::analyze(), EcalPFRecHitThresholdsMaker::analyze(), SiStripDetVOffFakeBuilder::analyze(), L1MenuWriter::analyze(), L1TMuonEndCapForestWriter::analyze(), L1TMuonEndCapParamsWriter::analyze(), SiStripNoisesBuilder::analyze(), SiStripApvGainBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), GBRForestWriter::analyze(), SurveyInputTrackerFromDB::analyze(), WriteEcalMiscalibConstantsMC::analyze(), WriteEcalMiscalibConstants::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), TrackerSystematicMisalignments::analyze(), SiStripApvGainBuilderFromTag::analyze(), EcalTestDevDB::analyze(), TrackerGeometryCompare::analyze(), BTagCalibrationDbCreator::beginJob(), PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob(), JetResolutionDBWriter::beginJob(), QGLikelihoodSystematicsDBWriter::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob(), JetCorrectorDBWriter::beginJob(), XMLGeometryBuilder::beginJob(), QGLikelihoodDBWriter::beginJob(), SiStripFedCablingBuilder::beginRun(), HcalParametersDBBuilder::beginRun(), PTrackerParametersDBBuilder::beginRun(), GEMRecoIdealDBLoader::beginRun(), DTRecoIdealDBLoader::beginRun(), GeometricDetLoader::beginRun(), ME0RecoIdealDBLoader::beginRun(), CSCRecoIdealDBLoader::beginRun(), PHGCalParametersDBBuilder::beginRun(), RPCRecoIdealDBLoader::beginRun(), PGeometricDetBuilder::beginRun(), PGeometricDetExtraBuilder::beginRun(), EcalTPGDBCopy::copyToDB(), EcalDBCopy::copyToDB(), ESDBCopy::copyToDB(), CocoaDBMgr::DumpCocoaResults(), PhysicsTools::MVATrainerSave::endJob(), PhysicsTools::MVATrainerContainerSave::endJob(), BeamSpotWrite2DB::endJob(), CentralityTableProducer::endJob(), StoreESCondition::endJob(), BeamProfile2DB::endJob(), StoreEcalCondition::endJob(), SiStripFedCablingManipulator::endRun(), DummyCondDBWriter< TObject, TObjectO, TRecord >::endRun(), HLTPrescaleRecorder::endRun(), LaserAlignment::endRunProduce(), MisalignedMuonESProducer::saveToDB(), ConditionDBWriter< SiStripApvGain >::storeOnDb(), l1t::DataWriter::updateIOV(), l1t::DataWriterExt::updateIOV(), CaloGeometryDBWriter::write(), BeamFitter::write2DB(), CaloGeometryDBWriter::writeIndexed(), and DTCalibDBUtils::writeToDB().

175  {
177 }
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
Time_t beginValue
Definition: Time.h:45
void PoolDBOutputService::closeIOV ( Time_t  lastTill,
const std::string &  recordName,
bool  withlogging = false 
)

Definition at line 299 of file PoolDBOutputService.cc.

References cond::persistency::Session::editIov(), idDealer::editor, cond::persistency::IOVEditor::flush(), CommonMethods::lock(), lookUpRecord(), cond::service::PoolDBOutputService::Record::m_isNewTag, m_mutex, m_session, cond::service::PoolDBOutputService::Record::m_tag, cond::persistency::IOVEditor::setEndOfValidity(), AlCaHLTBitMon_QueryRunRegistry::string, cond::throwException(), and cond::persistency::Session::transaction().

Referenced by popcon::PopCon::finalize().

300  {
301  std::lock_guard<std::recursive_mutex> lock(m_mutex);
302  // not fully working.. not be used for now...
303  Record & myrecord = lookUpRecord(recordName);
305 
306  if( myrecord.m_isNewTag ) {
307  cond::throwException(std::string("Cannot close non-existing tag ") + myrecord.m_tag,
308  "PoolDBOutputService::closeIOV");
309  }
311  editor.setEndOfValidity( lastTill );
312  editor.flush("Tag closed.");
313  scope.close();
314 }
Transaction & transaction()
Definition: Session.cc:66
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:21
Record & lookUpRecord(const std::string &recordName)
cond::persistency::Session m_session
IOVEditor editIov(const std::string &tag)
Definition: Session.cc:148
void setEndOfValidity(cond::Time_t validity)
Definition: IOVEditor.cc:116
void cond::service::PoolDBOutputService::connect ( )
private

Referenced by Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea::__init__(), Vispa.Views.PropertyView.BooleanProperty::__init__(), Vispa.Gui.FindDialog.FindDialog::_addScript(), Vispa.Gui.FindDialog.FindDialog::_addStringProperty(), Vispa.Main.Application.Application::_connectSignals(), Vispa.Plugins.ConfigEditor.CodeTableView.CodeTableView::_createItem(), Vispa.Gui.BoxContentDialog.BoxContentDialog::addButton(), Vispa.Gui.ToolBoxContainer.ToolBoxContainer::addWidget(), Vispa.Views.PropertyView.PropertyView::append(), Vispa.Views.PropertyView.PropertyView::appendAddRow(), Vispa.Main.Application.Application::createAction(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createButton(), Vispa.Views.LineDecayView.LineDecayView::createLineDecayContainer(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createLineEdit(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createTextEdit(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filterDialog(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Gui.PortWidget.PortWidget::mouseMoveEvent(), Vispa.Views.PropertyView.BooleanProperty::setChecked(), Vispa.Main.SplitterTab.SplitterTab::setController(), Vispa.Plugins.Browser.BrowserTab.BrowserTab::setController(), Vispa.Views.PropertyView.BooleanProperty::setReadOnly(), Vispa.Views.PropertyView.DropDownProperty::setReadOnly(), Vispa.Views.PropertyView.TextEditWithButtonProperty::setReadOnly(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setTab(), Vispa.Views.PropertyView.IntegerProperty::setValue(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView(), o2o_db_cfgmap.DbManagerDAQ::update_hashmap(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController::updateViewMenu(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::updateViewMenu().

template<typename T >
void cond::service::PoolDBOutputService::createNewIOV ( T firstPayloadObj,
cond::Time_t  firstSinceTime,
cond::Time_t  firstTillTime,
const std::string &  recordName,
bool  withlogging = false 
)
inline

Definition at line 73 of file PoolDBOutputService.h.

References CommonMethods::lock(), SiPixelClusterizer_cfi::payloadType, align_cfg::recordName, AlCaHLTBitMon_QueryRunRegistry::string, and cond::persistency::throwException().

Referenced by SiStripBadChannelBuilder::algoAnalyze(), DBWriter::analyze(), EcalPFRecHitThresholdsMaker::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripApvGainBuilder::analyze(), WriteEcalMiscalibConstantsMC::analyze(), WriteEcalMiscalibConstants::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), EcalTestDevDB::analyze(), BTagCalibrationDbCreator::beginJob(), PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::beginJob(), QGLikelihoodSystematicsDBWriter::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob(), JetCorrectorDBWriter::beginJob(), XMLGeometryBuilder::beginJob(), QGLikelihoodDBWriter::beginJob(), SiStripFedCablingBuilder::beginRun(), HcalParametersDBBuilder::beginRun(), PTrackerParametersDBBuilder::beginRun(), GEMRecoIdealDBLoader::beginRun(), DTRecoIdealDBLoader::beginRun(), ME0RecoIdealDBLoader::beginRun(), GeometricDetLoader::beginRun(), CSCRecoIdealDBLoader::beginRun(), RPCRecoIdealDBLoader::beginRun(), PGeometricDetBuilder::beginRun(), PHGCalParametersDBBuilder::beginRun(), PGeometricDetExtraBuilder::beginRun(), EcalTPGDBCopy::copyToDB(), EcalDBCopy::copyToDB(), ESDBCopy::copyToDB(), CocoaDBMgr::DumpCocoaResults(), PhysicsTools::MVATrainerSave::endJob(), PhysicsTools::MVATrainerContainerSave::endJob(), BeamSpotWrite2DB::endJob(), CentralityTableProducer::endJob(), StoreESCondition::endJob(), BeamProfile2DB::endJob(), StoreEcalCondition::endJob(), SiStripFedCablingManipulator::endRun(), HLTPrescaleRecorder::endRun(), l1t::DataWriterExt::updateIOV(), l1t::DataWriter::updateIOV(), CaloGeometryDBWriter::write(), BeamFitter::write2DB(), AlCaRecoTriggerBitsRcdUpdate::writeBitsToDB(), and CaloGeometryDBWriter::writeIndexed().

77  {
78  if( !firstPayloadObj ) throwException( "Provided payload pointer is invalid.","PoolDBOutputService::createNewIOV");
79  std::lock_guard<std::recursive_mutex> lock(m_mutex);
80  if (!m_dbstarted) this->initDB();
81  createNewIOV( m_session.storePayload( *firstPayloadObj ),
82  cond::demangledName(typeid(T)),
83  firstSinceTime,
84  firstTillTime,
85  recordName,
86  withlogging);
87  }
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:21
cond::persistency::Session m_session
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
Definition: Session.h:189
long double T
void PoolDBOutputService::createNewIOV ( const std::string &  firstPayloadId,
const std::string  payloadType,
cond::Time_t  firstSinceTime,
cond::Time_t  firstTillTime,
const std::string &  recordName,
bool  withlogging = false 
)

Definition at line 186 of file PoolDBOutputService.cc.

References a, cond::persistency::Session::createIov(), idDealer::editor, cppFunctionSkipper::exception, cond::persistency::IOVEditor::flush(), cond::persistency::IOVEditor::insert(), CommonMethods::lock(), lookUpRecord(), lookUpUserLogInfo(), m_mutex, m_session, cond::persistency::IOVEditor::setDescription(), AlCaHLTBitMon_QueryRunRegistry::string, cond::SYNCH_ANY, cond::throwException(), cond::persistency::Session::transaction(), and cond::UserLogInfo::usertext.

191  {
192  std::lock_guard<std::recursive_mutex> lock(m_mutex);
193 
195  Record& myrecord=this->lookUpRecord(recordName);
196  if(!myrecord.m_isNewTag) {
197  cond::throwException( myrecord.m_tag + " is not a new tag", "PoolDBOutputService::createNewIOV");
198  }
199  std::string iovToken;
200 
201  try{
202  // FIX ME: synchronization type and description have to be passed as the other parameters?
203  cond::persistency::IOVEditor editor = m_session.createIov( payloadType, myrecord.m_tag, myrecord.m_timetype, cond::SYNCH_ANY );
204  editor.setDescription( "New Tag" );
205  editor.insert( firstSinceTime, firstPayloadId );
207  editor.flush( a.usertext );
208  myrecord.m_isNewTag=false;
209  }catch(const std::exception& er){
210  cond::throwException(std::string(er.what()) + " from PoolDBOutputService::createNewIOV ",
211  "PoolDBOutputService::createNewIOV");
212  }
213  scope.close();
214 }
IOVEditor createIov(const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::SYNCH_ANY)
Definition: Session.h:185
void setDescription(const std::string &description)
Definition: IOVEditor.cc:128
Transaction & transaction()
Definition: Session.cc:66
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:21
Record & lookUpRecord(const std::string &recordName)
cond::persistency::Session m_session
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
Definition: IOVEditor.cc:152
std::string usertext
Definition: Types.h:24
double a
Definition: hdecay.h:121
cond::UserLogInfo & lookUpUserLogInfo(const std::string &recordName)
void PoolDBOutputService::createNewIOV ( const std::string &  firstPayloadId,
cond::Time_t  firstSinceTime,
cond::Time_t  firstTillTime,
const std::string &  recordName,
bool  withlogging = false 
)

Definition at line 217 of file PoolDBOutputService.cc.

References a, cond::persistency::Session::createIovForPayload(), idDealer::editor, cppFunctionSkipper::exception, cond::persistency::IOVEditor::flush(), cond::persistency::IOVEditor::insert(), CommonMethods::lock(), lookUpRecord(), lookUpUserLogInfo(), m_mutex, m_session, SiPixelClusterizer_cfi::payloadType, cond::persistency::IOVEditor::payloadType(), cond::persistency::IOVEditor::setDescription(), AlCaHLTBitMon_QueryRunRegistry::string, cond::SYNCH_ANY, cond::throwException(), cond::persistency::Session::transaction(), and cond::UserLogInfo::usertext.

221  {
222  std::lock_guard<std::recursive_mutex> lock(m_mutex);
224  Record& myrecord=this->lookUpRecord(recordName);
225  if(!myrecord.m_isNewTag) {
226  cond::throwException( myrecord.m_tag + " is not a new tag", "PoolDBOutputService::createNewIOV");
227  }
228  std::string iovToken;
230  try{
231  // FIX ME: synchronization type and description have to be passed as the other parameters?
232  cond::persistency::IOVEditor editor = m_session.createIovForPayload( firstPayloadId, myrecord.m_tag, myrecord.m_timetype, cond::SYNCH_ANY );
233  editor.setDescription( "New Tag" );
234  payloadType = editor.payloadType();
235  editor.insert( firstSinceTime, firstPayloadId );
237  editor.flush( a.usertext );
238  myrecord.m_isNewTag=false;
239  }catch(const std::exception& er){
240  cond::throwException(std::string(er.what()) + " from PoolDBOutputService::createNewIOV ",
241  "PoolDBOutputService::createNewIOV");
242  }
243  scope.close();
244 }
void setDescription(const std::string &description)
Definition: IOVEditor.cc:128
Transaction & transaction()
Definition: Session.cc:66
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:21
Record & lookUpRecord(const std::string &recordName)
cond::persistency::Session m_session
void insert(cond::Time_t since, const cond::Hash &payloadHash, bool checkType=false)
Definition: IOVEditor.cc:152
std::string usertext
Definition: Types.h:24
double a
Definition: hdecay.h:121
IOVEditor createIovForPayload(const Hash &payloadHash, const std::string &tag, cond::TimeType timeType, cond::SynchronizationType synchronizationType=cond::SYNCH_ANY)
Definition: Session.cc:136
std::string payloadType() const
Definition: IOVEditor.cc:96
cond::UserLogInfo & lookUpUserLogInfo(const std::string &recordName)
cond::Time_t PoolDBOutputService::currentTime ( ) const

Definition at line 180 of file PoolDBOutputService.cc.

References m_currentTimes, and s_streamIndex.

Referenced by SiStripBadChannelBuilder::algoAnalyze(), L1MuonOverlapParamsDBProducer::analyze(), DBWriter::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripApvGainBuilder::analyze(), WriteEcalMiscalibConstantsMC::analyze(), BufferedBoostIODBWriter::analyze(), WriteEcalMiscalibConstants::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), FFTJetCorrectorDBWriter::analyze(), BoostIODBWriter< DataType >::analyze(), SiStripApvGainRescaler::analyze(), AlignPCLThresholdsWriter::analyze(), SiStripChannelGainFromDBMiscalibrator::analyze(), JetResolutionDBWriter::beginJob(), SiStripFedCablingBuilder::beginRun(), ECALpedestalPCLHarvester::dqmEndJob(), SiStripGainsPCLHarvester::dqmEndJob(), CocoaDBMgr::DumpCocoaResults(), BeamSpotWrite2DB::endJob(), SurveyDBUploader::endJob(), CentralityTableProducer::endJob(), Mixing2DB::endJob(), SiStripFedCablingManipulator::endRun(), DummyCondDBWriter< TObject, TObjectO, TRecord >::endRun(), popcon::L1RPCHwConfigSourceHandler::getNewObjects(), popcon::RPCEMapSourceHandler::getNewObjects(), MisalignedTrackerESProducer::produce(), MuonAlignment::saveCSCSurveyToDB(), MuonAlignment::saveCSCtoDB(), MuonAlignment::saveDTSurveyToDB(), MuonAlignment::saveDTtoDB(), TrackerAlignment::saveToDB(), ConditionDBWriter< SiStripApvGain >::setTime(), CaloGeometryDBWriter::write(), WriteESAlignments::write(), BeamFitter::write2DB(), GlobalTrackerMuonAlignment::writeGlPosRcd(), CaloGeometryDBWriter::writeIndexed(), and DTCalibDBUtils::writeToDB().

180  {
181  assert(-1 != s_streamIndex);
183 }
static thread_local int s_streamIndex
std::vector< cond::Time_t > m_currentTimes
void cond::service::PoolDBOutputService::disconnect ( )
private
cond::Time_t PoolDBOutputService::endOfTime ( ) const

Definition at line 170 of file PoolDBOutputService.cc.

References cond::TimeTypeSpecs::endValue, m_timetype, and cond::timeTypeSpecs.

Referenced by SiStripBadChannelBuilder::algoAnalyze(), EcalDQMStatusWriter::analyze(), DBWriter::analyze(), EcalPFRecHitThresholdsMaker::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripApvGainBuilder::analyze(), WriteEcalMiscalibConstantsMC::analyze(), WriteEcalMiscalibConstants::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), EcalTestDevDB::analyze(), BTagCalibrationDbCreator::beginJob(), PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob(), QGLikelihoodSystematicsDBWriter::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob(), JetCorrectorDBWriter::beginJob(), XMLGeometryBuilder::beginJob(), QGLikelihoodDBWriter::beginJob(), SiStripFedCablingBuilder::beginRun(), HcalParametersDBBuilder::beginRun(), PTrackerParametersDBBuilder::beginRun(), GEMRecoIdealDBLoader::beginRun(), DTRecoIdealDBLoader::beginRun(), ME0RecoIdealDBLoader::beginRun(), GeometricDetLoader::beginRun(), CSCRecoIdealDBLoader::beginRun(), RPCRecoIdealDBLoader::beginRun(), PGeometricDetExtraBuilder::beginRun(), PHGCalParametersDBBuilder::beginRun(), PGeometricDetBuilder::beginRun(), EcalTPGDBCopy::copyToDB(), ESDBCopy::copyToDB(), EcalDBCopy::copyToDB(), CocoaDBMgr::DumpCocoaResults(), PhysicsTools::MVATrainerSave::endJob(), PhysicsTools::MVATrainerContainerSave::endJob(), BeamSpotWrite2DB::endJob(), CentralityTableProducer::endJob(), StoreESCondition::endJob(), BeamProfile2DB::endJob(), StoreEcalCondition::endJob(), SiStripFedCablingManipulator::endRun(), HLTPrescaleRecorder::endRun(), l1t::DataWriter::updateIOV(), l1t::DataWriterExt::updateIOV(), CaloGeometryDBWriter::write(), BeamFitter::write2DB(), AlCaRecoTriggerBitsRcdUpdate::writeBitsToDB(), and CaloGeometryDBWriter::writeIndexed().

170  {
172 }
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
Time_t endValue
Definition: Time.h:46
void PoolDBOutputService::fillRecord ( edm::ParameterSet pset)
private

Definition at line 22 of file PoolDBOutputService.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_callbacks, cond::service::PoolDBOutputService::Record::m_closeIOV, m_closeIOV, cond::service::PoolDBOutputService::Record::m_idName, m_logheaders, cond::service::PoolDBOutputService::Record::m_tag, cond::service::PoolDBOutputService::Record::m_timetype, m_timetypestr, AlCaHLTBitMon_QueryRunRegistry::string, and cond::time::timeTypeFromName().

Referenced by PoolDBOutputService().

22  {
23  Record thisrecord;
24 
25  thisrecord.m_idName = pset.getParameter<std::string>("record");
26  thisrecord.m_tag = pset.getParameter<std::string>("tag");
27 
28  thisrecord.m_closeIOV =
29  pset.getUntrackedParameter<bool>("closeIOV", m_closeIOV);
30 
31  thisrecord.m_timetype = cond::time::timeTypeFromName( pset.getUntrackedParameter< std::string >("timetype",m_timetypestr) );
32 
33  m_callbacks.insert(std::make_pair(thisrecord.m_idName,thisrecord));
34 
35  cond::UserLogInfo userloginfo;
36  m_logheaders.insert(std::make_pair(thisrecord.m_idName,userloginfo));
37 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, cond::UserLogInfo > m_logheaders
TimeType timeTypeFromName(const std::string &name)
Definition: Time.cc:24
std::map< std::string, Record > m_callbacks
void PoolDBOutputService::forceInit ( )
void PoolDBOutputService::initDB ( bool  dummy = false)
private

Definition at line 104 of file PoolDBOutputService.cc.

References cond::persistency::Session::createDatabase(), cppFunctionSkipper::exception, cond::persistency::Session::existsDatabase(), CommonMethods::lock(), m_dbstarted, m_mutex, m_session, cond::persistency::TransactionScope::start(), AlCaHLTBitMon_QueryRunRegistry::string, cond::throwException(), and cond::persistency::Session::transaction().

Referenced by forceInit(), and lookUpRecord().

105 {
106  std::lock_guard<std::recursive_mutex> lock(m_mutex);
108  scope.start( false );
109  try{
111 
112  } catch( const std::exception& er ){
113  cond::throwException( std::string(er.what()),"PoolDBOutputService::initDB" );
114  }
115  scope.close();
116  m_dbstarted=true;
117 }
Transaction & transaction()
Definition: Session.cc:66
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:21
void start(bool readOnly=true)
Definition: Session.cc:248
cond::persistency::Session m_session
bool PoolDBOutputService::isNewTagRequest ( const std::string &  recordName)

Definition at line 98 of file PoolDBOutputService.cc.

References lookUpRecord(), and cond::service::PoolDBOutputService::Record::m_isNewTag.

Referenced by SiStripBadChannelBuilder::algoAnalyze(), DBWriter::analyze(), SiStripDetVOffFakeBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripApvGainBuilder::analyze(), WriteEcalMiscalibConstantsMC::analyze(), WriteEcalMiscalibConstants::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), EcalTestDevDB::analyze(), BTagCalibrationDbCreator::beginJob(), PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob(), JetResolutionDBWriter::beginJob(), QGLikelihoodSystematicsDBWriter::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload::beginJob(), PhysicsPerformanceDBWriterFromFile_WPandPayload_IOV::beginJob(), JetCorrectorDBWriter::beginJob(), XMLGeometryBuilder::beginJob(), QGLikelihoodDBWriter::beginJob(), HcalParametersDBBuilder::beginRun(), SiStripFedCablingBuilder::beginRun(), PTrackerParametersDBBuilder::beginRun(), GEMRecoIdealDBLoader::beginRun(), ME0RecoIdealDBLoader::beginRun(), GeometricDetLoader::beginRun(), DTRecoIdealDBLoader::beginRun(), CSCRecoIdealDBLoader::beginRun(), RPCRecoIdealDBLoader::beginRun(), PGeometricDetBuilder::beginRun(), PGeometricDetExtraBuilder::beginRun(), PHGCalParametersDBBuilder::beginRun(), CocoaDBMgr::DumpCocoaResults(), BeamSpotWrite2DB::endJob(), CentralityTableProducer::endJob(), StoreESCondition::endJob(), StoreEcalCondition::endJob(), SiStripFedCablingManipulator::endRun(), AlcaBeamSpotHarvester::endRun(), HLTPrescaleRecorder::endRun(), ConditionDBWriter< SiStripApvGain >::storeOnDb(), l1t::DataWriterExt::updateIOV(), l1t::DataWriter::updateIOV(), CaloGeometryDBWriter::write(), BeamFitter::write2DB(), AlCaRecoTriggerBitsRcdUpdate::writeBitsToDB(), CaloGeometryDBWriter::writeIndexed(), and DTCalibDBUtils::writeToDB().

98  {
99  Record& myrecord=this->lookUpRecord(recordName);
100  return myrecord.m_isNewTag;
101 }
Record & lookUpRecord(const std::string &recordName)
cond::service::PoolDBOutputService::Record & PoolDBOutputService::lookUpRecord ( const std::string &  recordName)
private

Definition at line 274 of file PoolDBOutputService.cc.

References cond::persistency::Session::existsIov(), initDB(), CommonMethods::lock(), m_callbacks, m_dbstarted, m_mutex, m_session, cond::throwException(), and cond::persistency::Session::transaction().

Referenced by appendSinceTime(), closeIOV(), createNewIOV(), isNewTagRequest(), tag(), and tagInfo().

274  {
275  std::lock_guard<std::recursive_mutex> lock(m_mutex);
276  if (!m_dbstarted) this->initDB();
278  std::map<std::string,Record>::iterator it=m_callbacks.find(recordName);
279  if(it==m_callbacks.end()) {
280  cond::throwException("The record \""+recordName +"\" has not been registered.","PoolDBOutputService::lookUpRecord");
281  }
282  if( !m_session.existsIov( it->second.m_tag) ){
283  it->second.m_isNewTag=true;
284  } else {
285  it->second.m_isNewTag=false;
286  }
287  scope.close();
288  return it->second;
289 }
Transaction & transaction()
Definition: Session.cc:66
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:21
cond::persistency::Session m_session
bool existsIov(const std::string &tag)
Definition: Session.cc:97
std::map< std::string, Record > m_callbacks
cond::UserLogInfo & PoolDBOutputService::lookUpUserLogInfo ( const std::string &  recordName)
private

Definition at line 292 of file PoolDBOutputService.cc.

References m_logheaders.

Referenced by appendSinceTime(), createNewIOV(), and setLogHeaderForRecord().

292  {
293  std::map<std::string,cond::UserLogInfo>::iterator it=m_logheaders.find(recordName);
294  if(it==m_logheaders.end()) throw cond::Exception("Log db was not set for record " + recordName + " from PoolDBOutputService::lookUpUserLogInfo");
295  return it->second;
296 }
Base exception class for the object to relational access.
Definition: Exception.h:11
std::map< std::string, cond::UserLogInfo > m_logheaders
void PoolDBOutputService::postEndJob ( )
void PoolDBOutputService::postModuleEvent ( edm::StreamContext const &  iContext,
edm::ModuleCallingContext const &   
)
private

Definition at line 140 of file PoolDBOutputService.cc.

References s_streamIndex.

Referenced by PoolDBOutputService().

140  {
141  s_streamIndex = -1;
142 }
static thread_local int s_streamIndex
void PoolDBOutputService::preEventProcessing ( edm::StreamContext const &  iContext)
private

Definition at line 129 of file PoolDBOutputService.cc.

References m_currentTimes, edm::StreamContext::streamID(), edm::StreamContext::timestamp(), edm::StreamID::value(), and edm::Timestamp::value().

Referenced by PoolDBOutputService().

130 {
131  m_currentTimes[iContext.streamID().value()] = iContext.timestamp().value();
132 }
std::vector< cond::Time_t > m_currentTimes
void PoolDBOutputService::preGlobalBeginLumi ( edm::GlobalContext const &  iContext)
private

Definition at line 152 of file PoolDBOutputService.cc.

References edm::GlobalContext::luminosityBlockID(), m_currentTimes, ntuplemaker::time, and edm::LuminosityBlockID::value().

Referenced by PoolDBOutputService().

152  {
153  for( auto& time : m_currentTimes) {
154  time = iContext.luminosityBlockID().value();
155  }
156 }
std::vector< cond::Time_t > m_currentTimes
void PoolDBOutputService::preGlobalBeginRun ( edm::GlobalContext const &  iContext)
private

Definition at line 145 of file PoolDBOutputService.cc.

References edm::GlobalContext::luminosityBlockID(), m_currentTimes, edm::LuminosityBlockID::run(), and ntuplemaker::time.

Referenced by PoolDBOutputService().

145  {
146  for( auto& time : m_currentTimes) {
147  time = iContext.luminosityBlockID().run();
148  }
149 }
std::vector< cond::Time_t > m_currentTimes
void PoolDBOutputService::preModuleEvent ( edm::StreamContext const &  iContext,
edm::ModuleCallingContext const &   
)
private

Definition at line 135 of file PoolDBOutputService.cc.

References s_streamIndex, edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by PoolDBOutputService().

135  {
136  s_streamIndex = iContext.streamID().value();
137 }
static thread_local int s_streamIndex
cond::persistency::Session PoolDBOutputService::session ( ) const
void PoolDBOutputService::setLogHeaderForRecord ( const std::string &  recordName,
const std::string &  provenance,
const std::string &  usertext 
)

Definition at line 318 of file PoolDBOutputService.cc.

References lookUpUserLogInfo(), cond::UserLogInfo::provenance, and cond::UserLogInfo::usertext.

Referenced by popcon::PopCon::write().

319 {
321  myloginfo.provenance=dataprovenance;
322  myloginfo.usertext=usertext;
323 }
std::string provenance
Definition: Types.h:23
std::string usertext
Definition: Types.h:24
cond::UserLogInfo & lookUpUserLogInfo(const std::string &recordName)
std::string PoolDBOutputService::tag ( const std::string &  recordName)
void PoolDBOutputService::tagInfo ( const std::string &  recordName,
cond::TagInfo_t result 
)

Definition at line 327 of file PoolDBOutputService.cc.

References cond::persistency::IOVProxy::getLast(), plotBeamSpotDB::last, cond::TagInfo_t::lastInterval, cond::TagInfo_t::lastPayloadToken, CommonMethods::lock(), lookUpRecord(), m_mutex, m_session, cond::service::PoolDBOutputService::Record::m_tag, cond::TagInfo_t::name, cond::Iov_t::payloadId, cond::persistency::Session::readIov(), record, cond::persistency::IOVProxy::sequenceSize(), cond::Iov_t::since, cond::TagInfo_t::size, and cond::Iov_t::till.

Referenced by l1t::DataWriter::lastPayloadToken(), l1t::DataWriterExt::lastPayloadToken(), l1t::DataWriterExt::updateIOV(), and l1t::DataWriter::updateIOV().

327  {
328  //
329  std::lock_guard<std::recursive_mutex> lock(m_mutex);
331  result.name=record.m_tag;
332  //use iovproxy to find out.
333  cond::persistency::IOVProxy iov = m_session.readIov( record.m_tag );
334  result.size=iov.sequenceSize();
335  if (result.size>0) {
336  cond::Iov_t last = iov.getLast();
337  result.lastInterval = cond::ValidityInterval( last.since, last.till );
338  result.lastPayloadToken = last.payloadId;
339  }
340 }
JetCorrectorParameters::Record record
Definition: classes.h:7
Time_t since
Definition: Types.h:55
size_t size
Definition: Types.h:77
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
std::string name
Definition: Types.h:73
cond::ValidityInterval lastInterval
Definition: Types.h:75
IOVProxy readIov(const std::string &tag, bool full=false)
Definition: Session.cc:81
Record & lookUpRecord(const std::string &recordName)
Hash payloadId
Definition: Types.h:57
cond::persistency::Session m_session
std::string lastPayloadToken
Definition: Types.h:76
Time_t till
Definition: Types.h:56
template<typename T >
void cond::service::PoolDBOutputService::writeOne ( T payload,
Time_t  time,
const std::string &  recordName,
bool  withlogging = false 
)
inline

Definition at line 54 of file PoolDBOutputService.h.

References CommonMethods::lock(), SiPixelClusterizer_cfi::payloadType, AlCaHLTBitMon_QueryRunRegistry::string, and cond::persistency::throwException().

Referenced by EcalDQMStatusWriter::analyze(), L1MuonOverlapParamsDBProducer::analyze(), GBRForestWriter::analyze(), SurveyInputTrackerFromDB::analyze(), BufferedBoostIODBWriter::analyze(), TrackerSystematicMisalignments::analyze(), WriteCTPPSPixelAnalysisMask::analyze(), WriteCTPPSPixelDAQMapping::analyze(), BoostIODBWriter< DataType >::analyze(), FFTJetCorrectorDBWriter::analyze(), SiStripApvGainRescaler::analyze(), AlignPCLThresholdsWriter::analyze(), TrackerGeometryCompare::analyze(), MCMisalignmentScaler::analyze(), SiStripChannelGainFromDBMiscalibrator::analyze(), JetResolutionDBWriter::beginJob(), DTUserKeyedConfigHandler::chkConfigList(), DTKeyedConfigHandler::chkConfigList(), EcalDBCopy::copyToDB(), ECALpedestalPCLHarvester::dqmEndJob(), SiStripGainsPCLHarvester::dqmEndJob(), SurveyDBUploader::endJob(), Mixing2DB::endJob(), DTKeyedConfigDBInit::endJob(), SiStripLorentzAngleCalibration::endOfJob(), SiPixelLorentzAngleCalibration::endOfJob(), SiStripBackplaneCalibration::endOfJob(), SiPixelStatusHarvester::endRun(), DummyCondDBWriter< TObject, TObjectO, TRecord >::endRun(), AlcaBeamSpotHarvester::endRun(), cond::BTransitionAnalyzer< EcalADCToGeVConstant, EcalADCToGeVConstantRcd >::endRun(), CorrPCCProducer::endRunProduce(), LaserAlignment::endRunProduce(), MisalignedTrackerESProducer::produce(), MuonAlignment::saveCSCSurveyToDB(), MuonAlignment::saveCSCtoDB(), MuonAlignment::saveDTSurveyToDB(), MuonAlignment::saveDTtoDB(), TrackerAlignment::saveToDB(), MisalignedMuonESProducer::saveToDB(), ConditionDBWriter< SiStripApvGain >::storeOnDb(), WriteESAlignments::write(), AlignmentProducerBase::writeDB(), GlobalTrackerMuonAlignment::writeGlPosRcd(), popcon::PopCon::writeOne(), DTCalibDBUtils::writeToDB(), and CreateIdealTkAlRecords::writeToDB().

54  {
55  if( !payload ) throwException( "Provided payload pointer is invalid.","PoolDBOutputService::writeOne");
56  std::lock_guard<std::recursive_mutex> lock(m_mutex);
57  if (!m_dbstarted) this->initDB();
58  Hash payloadId = m_session.storePayload( *payload );
59  std::string payloadType = cond::demangledName(typeid(T));
61  createNewIOV(payloadId, payloadType, time, endOfTime(), recordName, withlogging);
62  } else {
63  appendSinceTime(payloadId, time, recordName, withlogging);
64  }
65  }
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:21
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
std::string Hash
Definition: Types.h:45
cond::persistency::Session m_session
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
Definition: Session.h:189
long double T

Member Data Documentation

std::map<std::string, Record> cond::service::PoolDBOutputService::m_callbacks
private

Definition at line 203 of file PoolDBOutputService.h.

Referenced by fillRecord(), lookUpRecord(), and PoolDBOutputService().

bool cond::service::PoolDBOutputService::m_closeIOV
private

Definition at line 205 of file PoolDBOutputService.h.

Referenced by fillRecord(), and PoolDBOutputService().

std::vector<cond::Time_t> cond::service::PoolDBOutputService::m_currentTimes
private
bool cond::service::PoolDBOutputService::m_dbstarted
private
std::map<std::string, cond::UserLogInfo> cond::service::PoolDBOutputService::m_logheaders
private

Definition at line 206 of file PoolDBOutputService.h.

Referenced by fillRecord(), lookUpUserLogInfo(), and PoolDBOutputService().

std::recursive_mutex cond::service::PoolDBOutputService::m_mutex
private
std::vector< std::pair<std::string,std::string> > cond::service::PoolDBOutputService::m_newtags
private

Definition at line 204 of file PoolDBOutputService.h.

cond::persistency::Session cond::service::PoolDBOutputService::m_session
private
cond::TimeType cond::service::PoolDBOutputService::m_timetype
private

Definition at line 196 of file PoolDBOutputService.h.

Referenced by beginOfTime(), endOfTime(), and PoolDBOutputService().

std::string cond::service::PoolDBOutputService::m_timetypestr
private

Definition at line 197 of file PoolDBOutputService.h.

Referenced by fillRecord(), and PoolDBOutputService().