CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
ecaldqm::TimingWriter Class Reference

#include <DBWriterWorkers.h>

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

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 &)
 
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 &)
 
 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,
EcalMappingRcd
elecMapHandle
 
edm::ESGetToken
< EcalElectronicsMapping,
EcalMappingRcd
elecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
geomHandle
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
geomHandleEndLumi
 
edm::ESGetToken< CaloTopology,
CaloTopologyRecord
topoHandle
 
edm::ESGetToken< CaloTopology,
CaloTopologyRecord
topoHandleEndLumi
 
edm::ESGetToken
< EcalTrigTowerConstituentsMap,
IdealGeometryRecord
ttMapHandle
 
edm::ESGetToken
< EcalTrigTowerConstituentsMap,
IdealGeometryRecord
ttMapHandleEndLumi
 
- 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 94 of file DBWriterWorkers.h.

Constructor & Destructor Documentation

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

Definition at line 96 of file DBWriterWorkers.h.

96 : DBWriterWorker("Timing", _ps) {}
DBWriterWorker(std::string const &, edm::ParameterSet const &)
ecaldqm::TimingWriter::~TimingWriter ( )
inlineoverride

Definition at line 97 of file DBWriterWorkers.h.

97 {}

Member Function Documentation

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

Implements ecaldqm::DBWriterWorker.

Definition at line 1036 of file DBWriterWorkers.cc.

References ecaldqm::MESetCollection::at(), ecaldqm::crystalID(), data, alignCSCRings::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().

1036  {
1037  /*
1038  uses
1039  TimingTask.TimeMap (h01)
1040  TimingClient.Quality (meg01)
1041  */
1042 
1043  bool result(true);
1044 
1045  std::map<EcalLogicID, MonTimingCrystalDat> timing;
1046 
1047  MESet const &timingME(source_.at("Timing"));
1048  MESet const &qualityME(source_.at("Quality"));
1049 
1050  MESet::const_iterator tEnd(timingME.end(GetElectronicsMap()));
1051  MESet::const_iterator qItr(GetElectronicsMap(), qualityME);
1052  for (MESet::const_iterator tItr(timingME.beginChannel(GetElectronicsMap())); tItr != tEnd;
1053  tItr.toNextChannel(GetElectronicsMap())) {
1054  float entries(tItr->getBinEntries());
1055  if (entries < 1.)
1056  continue;
1057 
1058  qItr = tItr;
1059 
1060  float mean(tItr->getBinContent());
1061  float rms(tItr->getBinError() * std::sqrt(entries));
1062 
1063  MonTimingCrystalDat &data(timing[crystalID(tItr->getId(), GetElectronicsMap())]);
1064  data.setTimingMean(mean);
1065  data.setTimingRMS(rms);
1066 
1067  int channelStatus(qItr->getBinContent());
1068  bool channelBad(channelStatus == kBad || channelStatus == kMBad);
1069  data.setTaskStatus(channelBad);
1070 
1071  result &= qualityOK(channelStatus);
1072  }
1073 
1074  try {
1075  if (!timing.empty())
1076  _db->insertDataArraySet(&timing, &_iov);
1077  } catch (std::runtime_error &e) {
1078  if (std::string(e.what()).find("unique constraint") != std::string::npos)
1079  edm::LogWarning("EcalDQM") << e.what();
1080  else
1081  throw cms::Exception("DBError") << e.what();
1082  }
1083 
1084  return result;
1085  }
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
tuple result
Definition: mps_fire.py:311
T sqrt(T t)
Definition: SSEVec.h:19
MESetCollection source_
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov) noexcept(false)
bool qualityOK(int _quality)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:118