CMS 3D CMS Logo

List of all members | Public Member Functions
ecaldqm::TimingWriter Class Reference

#include <DBWriterWorkers.h>

Inheritance diagram for ecaldqm::TimingWriter:
ecaldqm::DBWriterWorker

Public Member Functions

bool run (EcalCondDBInterface *, MonRunIOV &) override
 
 TimingWriter (edm::ParameterSet const &_ps)
 
 ~TimingWriter () override
 
- Public Member Functions inherited from ecaldqm::DBWriterWorker
 DBWriterWorker (std::string const &, edm::ParameterSet const &)
 
const std::string & getName () const
 
bool isActive () const
 
void retrieveSource (DQMStore::IGetter &)
 
bool runsOn (std::string const &_runType) const
 
void setVerbosity (int _v)
 
virtual ~DBWriterWorker ()
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DBWriterWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Attributes inherited from ecaldqm::DBWriterWorker
bool active_
 
const std::string name_
 
std::set< std::string > runTypes_
 
MESetCollection source_
 
int verbosity_
 

Detailed Description

Definition at line 92 of file DBWriterWorkers.h.

Constructor & Destructor Documentation

◆ TimingWriter()

ecaldqm::TimingWriter::TimingWriter ( edm::ParameterSet const &  _ps)
inline

Definition at line 94 of file DBWriterWorkers.h.

94 : DBWriterWorker("Timing", _ps) {}

◆ ~TimingWriter()

ecaldqm::TimingWriter::~TimingWriter ( )
inlineoverride

Definition at line 95 of file DBWriterWorkers.h.

95 {}

Member Function Documentation

◆ run()

bool ecaldqm::TimingWriter::run ( EcalCondDBInterface _db,
MonRunIOV _iov 
)
overridevirtual

Implements ecaldqm::DBWriterWorker.

Definition at line 1031 of file DBWriterWorkers.cc.

1031  {
1032  /*
1033  uses
1034  TimingTask.TimeMap (h01)
1035  TimingClient.Quality (meg01)
1036  */
1037 
1038  bool result(true);
1039 
1040  std::map<EcalLogicID, MonTimingCrystalDat> timing;
1041 
1042  MESet const &timingME(source_.at("Timing"));
1043  MESet const &qualityME(source_.at("Quality"));
1044 
1045  MESet::const_iterator tEnd(timingME.end());
1046  MESet::const_iterator qItr(qualityME);
1047  for (MESet::const_iterator tItr(timingME.beginChannel()); tItr != tEnd; tItr.toNextChannel()) {
1048  float entries(tItr->getBinEntries());
1049  if (entries < 1.)
1050  continue;
1051 
1052  qItr = tItr;
1053 
1054  float mean(tItr->getBinContent());
1055  float rms(tItr->getBinError() * std::sqrt(entries));
1056 
1057  MonTimingCrystalDat &data(timing[crystalID(tItr->getId())]);
1058  data.setTimingMean(mean);
1059  data.setTimingRMS(rms);
1060 
1061  int channelStatus(qItr->getBinContent());
1062  bool channelBad(channelStatus == kBad || channelStatus == kMBad);
1063  data.setTaskStatus(channelBad);
1064 
1065  result &= qualityOK(channelStatus);
1066  }
1067 
1068  try {
1069  if (!timing.empty())
1070  _db->insertDataArraySet(&timing, &_iov);
1071  } catch (std::runtime_error &e) {
1072  if (std::string(e.what()).find("unique constraint") != std::string::npos)
1073  edm::LogWarning("EcalDQM") << e.what();
1074  else
1075  throw cms::Exception("DBError") << e.what();
1076  }
1077 
1078  return result;
1079  }

References ecaldqm::crystalID(), data, MillePedeFileConverter_cfg::e, Exception, spr::find(), EcalCondDBInterface::insertDataArraySet(), ecaldqm::kBad, ecaldqm::kMBad, SiStripPI::mean, ecaldqm::qualityOK(), mps_fire::result, SiStripPI::rms, ecaldqm::DBWriterWorker::source_, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, ecalMatacq_cfi::timing, and ecaldqm::MESet::const_iterator::toNextChannel().

Referenced by Types.EventID::cppID(), and Types.LuminosityBlockID::cppID().

EcalCondDBInterface::insertDataArraySet
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov) noexcept(false)
Definition: EcalCondDBInterface.h:298
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
SiStripPI::rms
Definition: SiStripPayloadInspectorHelper.h:169
MonTimingCrystalDat
Definition: MonTimingCrystalDat.h:6
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
ecaldqm::kBad
Definition: DBWriterWorkers.cc:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
ecaldqm::kMBad
Definition: DBWriterWorkers.cc:55
ecaldqm::qualityOK
bool qualityOK(int _quality)
Definition: DBWriterWorkers.cc:57
ecaldqm::DBWriterWorker::DBWriterWorker
DBWriterWorker(std::string const &, edm::ParameterSet const &)
Definition: DBWriterWorkers.cc:59
ecalMatacq_cfi.timing
timing
Definition: ecalMatacq_cfi.py:26
ecaldqm::crystalID
EcalLogicID crystalID(DetId const &)
Definition: LogicIDTranslation.cc:21
Exception
Definition: hltDiff.cc:246
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
mps_fire.result
result
Definition: mps_fire.py:303
ecaldqm::DBWriterWorker::source_
MESetCollection source_
Definition: DBWriterWorkers.h:36
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37