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
NoiseRatesClient Class Reference

#include <NoiseRatesClient.h>

Inheritance diagram for NoiseRatesClient:
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)
 
 NoiseRatesClient (const edm::ParameterSet &)
 
int NoiseRatesEndjob (const std::vector< MonitorElement * > &hcalMEs)
 
virtual void runClient_ ()
 
virtual ~NoiseRatesClient ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) 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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 NoiseRatesClient.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file NoiseRatesClient.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("NoiseRatesClient") << "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
std::string dirName_
edm::ParameterSet conf_
void setVerbose(unsigned level)
Definition: DQMStore.cc:398
std::string outputFile_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
NoiseRatesClient::~NoiseRatesClient ( )
virtual

Definition at line 34 of file NoiseRatesClient.cc.

35 {
36 
37 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 62 of file NoiseRatesClient.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file NoiseRatesClient.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 50 of file NoiseRatesClient.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file NoiseRatesClient.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="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118
std::string outputFile_
void NoiseRatesClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 67 of file NoiseRatesClient.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 56 of file NoiseRatesClient.cc.

References runClient_().

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

Definition at line 108 of file NoiseRatesClient.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 NoiseRatesClient::runClient_ ( )
virtual

Definition at line 72 of file NoiseRatesClient.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., CaloTowersV/CaloTowersTask, HcalRecHitsV/HcalRecHitTask, NoiseRatesV/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(), "NoiseRatesV/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:1424
std::string dirName_
int j
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1502
int NoiseRatesEndjob(const std::vector< MonitorElement * > &hcalMEs)
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434

Member Data Documentation

edm::ParameterSet NoiseRatesClient::conf_
private

Definition at line 42 of file NoiseRatesClient.h.

DQMStore* NoiseRatesClient::dbe_
private

Definition at line 39 of file NoiseRatesClient.h.

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

bool NoiseRatesClient::debug_
private

Definition at line 45 of file NoiseRatesClient.h.

Referenced by NoiseRatesClient().

std::string NoiseRatesClient::dirName_
private

Definition at line 47 of file NoiseRatesClient.h.

Referenced by NoiseRatesClient(), and runClient_().

std::string NoiseRatesClient::dirNameJet_
private

Definition at line 48 of file NoiseRatesClient.h.

std::string NoiseRatesClient::dirNameMET_
private

Definition at line 49 of file NoiseRatesClient.h.

std::string NoiseRatesClient::outputFile_
private

Definition at line 40 of file NoiseRatesClient.h.

Referenced by endJob(), and NoiseRatesClient().

bool NoiseRatesClient::verbose_
private

Definition at line 44 of file NoiseRatesClient.h.

Referenced by NoiseRatesClient(), and runClient_().