CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
EcalMEFormatter Class Reference

#include <EcalMEFormatter.h>

Inheritance diagram for EcalMEFormatter:
edm::EDAnalyzer ecaldqm::DQWorker edm::EDConsumerBase

Public Member Functions

 EcalMEFormatter (edm::ParameterSet const &)
 
 ~EcalMEFormatter ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 
- 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 &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
 DQWorker ()
 
std::string const & getName () const
 
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 setTime (time_t _t)
 
virtual ~DQWorker ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 

Private Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void format_ (bool)
 
void formatDet2D_ (ecaldqm::MESet &)
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- 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::DQWorker
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 9 of file EcalMEFormatter.h.

Constructor & Destructor Documentation

EcalMEFormatter::EcalMEFormatter ( edm::ParameterSet const &  _ps)

Definition at line 13 of file EcalMEFormatter.cc.

References edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::DQWorker::initialize(), ecaldqm::DQWorker::setME(), and ecaldqm::DQWorker::verbosity_.

13  :
16 {
17  initialize("EcalMEFormatter", _ps);
18  setME(_ps.getUntrackedParameterSet("MEs"));
19  verbosity_ = _ps.getUntrackedParameter<int>("verbosity", 0);
20 }
virtual void setME(edm::ParameterSet const &)
Definition: DQWorker.cc:55
void initialize(std::string const &_name, edm::ParameterSet const &)
Definition: DQWorker.cc:47
EcalMEFormatter::~EcalMEFormatter ( )
inline

Definition at line 12 of file EcalMEFormatter.h.

12 {};

Member Function Documentation

void EcalMEFormatter::analyze ( edm::Event const &  ,
edm::EventSetup const &   
)
inlineoverrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 19 of file EcalMEFormatter.h.

19 {}
void EcalMEFormatter::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 34 of file EcalMEFormatter.cc.

References format_().

35 {
36  format_(true);
37 }
void format_(bool)
void EcalMEFormatter::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 40 of file EcalMEFormatter.cc.

References format_().

41 {
42  format_(false);
43 }
void format_(bool)
void EcalMEFormatter::fillDescriptions ( edm::ConfigurationDescriptions _descs)
static

Definition at line 24 of file EcalMEFormatter.cc.

References edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addUntracked(), and ecaldqm::DQWorker::fillDescriptions().

25 {
28  desc.addUntracked<int>("verbosity", 0);
29 
30  _descs.addDefault(desc);
31 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ParameterSetDescription &_desc)
Definition: DQWorker.cc:30
void EcalMEFormatter::format_ ( bool  _checkLumi)
private

Definition at line 46 of file EcalMEFormatter.cc.

References formatDet2D_(), ecaldqm::DQWorker::MEs_, AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::DQWorker::verbosity_.

Referenced by endLuminosityBlock(), and endRun().

47 {
48  DQMStore& dqmStore(*edm::Service<DQMStore>());
49  std::string failedPath;
50 
51  for(ecaldqm::MESetCollection::iterator mItr(MEs_.begin()); mItr != MEs_.end(); ++mItr){
52  if(_checkLumi && !mItr->second->getLumiFlag()) continue;
53  mItr->second->clear();
54  if(!mItr->second->retrieve(dqmStore, &failedPath)){
55  if(verbosity_ > 0) edm::LogWarning("EcalDQM") << "Could not find ME " << mItr->first << "@" << failedPath;
56  continue;
57  }
58  if(verbosity_ > 1) edm::LogInfo("EcalDQM") << "Retrieved " << mItr->first << " from DQMStore";
59 
60  if(dynamic_cast<ecaldqm::MESetDet2D*>(mItr->second)) formatDet2D_(*mItr->second);
61  }
62 }
void formatDet2D_(ecaldqm::MESet &)
MESetCollection MEs_
Definition: DQWorker.h:76
void EcalMEFormatter::formatDet2D_ ( ecaldqm::MESet _meSet)
private

Definition at line 65 of file EcalMEFormatter.cc.

References newFWLiteAna::bin, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MESet::getKind(), ecaldqm::MESet::getME(), MonitorElement::getTProfile2D(), max(), and ecaldqm::DQWorker::verbosity_.

Referenced by format_().

66 {
67  if(_meSet.getKind() != MonitorElement::DQM_KIND_TPROFILE2D) return;
68 
69  MonitorElement* me(0);
70  unsigned iME(0);
71  while((me = _meSet.getME(iME++))){
72  TProfile2D* prof(me->getTProfile2D());
73  for(int iX(1); iX <= prof->GetNbinsX(); ++iX){
74  for(int iY(1); iY <= prof->GetNbinsY(); ++iY){
75  int bin(prof->GetBin(iX, iY));
76  if(prof->GetBinEntries(bin) == 0.){
77  if(verbosity_ > 2) edm::LogInfo("EcalDQM") << "Found empty bin " << bin << " in histogram " << prof->GetName();
78  // TEMPORARY SETUP UNTIL RENDERPLUGIN IS UPDATED TO DO THIS
79  // WHEN IT IS, SWITCH TO ENTRIES -1 CONTENT 0
80  prof->SetBinEntries(bin, 1.);
81  prof->SetBinContent(bin, -std::numeric_limits<double>::max());
82  }
83  }
84  }
85  }
86 }
virtual MonitorElement const * getME(unsigned _iME) const
Definition: MESet.h:99
MonitorElement::Kind getKind() const
Definition: MESet.h:96
const T & max(const T &a, const T &b)