CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from ecaldqm::DBWriterWorker
 DBWriterWorker (std::string const &, edm::ParameterSet const &)
 
std::string const & getName () const
 
bool isActive () const
 
virtual void retrieveSource (DQMStore const &)
 
bool runsOn (std::string const &_runType) const
 
void setVerbosity (int _v)
 
virtual ~DBWriterWorker ()
 

Additional Inherited Members

- Protected Attributes inherited from ecaldqm::DBWriterWorker
bool active_
 
std::string const name_
 
std::set< std::string > runTypes_
 
MESetCollection source_
 
int verbosity_
 

Detailed Description

Definition at line 90 of file DBWriterWorkers.h.

Constructor & Destructor Documentation

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

Definition at line 92 of file DBWriterWorkers.h.

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

Definition at line 93 of file DBWriterWorkers.h.

93 {}

Member Function Documentation

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

Implements ecaldqm::DBWriterWorker.

Definition at line 1062 of file DBWriterWorkers.cc.

References ecaldqm::crystalID(), data, alignCSCRings::e, python.tagInventory::entries, edm::hlt::Exception, spr::find(), EcalCondDBInterface::insertDataArraySet(), ecaldqm::kBad, ecaldqm::kMBad, timingPdfMaker::mean, ecaldqm::qualityOK(), query::result, plotscripts::rms(), ecaldqm::DBWriterWorker::source_, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::MESet::const_iterator::toNextChannel().

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

1063  {
1064  /*
1065  uses
1066  TimingTask.TimeMap (h01)
1067  TimingClient.Quality (meg01)
1068  */
1069 
1070  bool result(true);
1071 
1072  std::map<EcalLogicID, MonTimingCrystalDat> timing;
1073 
1074  MESet const& timingME(source_.at("Timing"));
1075  MESet const& qualityME(source_.at("Quality"));
1076 
1077  MESet::const_iterator tEnd(timingME.end());
1078  MESet::const_iterator qItr(qualityME);
1079  for(MESet::const_iterator tItr(timingME.beginChannel()); tItr != tEnd; tItr.toNextChannel()){
1080  float entries(tItr->getBinEntries());
1081  if(entries < 1.) continue;
1082 
1083  qItr = tItr;
1084 
1085  float mean(tItr->getBinContent());
1086  float rms(tItr->getBinError() * std::sqrt(entries));
1087 
1088  MonTimingCrystalDat& data(timing[crystalID(tItr->getId())]);
1089  data.setTimingMean(mean);
1090  data.setTimingRMS(rms);
1091 
1092  int channelStatus(qItr->getBinContent());
1093  bool channelBad(channelStatus == kBad || channelStatus == kMBad);
1094  data.setTaskStatus(channelBad);
1095 
1096  result &= qualityOK(channelStatus);
1097  }
1098 
1099  try{
1100  if(timing.size() > 0)
1101  _db->insertDataArraySet(&timing, &_iov);
1102  }
1103  catch(std::runtime_error& e){
1104  if(std::string(e.what()).find("unique constraint") != std::string::npos)
1105  edm::LogWarning("EcalDQM") << e.what();
1106  else
1107  throw cms::Exception("DBError") << e.what();
1108  }
1109 
1110  return result;
1111  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
T sqrt(T t)
Definition: SSEVec.h:48
MESetCollection source_
tuple result
Definition: query.py:137
bool qualityOK(int _quality)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
EcalLogicID crystalID(DetId const &)