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 ecaldqm::DQWorker

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 &)
 
std::string const & getName () const
 
bool isActive () const
 
void retrieveSource (DQMStore::IGetter &)
 
bool runsOn (std::string const &_runType) const
 
void setVerbosity (int _v)
 
 ~DBWriterWorker () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
bool checkElectronicsMap (bool=true)
 
bool checkGeometry (bool=true)
 
bool checkTopology (bool=true)
 
bool checkTrigTowerMap (bool=true)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap const * GetTrigTowerMap ()
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setSetupObjects (edm::EventSetup const &)
 
void setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
virtual ~DQWorker () noexcept(false)
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DBWriterWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandle
 
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandle
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandleEndLumi
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandle
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandleEndLumi
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandle
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandleEndLumi
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setME (edm::ParameterSet const &)
 
virtual void setParams (edm::ParameterSet const &)
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DBWriterWorker
bool active_
 
std::string const name_
 
std::set< std::string > runTypes_
 
MESetCollection source_
 
int verbosity_
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 74 of file DBWriterWorkers.h.

Constructor & Destructor Documentation

◆ PresampleWriter()

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

Definition at line 76 of file DBWriterWorkers.h.

76 : DBWriterWorker("Presample", _ps) {}
DBWriterWorker(std::string const &, edm::ParameterSet const &)

◆ ~PresampleWriter()

ecaldqm::PresampleWriter::~PresampleWriter ( )
inlineoverride

Definition at line 77 of file DBWriterWorkers.h.

77 {}

Member Function Documentation

◆ run()

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

Implements ecaldqm::DBWriterWorker.

Definition at line 750 of file DBWriterWorkers.cc.

References ecaldqm::MESetCollection::at(), ecaldqm::crystalID(), data, MillePedeFileConverter_cfg::e, Exception, spr::find(), ecaldqm::DQWorker::GetElectronicsMap(), 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().

750  {
751  /*
752  uses
753  PresampleTask.Pedestal (h03)
754  PresampleClient.Quality (meg03)
755  */
756 
757  bool result(true);
758 
759  std::map<EcalLogicID, MonPedestalsOnlineDat> pedestals;
760 
761  MESet const &pedestalME(source_.at("Pedestal"));
762  MESet const &qualityME(source_.at("Quality"));
763 
764  MESet::const_iterator pEnd(pedestalME.end(GetElectronicsMap()));
765  MESet::const_iterator qItr(GetElectronicsMap(), qualityME);
766  for (MESet::const_iterator pItr(pedestalME.beginChannel(GetElectronicsMap())); pItr != pEnd;
767  pItr.toNextChannel(GetElectronicsMap())) {
768  float entries(pItr->getBinEntries());
769  if (entries < 1.)
770  continue;
771 
772  qItr = pItr;
773 
774  float mean(pItr->getBinContent());
775  float rms(pItr->getBinError() * std::sqrt(entries));
776 
777  MonPedestalsOnlineDat &data(pedestals[crystalID(pItr->getId(), GetElectronicsMap())]);
778  data.setADCMeanG12(mean);
779  data.setADCRMSG12(rms);
780 
781  int channelStatus(qItr->getBinContent());
782  bool channelBad(channelStatus == kBad || channelStatus == kMBad);
783  data.setTaskStatus(channelBad);
784 
785  result &= qualityOK(channelStatus);
786  }
787 
788  try {
789  if (!pedestals.empty())
790  _db->insertDataArraySet(&pedestals, &_iov);
791  } catch (std::runtime_error &e) {
792  if (std::string(e.what()).find("unique constraint") != std::string::npos)
793  edm::LogWarning("EcalDQM") << e.what();
794  else
795  throw cms::Exception("DBError") << e.what();
796  }
797 
798  return result;
799  }
EcalLogicID crystalID(DetId const &, EcalElectronicsMapping const *)
MESet & at(const std::string &key)
Definition: MESet.h:399
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
T sqrt(T t)
Definition: SSEVec.h:19
MESetCollection source_
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov) noexcept(false)
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
bool qualityOK(int _quality)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80