CMS 3D CMS Logo

Public Member Functions | Private Attributes

NoiseRatesClient Class Reference

#include <NoiseRatesClient.h>

Inheritance diagram for NoiseRatesClient:
edm::EDAnalyzer

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)
 NoiseRatesClient (const edm::ParameterSet &)
int NoiseRatesEndjob (const std::vector< MonitorElement * > &hcalMEs)
virtual void runClient_ ()
virtual ~NoiseRatesClient ()

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 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_, and verbose_.

                                                                :conf_(iConfig)
{

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

  dbe_ = edm::Service<DQMStore>().operator->();
  if (!dbe_) {
    edm::LogError("NoiseRatesClient") << "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_);
 
}
NoiseRatesClient::~NoiseRatesClient ( ) [virtual]

Definition at line 34 of file NoiseRatesClient.cc.

{ 
  
}

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.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file NoiseRatesClient.cc.

{
 

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

Reimplemented from edm::EDAnalyzer.

Definition at line 50 of file NoiseRatesClient.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file NoiseRatesClient.cc.

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

{
   if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(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.

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

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

Definition at line 108 of file NoiseRatesClient.cc.

References MonitorElement::Fill(), and edm::getName().

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

{
  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., CaloTowersV/CaloTowersTask, HcalRecHitsV/HcalRecHitTask, NoiseRatesV/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(), "NoiseRatesV/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 NoiseRatesClient.h.

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

Definition at line 44 of file NoiseRatesClient.h.

Referenced by NoiseRatesClient(), and runClient_().