CMS 3D CMS Logo

Public Member Functions | Private Attributes

HcalNoiseRatesClient Class Reference

#include <HcalNoiseRatesClient.h>

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

List of all members.

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 ()

Private Attributes

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

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_.

                                                                        :conf_(iConfig)
{

  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");

  dbe_ = edm::Service<DQMStore>().operator->();
  if (!dbe_) {
    edm::LogError("HcalNoiseRatesClient") << "unable to get DQMStore service, upshot is no client histograms will be made";
  }
  if(iConfig.getUntrackedParameter<bool>("DQMStore", false)) {
    if(dbe_) dbe_->setVerbose(0);
  }
 
  debug_ = false;
  verbose_ = false;

  dirName_=iConfig.getParameter<std::string>("DQMDirName");
  if(dbe_) dbe_->setCurrentFolder(dirName_);
 
}
HcalNoiseRatesClient::~HcalNoiseRatesClient ( ) [virtual]

Definition at line 34 of file HcalNoiseRatesClient.cc.

{ 
  
}

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.

{
  
}
void HcalNoiseRatesClient::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file HcalNoiseRatesClient.cc.

{
 

}
void HcalNoiseRatesClient::beginRun ( const edm::Run run,
const edm::EventSetup c 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 50 of file HcalNoiseRatesClient.cc.

{
 
}
void HcalNoiseRatesClient::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file HcalNoiseRatesClient.cc.

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

{
   if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
}
void HcalNoiseRatesClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 67 of file HcalNoiseRatesClient.cc.

{ 
//  runClient_();
}
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_().

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

Definition at line 108 of file HcalNoiseRatesClient.cc.

References MonitorElement::Fill().

Referenced by runClient_().

                                                                                   {

   int useAllHistos = 0;
   MonitorElement* hLumiBlockCount =0;
   for(unsigned int ih=0; ih<hcalMEs.size(); ih++){
      if( strcmp(hcalMEs[ih]->getName().c_str(), "hLumiBlockCount") ==0  ){
         hLumiBlockCount = hcalMEs[ih];
         useAllHistos =1;
      } 
   } 
   if( useAllHistos !=0 && useAllHistos !=1 ) return 0;

// FIXME: dummy lumiCountMap.size since hLumiBlockCount is disabled
// in a general case.
   int lumiCountMapsize = -1; // dummy
   if (useAllHistos) hLumiBlockCount->Fill(0.0, lumiCountMapsize);

   return 1;

}
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().

{
  if(!dbe_) return; //we dont have the DQMStore so we cant do anything
  dbe_->setCurrentFolder(dirName_);

  if (verbose_) std::cout << "\nrunClient" << std::endl; 

  std::vector<MonitorElement*> hcalMEs;

  // Since out folders are fixed to three, we can just go over these three folders
  // i.e., CaloTowersD/CaloTowersTask, HcalRecHitsD/HcalRecHitTask, HcalNoiseRatesD/NoiseRatesTask.
  std::vector<std::string> fullPathHLTFolders = dbe_->getSubdirs();
  for(unsigned int i=0;i<fullPathHLTFolders.size();i++) {

    if (verbose_) std::cout <<"\nfullPath: "<< fullPathHLTFolders[i] << std::endl;
    dbe_->setCurrentFolder(fullPathHLTFolders[i]);

    std::vector<std::string> fullSubPathHLTFolders = dbe_->getSubdirs();
    for(unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {

      if (verbose_) std::cout <<"fullSub: "<<fullSubPathHLTFolders[j] << std::endl;

      if( strcmp(fullSubPathHLTFolders[j].c_str(), "HcalNoiseRatesD/NoiseRatesTask") ==0  ){
         hcalMEs = dbe_->getContents(fullSubPathHLTFolders[j]);
         if (verbose_) std::cout <<"hltMES size : "<<hcalMEs.size()<<std::endl;
         if( !NoiseRatesEndjob(hcalMEs) ) std::cout<<"\nError in NoiseRatesEndjob!"<<std::endl<<std::endl;
      }

    }    

  }

}

Member Data Documentation

Definition at line 42 of file HcalNoiseRatesClient.h.

Definition at line 39 of file HcalNoiseRatesClient.h.

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

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().

Definition at line 44 of file HcalNoiseRatesClient.h.

Referenced by HcalNoiseRatesClient(), and runClient_().