CMS 3D CMS Logo

Public Member Functions | Private Attributes

JetMETHLTOfflineClient Class Reference

#include <JetMETHLTOfflineClient.h>

Inheritance diagram for JetMETHLTOfflineClient:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
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)
 JetMETHLTOfflineClient (const edm::ParameterSet &)
virtual void runClient_ ()
virtual ~JetMETHLTOfflineClient ()

Private Attributes

edm::ParameterSet conf_
DQMStoredbe_
bool debug_
std::string dirName_
std::string hltTag_
std::string processname_
bool verbose_

Detailed Description

Definition at line 51 of file JetMETHLTOfflineClient.h.


Constructor & Destructor Documentation

JetMETHLTOfflineClient::JetMETHLTOfflineClient ( const edm::ParameterSet iConfig) [explicit]

Definition at line 11 of file JetMETHLTOfflineClient.cc.

References gather_cfg::cout, dbe_, debug_, dirName_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltTag_, cppFunctionSkipper::operator, processname_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), and verbose_.

                                                                            :conf_(iConfig)
{
  dbe_ = edm::Service<DQMStore>().operator->();
  if (!dbe_) {
    edm::LogError("JetMETHLTOfflineClient") << "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;

  processname_ = iConfig.getParameter<std::string>("processname");

  hltTag_ = iConfig.getParameter<std::string>("hltTag");
  if (debug_) std::cout << hltTag_ << std::endl;
  
  dirName_=iConfig.getParameter<std::string>("DQMDirName");
  if(dbe_) dbe_->setCurrentFolder(dirName_);
 
}
JetMETHLTOfflineClient::~JetMETHLTOfflineClient ( ) [virtual]

Definition at line 35 of file JetMETHLTOfflineClient.cc.

{ 
  
}

Member Function Documentation

void JetMETHLTOfflineClient::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 63 of file JetMETHLTOfflineClient.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 40 of file JetMETHLTOfflineClient.cc.

{
 

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

Reimplemented from edm::EDAnalyzer.

Definition at line 51 of file JetMETHLTOfflineClient.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 46 of file JetMETHLTOfflineClient.cc.

{

}
void JetMETHLTOfflineClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 68 of file JetMETHLTOfflineClient.cc.

References runClient_().

{ 
  runClient_();
}
void JetMETHLTOfflineClient::endRun ( const edm::Run run,
const edm::EventSetup c 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 57 of file JetMETHLTOfflineClient.cc.

References runClient_().

{
  runClient_();
}
void JetMETHLTOfflineClient::runClient_ ( ) [virtual]

Definition at line 73 of file JetMETHLTOfflineClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), gather_cfg::cout, dbe_, debug_, dirName_, spr::find(), DQMStore::getContents(), edm::getName(), DQMStore::getSubdirs(), MonitorElement::getTH1F(), i, j, gen::k, prof2calltree::l, LogDebug, mergeVDriftHistosByStation::name, DQMStore::setCurrentFolder(), and indexGen::title.

Referenced by endLuminosityBlock(), and endRun().

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

  LogDebug("JetMETHLTOfflineClient") << "runClient" << std::endl;
  if (debug_) std::cout << "runClient" << std::endl; 

  std::vector<MonitorElement*> hltMEs;

  // Look at all folders, go to the subfolder which includes the string "Eff"
  std::vector<std::string> fullPathHLTFolders = dbe_->getSubdirs();
  for(unsigned int i=0;i<fullPathHLTFolders.size();i++) {
    
    // Move on only if the folder name contains "Eff" Or "Trigger Summary"
    if (debug_) std::cout << fullPathHLTFolders[i] << std::endl;
    if ((fullPathHLTFolders[i].find("Eff")!=std::string::npos)) {
      dbe_->setCurrentFolder(fullPathHLTFolders[i]);
    } 
    else {
      continue;
    }

    // Look at all subfolders, go to the subfolder which includes the string "Eff"
    std::vector<std::string> fullSubPathHLTFolders = dbe_->getSubdirs();
    for(unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {

      if (debug_) std::cout << fullSubPathHLTFolders[j] << std::endl;      
      dbe_->setCurrentFolder(fullSubPathHLTFolders[j]);
      
      //std::cout << "PhatDEBUG: " << fullSubPathHLTFolders[j] << std::endl; 
    
      // Look at all MonitorElements in this folder
      hltMEs = dbe_->getContents(fullSubPathHLTFolders[j]);
      LogDebug("JetMETHLTOfflineClient")<< "Number of MEs for this HLT path = " << hltMEs.size() << std::endl;
      
      for(unsigned int k=0;k<hltMEs.size();k++) {
        if (debug_) std::cout << hltMEs[k]->getName() << std::endl;

        //-----
        if ((hltMEs[k]->getName().find("ME_Numerator")!=std::string::npos) && hltMEs[k]->getName().find("ME_Numerator")==0){

          std::string name = hltMEs[k]->getName();
          name.erase(0,12); // Removed "ME_Numerator"
          if (debug_) std::cout <<"==name=="<< name << std::endl;
//        if( name.find("EtaPhi") !=std::string::npos ) continue; // do not consider EtaPhi 2D plots

//        MonitorElement* eff ;

          //std::cout << "PhatDEBUG: name = " << name << std::endl;

          for(unsigned int l=0;l<hltMEs.size();l++) {
            if (hltMEs[l]->getName() == "ME_Denominator"+name){
              // found denominator too
              if(name.find("EtaPhi") !=std::string::npos) {
                TH2F* tNumerator   = hltMEs[k]->getTH2F();
                TH2F* tDenominator = hltMEs[l]->getTH2F();
                
                std::string title = "Eff_"+hltMEs[k]->getTitle();
                
                TH2F *teff = (TH2F*) tNumerator->Clone(title.c_str());
                teff->Divide(tNumerator,tDenominator,1,1);
                dbe_->book2D("ME_Eff_"+name,teff);
                delete teff;
                //std::cout << "PhatDEBUG: EtaPhiEff" <<std::endl;
              }
              else{
                TH1F* tNumerator   = hltMEs[k]->getTH1F();
                TH1F* tDenominator = hltMEs[l]->getTH1F();
                
                std::string title = "Eff_"+hltMEs[k]->getTitle();
                
                TH1F *teff = (TH1F*) tNumerator->Clone(title.c_str());
                teff->Divide(tNumerator,tDenominator,1,1);
                dbe_->book1D("ME_Eff_"+name,teff);
                delete teff;
                //std::cout << "PhatDEBUG: MMMM" <<std::endl;
              }
            } // Denominator
          }   // Loop-l
        }     // Numerator
        
        
      }       // Loop-k
    }         // fullSubPath
  }           // fullPath
}

Member Data Documentation

Definition at line 56 of file JetMETHLTOfflineClient.h.

Definition at line 54 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient(), and runClient_().

Definition at line 58 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient(), and runClient_().

std::string JetMETHLTOfflineClient::dirName_ [private]

Definition at line 61 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient(), and runClient_().

std::string JetMETHLTOfflineClient::hltTag_ [private]

Definition at line 62 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient().

std::string JetMETHLTOfflineClient::processname_ [private]

Definition at line 63 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient().

Definition at line 59 of file JetMETHLTOfflineClient.h.

Referenced by JetMETHLTOfflineClient().