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:
DQMEDHarvester ecaldqm::DQWorker edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 EcalMEFormatter (edm::ParameterSet const &)
 
 ~EcalMEFormatter ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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::IBooker &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 

Private Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void format_ (DQMStore::IGetter &, bool)
 
void formatDet2D_ (ecaldqm::MESet &)
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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
bool booked_
 
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:56
void initialize(std::string const &_name, edm::ParameterSet const &)
Definition: DQWorker.cc:48
EcalMEFormatter::~EcalMEFormatter ( )
inline

Definition at line 12 of file EcalMEFormatter.h.

12 {};

Member Function Documentation

void EcalMEFormatter::dqmEndJob ( DQMStore::IBooker ,
DQMStore::IGetter _igetter 
)
overrideprivatevirtual

Implements DQMEDHarvester.

Definition at line 40 of file EcalMEFormatter.cc.

References format_().

41 {
42  format_(_igetter, false);
43 }
void format_(DQMStore::IGetter &, bool)
void EcalMEFormatter::dqmEndLuminosityBlock ( DQMStore::IBooker ,
DQMStore::IGetter _igetter,
edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from DQMEDHarvester.

Definition at line 34 of file EcalMEFormatter.cc.

References format_().

35 {
36  format_(_igetter, true);
37 }
void format_(DQMStore::IGetter &, 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:31
void EcalMEFormatter::format_ ( DQMStore::IGetter _igetter,
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 dqmEndJob(), and dqmEndLuminosityBlock().

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

Definition at line 64 of file EcalMEFormatter.cc.

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

Referenced by format_().

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