CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
EcalCondDBWriter Class Reference

#include <EcalCondDBWriter.h>

Inheritance diagram for EcalCondDBWriter:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EcalCondDBWriter (edm::ParameterSet const &)
 
 ~EcalCondDBWriter () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

enum  Tasks {
  Integrity = 0, Cosmic = 1, Laser = 2, Pedestal = 3,
  Presample = 4, TestPulse = 5, BeamCalo = 6, BeamHodo = 7,
  TriggerPrimitives = 8, Cluster = 9, Timing = 10, Led = 11,
  RawData = 12, Occupancy = 13, nTasks = 14
}
 

Private Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 

Private Attributes

EcalCondDBInterfacedb_
 
bool executed_
 
std::vector< std::string > inputRootFiles_
 
std::string location_
 
std::string monRunGeneralTag_
 
std::string runGeneralTag_
 
int runNumber_
 
std::string runType_
 
ecaldqm::SummaryWriter summaryWriter_
 
int verbosity_
 
ecaldqm::DBWriterWorkerworkers_ [nTasks]
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 10 of file EcalCondDBWriter.h.

Member Enumeration Documentation

◆ Tasks

Enumerator
Integrity 
Cosmic 
Laser 
Pedestal 
Presample 
TestPulse 
BeamCalo 
BeamHodo 
TriggerPrimitives 
Cluster 
Timing 
Led 
RawData 
Occupancy 
nTasks 

Definition at line 20 of file EcalCondDBWriter.h.

Constructor & Destructor Documentation

◆ EcalCondDBWriter()

EcalCondDBWriter::EcalCondDBWriter ( edm::ParameterSet const &  _ps)

Definition at line 21 of file EcalCondDBWriter.cc.

References BeamCalo, BeamHodo, Cluster, Cosmic, dqmiodatasetharvest::db, db_, EcalCondDBWriter_cfi::DBName, L1TBPTX_cfi::dqmStore, Exception, MillePedeFileConverter_cfg::fileName, edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), EcalCondDBWriter_cfi::hostName, EcalCondDBWriter_cfi::hostPort, EcalCondDBWriter_cfi::inputRootFiles, Integrity, Laser, Led, oniaPATMuonsWithTrigger_cff::matches, nTasks, Occupancy, EcalCondDBWriter_cfi::password, Pedestal, Presample, RawData, runNumber_, ecaldqm::DBWriterWorker::setVerbosity(), AlCaHLTBitMon_QueryRunRegistry::string, dqm::implementation::DQMStore::StripRunDirs, TestPulse, Timing, TriggerPrimitives, EcalCondDBWriter_cfi::userName, verbosity_, EcalCondDBWriter_cfi::workerParams, and workers_.

22  : runNumber_(0),
23  db_(nullptr),
24  location_(_ps.getUntrackedParameter<std::string>("location")),
25  runType_(_ps.getUntrackedParameter<std::string>("runType")),
26  runGeneralTag_(_ps.getUntrackedParameter<std::string>("runGeneralTag")),
27  monRunGeneralTag_(_ps.getUntrackedParameter<std::string>("monRunGeneralTag")),
28  summaryWriter_(_ps.getUntrackedParameterSet("workerParams")),
29  verbosity_(_ps.getUntrackedParameter<int>("verbosity")),
30  executed_(false) {
31  std::vector<std::string> inputRootFiles(_ps.getUntrackedParameter<std::vector<std::string>>("inputRootFiles"));
32 
33  if (inputRootFiles.empty())
34  throw cms::Exception("Configuration") << "No input ROOT file given";
35 
36  if (verbosity_ > 0)
37  edm::LogInfo("EcalDQM") << "Initializing DQMStore from input ROOT files";
38 
40 
41  for (unsigned iF(0); iF < inputRootFiles.size(); ++iF) {
43 
44  if (verbosity_ > 1)
45  edm::LogInfo("EcalDQM") << " " << fileName;
46 
47  TPRegexp pat("DQM_V[0-9]+(?:|_[0-9a-zA-Z]+)_R([0-9]+)");
48  std::unique_ptr<TObjArray> matches(pat.MatchS(fileName.c_str()));
49  if (matches->GetEntries() == 0)
50  throw cms::Exception("Configuration") << "Input file " << fileName << " is not an DQM output";
51 
52  if (iF == 0)
53  runNumber_ = TString(matches->At(1)->GetName()).Atoi();
54  else if (TString(matches->At(1)->GetName()).Atoi() != runNumber_)
55  throw cms::Exception("Configuration") << "Input files disagree in run number";
56 
57  dqmStore.open(fileName, false, "", "", DQMStore::StripRunDirs);
58  }
59 
60  std::string DBName(_ps.getUntrackedParameter<std::string>("DBName"));
61  std::string hostName(_ps.getUntrackedParameter<std::string>("hostName"));
62  int hostPort(_ps.getUntrackedParameter<int>("hostPort"));
63  std::string userName(_ps.getUntrackedParameter<std::string>("userName"));
64  std::string password(_ps.getUntrackedParameter<std::string>("password"));
65 
66  std::unique_ptr<EcalCondDBInterface> db(nullptr);
67 
68  if (verbosity_ > 0)
69  edm::LogInfo("EcalDQM") << "Establishing DB connection";
70 
71  try {
72  db = std::make_unique<EcalCondDBInterface>(DBName, userName, password);
73  } catch (std::runtime_error &re) {
74  if (!hostName.empty()) {
75  try {
76  db = std::make_unique<EcalCondDBInterface>(hostName, DBName, userName, password, hostPort);
77  } catch (std::runtime_error &re2) {
78  throw cms::Exception("DBError") << re2.what();
79  }
80  } else
81  throw cms::Exception("DBError") << re.what();
82  }
83 
84  db_ = db.release();
85 
86  if (verbosity_ > 0)
87  edm::LogInfo("EcalDQM") << " Done.";
88 
89  edm::ParameterSet const &workerParams(_ps.getUntrackedParameterSet("workerParams"));
90 
92  workers_[Cosmic] = nullptr;
97  workers_[BeamCalo] = nullptr;
98  workers_[BeamHodo] = nullptr;
99  workers_[TriggerPrimitives] = nullptr;
100  workers_[Cluster] = nullptr;
103  workers_[RawData] = nullptr;
105 
106  for (unsigned iC(0); iC < nTasks; ++iC)
107  if (workers_[iC])
109 }
std::string location_
std::string monRunGeneralTag_
std::string runGeneralTag_
Definition: HeavyIon.h:7
EcalCondDBInterface * db_
Log< level::Info, false > LogInfo
ecaldqm::DBWriterWorker * workers_[nTasks]
ecaldqm::SummaryWriter summaryWriter_
std::string runType_

◆ ~EcalCondDBWriter()

EcalCondDBWriter::~EcalCondDBWriter ( )
override

Definition at line 111 of file EcalCondDBWriter.cc.

References db_, MillePedeFileConverter_cfg::e, Exception, nTasks, and workers_.

111  {
112  try {
113  delete db_;
114  } catch (std::runtime_error &e) {
115  throw cms::Exception("DBError") << e.what();
116  }
117 
118  for (unsigned iC(0); iC < nTasks; ++iC)
119  delete workers_[iC];
120 }
EcalCondDBInterface * db_
ecaldqm::DBWriterWorker * workers_[nTasks]

Member Function Documentation

◆ beginRun()

void EcalCondDBWriter::beginRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivate

Definition at line 122 of file EcalCondDBWriter.cc.

References nTasks, ecaldqm::DQWorker::setSetupObjects(), and workers_.

122  {
123  for (unsigned iC(0); iC < nTasks; ++iC)
124  if (workers_[iC])
125  workers_[iC]->setSetupObjects(_es);
126 }
ecaldqm::DBWriterWorker * workers_[nTasks]
void setSetupObjects(edm::EventSetup const &)
Definition: DQWorker.cc:104

◆ dqmEndJob()

void EcalCondDBWriter::dqmEndJob ( DQMStore::IBooker ,
DQMStore::IGetter _igetter 
)
overrideprivatevirtual

Implements DQMEDHarvester.

Definition at line 128 of file EcalCondDBWriter.cc.

References dqm::implementation::NavigatorBase::cd(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, db_, dqm::implementation::IGetter::dirExists(), heppy_check::dirs, MillePedeFileConverter_cfg::e, Exception, executed_, EcalCondDBInterface::fetchMonRunIOV(), EcalCondDBInterface::fetchRunIOV(), dqm::implementation::IGetter::get(), getBit(), dqm::impl::MonitorElement::getIntValue(), ecaldqm::DBWriterWorker::getName(), RunIOV::getRunEnd(), RunIOV::getRunStart(), RunIOV::getRunTag(), dqm::implementation::IGetter::getSubdirs(), EcalCondDBInterface::insertMonRunIOV(), EcalCondDBInterface::insertRunIOV(), location_, monRunGeneralTag_, nTasks, ecaldqm::DBWriterWorker::retrieveSource(), writedatasetfile::run, ecaldqm::SummaryWriter::run(), runGeneralTag_, runNumber_, runType_, seconds(), setBit(), MonRunTag::setGeneralTag(), RunTag::setGeneralTag(), LocationDef::setLocation(), RunTag::setLocationDef(), MonVersionDef::setMonitoringVersion(), MonRunIOV::setMonRunTag(), MonRunTag::setMonVersionDef(), ecaldqm::SummaryWriter::setOutcome(), ecaldqm::SummaryWriter::setProcessedEvents(), MonRunIOV::setRunIOV(), RunIOV::setRunNumber(), RunIOV::setRunStart(), RunIOV::setRunTag(), RunTypeDef::setRunType(), RunTag::setRunTypeDef(), MonRunIOV::setSubRunEnd(), MonRunIOV::setSubRunNumber(), MonRunIOV::setSubRunStart(), ecaldqm::SummaryWriter::setTaskList(), summaryWriter_, verbosity_, and workers_.

128  {
129  if (executed_)
130  return;
131 
133 
134  if (verbosity_ > 1)
135  edm::LogInfo("EcalDQM") << " Searching event info";
136 
137  uint64_t timeStampInFile(0);
138  unsigned processedEvents(0);
139 
140  _igetter.cd();
141  std::vector<std::string> dirs(_igetter.getSubdirs());
142  for (unsigned iD(0); iD < dirs.size(); ++iD) {
143  if (!_igetter.dirExists(dirs[iD] + "/EventInfo"))
144  continue;
145 
146  MonitorElement *timeStampME(_igetter.get(dirs[iD] + "/EventInfo/runStartTimeStamp"));
147  if (timeStampME) {
148  double timeStampValue(timeStampME->getFloatValue());
149  uint64_t seconds(timeStampValue);
150  uint64_t microseconds((timeStampValue - seconds) * 1.e6);
151  timeStampInFile = (seconds << 32) | microseconds;
152  }
153 
154  MonitorElement *eventsME(_igetter.get(dirs[iD] + "/EventInfo/processedEvents"));
155  if (eventsME)
156  processedEvents = eventsME->getIntValue();
157 
158  if (timeStampInFile != 0 && processedEvents != 0) {
159  if (verbosity_ > 1)
160  edm::LogInfo("EcalDQM") << " Event info found; timestamp=" << timeStampInFile
161  << " processedEvents=" << processedEvents;
162  break;
163  }
164  }
165 
166  if (verbosity_ > 0)
167  edm::LogInfo("EcalDQM") << " Done.";
168 
170 
171  if (verbosity_ > 0)
172  edm::LogInfo("EcalDQM") << "Setting up source MonitorElements for given run type " << runType_;
173 
174  int taskList(0);
175  for (unsigned iC(0); iC < nTasks; ++iC) {
176  if (!workers_[iC] || !workers_[iC]->runsOn(runType_))
177  continue;
178 
179  workers_[iC]->retrieveSource(_igetter);
180 
181  setBit(taskList, iC);
182  }
183 
184  if (verbosity_ > 0)
185  edm::LogInfo("EcalDQM") << " Done.";
186 
188 
189  if (verbosity_ > 0)
190  edm::LogInfo("EcalDQM") << "Initializing DB entry";
191 
192  RunIOV runIOV;
193  RunTag runTag;
194  try {
195  runIOV = db_->fetchRunIOV(location_, runNumber_);
196  runTag = runIOV.getRunTag();
197  } catch (std::runtime_error &e) {
198  std::cerr << e.what();
199 
200  if (timeStampInFile == 0)
201  throw cms::Exception("Initialization") << "Time stamp for the run could not be found";
202 
203  LocationDef locationDef;
204  locationDef.setLocation(location_);
205  RunTypeDef runTypeDef;
206  runTypeDef.setRunType(runType_);
207  runTag.setLocationDef(locationDef);
208  runTag.setRunTypeDef(runTypeDef);
210 
211  runIOV.setRunStart(Tm(timeStampInFile));
212  runIOV.setRunNumber(runNumber_);
213  runIOV.setRunTag(runTag);
214 
215  try {
216  db_->insertRunIOV(&runIOV);
217  runIOV = db_->fetchRunIOV(&runTag, runNumber_);
218  } catch (std::runtime_error &e) {
219  throw cms::Exception("DBError") << e.what();
220  }
221  }
222 
223  // No filtering - DAQ definitions change time to time..
224  // if(runType_ != runIOV.getRunTag().getRunTypeDef().getRunType())
225  // throw cms::Exception("Configuration") << "Given run type " << runType_
226  // << " does not match the run type in DB " <<
227  // runIOV.getRunTag().getRunTypeDef().getRunType();
228 
229  MonVersionDef versionDef;
230  versionDef.setMonitoringVersion("test01"); // the only mon_ver in mon_version_def table as of September
231  // 2012
232  MonRunTag monTag;
233  monTag.setMonVersionDef(versionDef);
235 
236  MonRunIOV monIOV;
237 
238  try {
239  monIOV = db_->fetchMonRunIOV(&runTag, &monTag, runNumber_, 1);
240  } catch (std::runtime_error &e) {
241  std::cerr << e.what();
242 
243  monIOV.setRunIOV(runIOV);
244  monIOV.setSubRunNumber(1);
245  monIOV.setSubRunStart(runIOV.getRunStart());
246  monIOV.setSubRunEnd(runIOV.getRunEnd());
247  monIOV.setMonRunTag(monTag);
248 
249  try {
250  db_->insertMonRunIOV(&monIOV);
251  monIOV = db_->fetchMonRunIOV(&runTag, &monTag, runNumber_, 1);
252  } catch (std::runtime_error &e) {
253  throw cms::Exception("DBError") << e.what();
254  }
255  }
256 
257  if (verbosity_ > 0)
258  edm::LogInfo("EcalDQM") << " Done.";
259 
261 
262  if (verbosity_ > 0)
263  edm::LogInfo("EcalDQM") << "Writing to DB";
264 
265  int outcome(0);
266  for (unsigned iC(0); iC < nTasks; ++iC) {
267  if (!getBit(taskList, iC))
268  continue;
269 
270  if (verbosity_ > 1)
271  edm::LogInfo("EcalDQM") << " " << workers_[iC]->getName();
272 
273  if (workers_[iC]->isActive() && workers_[iC]->run(db_, monIOV))
274  setBit(outcome, iC);
275  }
276 
277  if (verbosity_ > 0)
278  edm::LogInfo("EcalDQM") << " Done.";
279 
280  if (verbosity_ > 0)
281  edm::LogInfo("EcalDQM") << "Registering the outcome of DB writing";
282 
283  summaryWriter_.setTaskList(taskList);
284  summaryWriter_.setOutcome(outcome);
285  summaryWriter_.setProcessedEvents(processedEvents);
286  summaryWriter_.run(db_, monIOV);
287 
288  if (verbosity_ > 0)
289  edm::LogInfo("EcalDQM") << " Done.";
290 
291  executed_ = true;
292 }
void setRunTypeDef(const RunTypeDef &runTypeDef)
Definition: RunTag.cc:42
void setRunStart(const Tm &start)
Definition: RunIOV.cc:33
bool run(EcalCondDBInterface *, MonRunIOV &) override
double seconds()
MonRunIOV fetchMonRunIOV(RunTag *runtag, MonRunTag *montag, run_t run, subrun_t monrun) noexcept(false)
void insertMonRunIOV(MonRunIOV *iov) noexcept(false)
std::string location_
std::string monRunGeneralTag_
Definition: RunTag.h:13
void setRunIOV(const RunIOV &iov)
Definition: MonRunIOV.cc:36
void setProcessedEvents(unsigned _n)
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:737
std::string runGeneralTag_
void setGeneralTag(std::string tag)
Definition: MonRunTag.cc:21
void setRunTag(const RunTag &tag)
Definition: RunIOV.cc:51
void setRunNumber(run_t run)
Definition: RunIOV.cc:22
std::string const & getName() const
RunIOV fetchRunIOV(RunTag *tag, run_t run) noexcept(false)
EcalCondDBInterface * db_
void setTaskList(int _list)
Tm getRunEnd() const
Definition: RunIOV.cc:49
void setSubRunEnd(const Tm &end)
Definition: MonRunIOV.cc:63
void setSubRunNumber(subrun_t subrun)
Definition: MonRunIOV.cc:45
void insertRunIOV(RunIOV *iov) noexcept(false)
RunTag getRunTag() const
Definition: RunIOV.cc:58
void setMonVersionDef(const MonVersionDef &ver)
Definition: MonRunTag.cc:30
void setSubRunStart(const Tm &start)
Definition: MonRunIOV.cc:54
void setLocationDef(const LocationDef &locDef)
Definition: RunTag.cc:33
void setBit(int &_bitArray, unsigned _iBit)
Log< level::Info, false > LogInfo
unsigned long long uint64_t
Definition: Time.h:13
void setRunType(std::string runtype)
Definition: RunTypeDef.cc:21
Tm getRunStart() const
Definition: RunIOV.cc:40
void setMonRunTag(const MonRunTag &tag)
Definition: MonRunIOV.cc:27
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:680
void retrieveSource(DQMStore::IGetter &)
void setMonitoringVersion(std::string ver)
ecaldqm::DBWriterWorker * workers_[nTasks]
void setLocation(std::string loc)
Definition: LocationDef.cc:20
ecaldqm::SummaryWriter summaryWriter_
void setGeneralTag(std::string tag)
Definition: RunTag.cc:24
Definition: RunIOV.h:13
Definition: Tm.h:13
bool getBit(int &_bitArray, unsigned _iBit)
void setOutcome(int _outcome)
std::string runType_
virtual int64_t getIntValue() const
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:707

Member Data Documentation

◆ db_

EcalCondDBInterface* EcalCondDBWriter::db_
private

Definition at line 39 of file EcalCondDBWriter.h.

Referenced by dqmEndJob(), EcalCondDBWriter(), and ~EcalCondDBWriter().

◆ executed_

bool EcalCondDBWriter::executed_
private

Definition at line 49 of file EcalCondDBWriter.h.

Referenced by dqmEndJob().

◆ inputRootFiles_

std::vector<std::string> EcalCondDBWriter::inputRootFiles_
private

Definition at line 44 of file EcalCondDBWriter.h.

◆ location_

std::string EcalCondDBWriter::location_
private

Definition at line 40 of file EcalCondDBWriter.h.

Referenced by dqmEndJob().

◆ monRunGeneralTag_

std::string EcalCondDBWriter::monRunGeneralTag_
private

Definition at line 43 of file EcalCondDBWriter.h.

Referenced by dqmEndJob().

◆ runGeneralTag_

std::string EcalCondDBWriter::runGeneralTag_
private

Definition at line 42 of file EcalCondDBWriter.h.

Referenced by dqmEndJob().

◆ runNumber_

int EcalCondDBWriter::runNumber_
private

Definition at line 38 of file EcalCondDBWriter.h.

Referenced by dqmEndJob(), and EcalCondDBWriter().

◆ runType_

std::string EcalCondDBWriter::runType_
private

Definition at line 41 of file EcalCondDBWriter.h.

Referenced by dqmEndJob().

◆ summaryWriter_

ecaldqm::SummaryWriter EcalCondDBWriter::summaryWriter_
private

Definition at line 46 of file EcalCondDBWriter.h.

Referenced by dqmEndJob().

◆ verbosity_

int EcalCondDBWriter::verbosity_
private

Definition at line 48 of file EcalCondDBWriter.h.

Referenced by dqmEndJob(), and EcalCondDBWriter().

◆ workers_

ecaldqm::DBWriterWorker* EcalCondDBWriter::workers_[nTasks]
private

Definition at line 45 of file EcalCondDBWriter.h.

Referenced by beginRun(), dqmEndJob(), EcalCondDBWriter(), and ~EcalCondDBWriter().