CMS 3D CMS Logo

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

#include <HcalNoiseRatesClient.h>

Inheritance diagram for HcalNoiseRatesClient:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob (void)
 
virtual void beginRun (const edm::Run &run, const edm::EventSetup &c)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
virtual void endRun (const edm::Run &run, const edm::EventSetup &c)
 
 HcalNoiseRatesClient (const edm::ParameterSet &)
 
int NoiseRatesEndjob (const std::vector< MonitorElement * > &hcalMEs)
 
virtual void runClient_ ()
 
virtual ~HcalNoiseRatesClient ()
 
- 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 ()
 

Private Attributes

edm::ParameterSet conf_
 
DQMStoredbe_
 
bool debug_
 
std::string dirName_
 
std::string dirNameJet_
 
std::string dirNameMET_
 
std::string outputFile_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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)
 

Detailed Description

Definition at line 36 of file HcalNoiseRatesClient.h.

Constructor & Destructor Documentation

HcalNoiseRatesClient::HcalNoiseRatesClient ( const edm::ParameterSet iConfig)
explicit

Definition at line 12 of file HcalNoiseRatesClient.cc.

References dbe_, debug_, dirName_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, outputFile_, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

12  :conf_(iConfig)
13 {
14 
15  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");
16 
18  if (!dbe_) {
19  edm::LogError("HcalNoiseRatesClient") << "unable to get DQMStore service, upshot is no client histograms will be made";
20  }
21  if(iConfig.getUntrackedParameter<bool>("DQMStore", false)) {
22  if(dbe_) dbe_->setVerbose(0);
23  }
24 
25  debug_ = false;
26  verbose_ = false;
27 
28  dirName_=iConfig.getParameter<std::string>("DQMDirName");
30 
31 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet conf_
void setVerbose(unsigned level)
Definition: DQMStore.cc:619
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
HcalNoiseRatesClient::~HcalNoiseRatesClient ( )
virtual

Definition at line 34 of file HcalNoiseRatesClient.cc.

35 {
36 
37 }

Member Function Documentation

void HcalNoiseRatesClient::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 62 of file HcalNoiseRatesClient.cc.

63 {
64 
65 }
void HcalNoiseRatesClient::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file HcalNoiseRatesClient.cc.

40 {
41 
42 
43 }
void HcalNoiseRatesClient::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 50 of file HcalNoiseRatesClient.cc.

51 {
52 
53 }
void HcalNoiseRatesClient::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file HcalNoiseRatesClient.cc.

References dbe_, outputFile_, and DQMStore::save().

46 {
47  if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
48 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2490
void HcalNoiseRatesClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 67 of file HcalNoiseRatesClient.cc.

68 {
69 // runClient_();
70 }
void HcalNoiseRatesClient::endRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 56 of file HcalNoiseRatesClient.cc.

References runClient_().

57 {
58  runClient_();
59 }
int HcalNoiseRatesClient::NoiseRatesEndjob ( const std::vector< MonitorElement * > &  hcalMEs)

Definition at line 108 of file HcalNoiseRatesClient.cc.

References MonitorElement::Fill().

Referenced by runClient_().

108  {
109 
110  int useAllHistos = 0;
111  MonitorElement* hLumiBlockCount =0;
112  for(unsigned int ih=0; ih<hcalMEs.size(); ih++){
113  if( strcmp(hcalMEs[ih]->getName().c_str(), "hLumiBlockCount") ==0 ){
114  hLumiBlockCount = hcalMEs[ih];
115  useAllHistos =1;
116  }
117  }
118  if( useAllHistos !=0 && useAllHistos !=1 ) return 0;
119 
120 // FIXME: dummy lumiCountMap.size since hLumiBlockCount is disabled
121 // in a general case.
122  int lumiCountMapsize = -1; // dummy
123  if (useAllHistos) hLumiBlockCount->Fill(0.0, lumiCountMapsize);
124 
125  return 1;
126 
127 }
void Fill(long long x)
void HcalNoiseRatesClient::runClient_ ( )
virtual

Definition at line 72 of file HcalNoiseRatesClient.cc.

References gather_cfg::cout, dbe_, dirName_, DQMStore::getContents(), DQMStore::getSubdirs(), i, j, NoiseRatesEndjob(), DQMStore::setCurrentFolder(), and verbose_.

Referenced by endRun().

73 {
74  if(!dbe_) return; //we dont have the DQMStore so we cant do anything
76 
77  if (verbose_) std::cout << "\nrunClient" << std::endl;
78 
79  std::vector<MonitorElement*> hcalMEs;
80 
81  // Since out folders are fixed to three, we can just go over these three folders
82  // i.e., CaloTowersD/CaloTowersTask, HcalRecHitsD/HcalRecHitTask, HcalNoiseRatesD/NoiseRatesTask.
83  std::vector<std::string> fullPathHLTFolders = dbe_->getSubdirs();
84  for(unsigned int i=0;i<fullPathHLTFolders.size();i++) {
85 
86  if (verbose_) std::cout <<"\nfullPath: "<< fullPathHLTFolders[i] << std::endl;
87  dbe_->setCurrentFolder(fullPathHLTFolders[i]);
88 
89  std::vector<std::string> fullSubPathHLTFolders = dbe_->getSubdirs();
90  for(unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {
91 
92  if (verbose_) std::cout <<"fullSub: "<<fullSubPathHLTFolders[j] << std::endl;
93 
94  if( strcmp(fullSubPathHLTFolders[j].c_str(), "HcalNoiseRatesD/NoiseRatesTask") ==0 ){
95  hcalMEs = dbe_->getContents(fullSubPathHLTFolders[j]);
96  if (verbose_) std::cout <<"hltMES size : "<<hcalMEs.size()<<std::endl;
97  if( !NoiseRatesEndjob(hcalMEs) ) std::cout<<"\nError in NoiseRatesEndjob!"<<std::endl<<std::endl;
98  }
99 
100  }
101 
102  }
103 
104 }
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1647
int NoiseRatesEndjob(const std::vector< MonitorElement * > &hcalMEs)
int j
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1725
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655

Member Data Documentation

edm::ParameterSet HcalNoiseRatesClient::conf_
private

Definition at line 42 of file HcalNoiseRatesClient.h.

DQMStore* HcalNoiseRatesClient::dbe_
private

Definition at line 39 of file HcalNoiseRatesClient.h.

Referenced by endJob(), HcalNoiseRatesClient(), and runClient_().

bool HcalNoiseRatesClient::debug_
private

Definition at line 45 of file HcalNoiseRatesClient.h.

Referenced by HcalNoiseRatesClient().

std::string HcalNoiseRatesClient::dirName_
private

Definition at line 47 of file HcalNoiseRatesClient.h.

Referenced by HcalNoiseRatesClient(), and runClient_().

std::string HcalNoiseRatesClient::dirNameJet_
private

Definition at line 48 of file HcalNoiseRatesClient.h.

std::string HcalNoiseRatesClient::dirNameMET_
private

Definition at line 49 of file HcalNoiseRatesClient.h.

std::string HcalNoiseRatesClient::outputFile_
private

Definition at line 40 of file HcalNoiseRatesClient.h.

Referenced by endJob(), and HcalNoiseRatesClient().

bool HcalNoiseRatesClient::verbose_
private

Definition at line 44 of file HcalNoiseRatesClient.h.

Referenced by HcalNoiseRatesClient(), and runClient_().