CMS 3D CMS Logo

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

#include <DBWriterWorkers.h>

Inheritance diagram for ecaldqm::PresampleWriter:
ecaldqm::DBWriterWorker

Public Member Functions

 PresampleWriter (edm::ParameterSet const &_ps)
 
bool run (EcalCondDBInterface *, MonRunIOV &) override
 
 ~PresampleWriter () 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 72 of file DBWriterWorkers.h.

Constructor & Destructor Documentation

◆ PresampleWriter()

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

Definition at line 74 of file DBWriterWorkers.h.

74 : DBWriterWorker("Presample", _ps) {}

◆ ~PresampleWriter()

ecaldqm::PresampleWriter::~PresampleWriter ( )
inlineoverride

Definition at line 75 of file DBWriterWorkers.h.

75 {}

Member Function Documentation

◆ run()

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

Implements ecaldqm::DBWriterWorker.

Definition at line 747 of file DBWriterWorkers.cc.

747  {
748  /*
749  uses
750  PresampleTask.Pedestal (h03)
751  PresampleClient.Quality (meg03)
752  */
753 
754  bool result(true);
755 
756  std::map<EcalLogicID, MonPedestalsOnlineDat> pedestals;
757 
758  MESet const &pedestalME(source_.at("Pedestal"));
759  MESet const &qualityME(source_.at("Quality"));
760 
761  MESet::const_iterator pEnd(pedestalME.end());
762  MESet::const_iterator qItr(qualityME);
763  for (MESet::const_iterator pItr(pedestalME.beginChannel()); pItr != pEnd; pItr.toNextChannel()) {
764  float entries(pItr->getBinEntries());
765  if (entries < 1.)
766  continue;
767 
768  qItr = pItr;
769 
770  float mean(pItr->getBinContent());
771  float rms(pItr->getBinError() * std::sqrt(entries));
772 
773  MonPedestalsOnlineDat &data(pedestals[crystalID(pItr->getId())]);
774  data.setADCMeanG12(mean);
775  data.setADCRMSG12(rms);
776 
777  int channelStatus(qItr->getBinContent());
778  bool channelBad(channelStatus == kBad || channelStatus == kMBad);
779  data.setTaskStatus(channelBad);
780 
781  result &= qualityOK(channelStatus);
782  }
783 
784  try {
785  if (!pedestals.empty())
786  _db->insertDataArraySet(&pedestals, &_iov);
787  } catch (std::runtime_error &e) {
788  if (std::string(e.what()).find("unique constraint") != std::string::npos)
789  edm::LogWarning("EcalDQM") << e.what();
790  else
791  throw cms::Exception("DBError") << e.what();
792  }
793 
794  return result;
795  }

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, 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
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
MonPedestalsOnlineDat
Definition: MonPedestalsOnlineDat.h:12
ecaldqm::DBWriterWorker::DBWriterWorker
DBWriterWorker(std::string const &, edm::ParameterSet const &)
Definition: DBWriterWorkers.cc:59
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