CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

TrackEfficiencyClient Class Reference

#include <DQM/TrackingMonitor/interface/TrackEfficiencyClient.h>

Inheritance diagram for TrackEfficiencyClient:
edm::EDAnalyzer

List of all members.

Public Member Functions

 TrackEfficiencyClient (const edm::ParameterSet &ps)
 Constructor.
virtual ~TrackEfficiencyClient ()
 Destructor.

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup)
 Analyze.
void beginJob (void)
 BeginJob.
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
 BeginRun.
void endJob ()
 Endjob.
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup)
 End Luminosity Block.
void endRun ()
 EndRun.

Private Attributes

std::string algoName_
edm::ParameterSet conf_
DQMStoredqmStore_
MonitorElementeffCompatibleLayers
MonitorElementeffD0
MonitorElementeffEta
MonitorElementeffPhi
MonitorElementeffX
MonitorElementeffY
MonitorElementeffZ
std::string FolderName_
std::string histName
bool trackEfficiency_

Detailed Description

DQM class to compute the tracking efficiency

Definition at line 33 of file TrackEfficiencyClient.h.


Constructor & Destructor Documentation

TrackEfficiencyClient::TrackEfficiencyClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 29 of file TrackEfficiencyClient.cc.

References algoName_, conf_, dqmStore_, FolderName_, edm::ParameterSet::getParameter(), cmsCodeRules::cppFunctionSkipper::operator, and trackEfficiency_.

{
  edm::LogInfo( "TrackEfficiencyClient") << "TrackEfficiencyClient::Deleting TrackEfficiencyClient ";

  // get back-end interface
  dqmStore_ = edm::Service<DQMStore>().operator->();
  
  FolderName_      = iConfig.getParameter<std::string>("FolderName");
  algoName_        = iConfig.getParameter<std::string>("AlgoName");
  trackEfficiency_ = iConfig.getParameter<bool>("trackEfficiency");
  
  conf_ = iConfig;
}
TrackEfficiencyClient::~TrackEfficiencyClient ( ) [virtual]

Destructor.

Definition at line 46 of file TrackEfficiencyClient.cc.

{
  edm::LogInfo("TrackEfficiencyClient") << "TrackEfficiencyClient::Deleting TrackEfficiencyClient ";
}

Member Function Documentation

void TrackEfficiencyClient::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
) [protected, virtual]

Analyze.

Implements edm::EDAnalyzer.

Definition at line 145 of file TrackEfficiencyClient.cc.

{
  edm::LogInfo( "TrackEfficiencyClient") << "TrackEfficiencyClient::analyze";
}
void TrackEfficiencyClient::beginJob ( void  ) [protected, virtual]

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 54 of file TrackEfficiencyClient.cc.

References algoName_, DQMStore::book1D(), conf_, dqmStore_, effCompatibleLayers, ExpressReco_HICollisions_FallBack::effCompatibleLayersBin, ExpressReco_HICollisions_FallBack::effCompatibleLayersMax, ExpressReco_HICollisions_FallBack::effCompatibleLayersMin, effD0, ExpressReco_HICollisions_FallBack::effD0Bin, ExpressReco_HICollisions_FallBack::effD0Max, ExpressReco_HICollisions_FallBack::effD0Min, effEta, ExpressReco_HICollisions_FallBack::effEtaBin, ExpressReco_HICollisions_FallBack::effEtaMax, ExpressReco_HICollisions_FallBack::effEtaMin, effPhi, ExpressReco_HICollisions_FallBack::effPhiBin, ExpressReco_HICollisions_FallBack::effPhiMax, ExpressReco_HICollisions_FallBack::effPhiMin, effX, ExpressReco_HICollisions_FallBack::effXBin, ExpressReco_HICollisions_FallBack::effXMax, ExpressReco_HICollisions_FallBack::effXMin, effY, ExpressReco_HICollisions_FallBack::effYBin, ExpressReco_HICollisions_FallBack::effYMax, ExpressReco_HICollisions_FallBack::effYMin, effZ, ExpressReco_HICollisions_FallBack::effZBin, ExpressReco_HICollisions_FallBack::effZMax, ExpressReco_HICollisions_FallBack::effZMin, FolderName_, edm::ParameterSet::getParameter(), MonitorElement::getTH1F(), histName, MonitorElement::setAxisTitle(), and DQMStore::setCurrentFolder().

{  
 
  dqmStore_->setCurrentFolder(FolderName_);
  
  //
  int    effXBin = conf_.getParameter<int>   ("effXBin");
  double effXMin = conf_.getParameter<double>("effXMin");
  double effXMax = conf_.getParameter<double>("effXMax");
 
  histName = "effX_";
  effX = dqmStore_->book1D(histName+algoName_, histName+algoName_, effXBin, effXMin, effXMax);
  if (effX->getTH1F()) effX->getTH1F()->Sumw2();
  effX->setAxisTitle("");
  

  //
  int    effYBin = conf_.getParameter<int>   ("effYBin");
  double effYMin = conf_.getParameter<double>("effYMin");
  double effYMax = conf_.getParameter<double>("effYMax");
 
  histName = "effY_";
  effY = dqmStore_->book1D(histName+algoName_, histName+algoName_, effYBin, effYMin, effYMax);
  if (effY->getTH1F()) effY->getTH1F()->Sumw2();
  effY->setAxisTitle("");
  
  //
  int    effZBin = conf_.getParameter<int>   ("effZBin");
  double effZMin = conf_.getParameter<double>("effZMin");
  double effZMax = conf_.getParameter<double>("effZMax");
 
  histName = "effZ_";
  effZ = dqmStore_->book1D(histName+algoName_, histName+algoName_, effZBin, effZMin, effZMax);
  if (effZ->getTH1F()) effZ->getTH1F()->Sumw2();
  effZ->setAxisTitle("");

  //
  int    effEtaBin = conf_.getParameter<int>   ("effEtaBin");
  double effEtaMin = conf_.getParameter<double>("effEtaMin");
  double effEtaMax = conf_.getParameter<double>("effEtaMax");
 
  histName = "effEta_";
  effEta = dqmStore_->book1D(histName+algoName_, histName+algoName_, effEtaBin, effEtaMin, effEtaMax);
  if (effEta->getTH1F()) effEta->getTH1F()->Sumw2();
  effEta->setAxisTitle("");
  
  //
  int    effPhiBin = conf_.getParameter<int>   ("effPhiBin");
  double effPhiMin = conf_.getParameter<double>("effPhiMin");
  double effPhiMax = conf_.getParameter<double>("effPhiMax");
 
  histName = "effPhi_";
  effPhi = dqmStore_->book1D(histName+algoName_, histName+algoName_, effPhiBin, effPhiMin, effPhiMax);
  if (effPhi->getTH1F()) effPhi->getTH1F()->Sumw2();
  effPhi->setAxisTitle("");
  
  //
  int    effD0Bin = conf_.getParameter<int>   ("effD0Bin");
  double effD0Min = conf_.getParameter<double>("effD0Min");
  double effD0Max = conf_.getParameter<double>("effD0Max");
 
  histName = "effD0_";
  effD0 = dqmStore_->book1D(histName+algoName_, histName+algoName_, effD0Bin, effD0Min, effD0Max);
  if (effD0->getTH1F()) effD0->getTH1F()->Sumw2();
  effD0->setAxisTitle("");
  
 
  //
  int    effCompatibleLayersBin = conf_.getParameter<int>   ("effCompatibleLayersBin");
  double effCompatibleLayersMin = conf_.getParameter<double>("effCompatibleLayersMin");
  double effCompatibleLayersMax = conf_.getParameter<double>("effCompatibleLayersMax");
 
  histName = "effCompatibleLayers_";
  effCompatibleLayers = dqmStore_->book1D(histName+algoName_, histName+algoName_, effCompatibleLayersBin, effCompatibleLayersMin, effCompatibleLayersMax);
  if (effCompatibleLayers->getTH1F()) effCompatibleLayers->getTH1F()->Sumw2();
  effCompatibleLayers->setAxisTitle("");

  edm::LogInfo("TrackEfficiencyClient") << "TrackEfficiencyClient::beginJob done";
}
void TrackEfficiencyClient::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
) [protected, virtual]

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file TrackEfficiencyClient.cc.

{
  edm::LogInfo ("TrackEfficiencyClient") <<"TrackEfficiencyClient:: Begining of Run";
}
void TrackEfficiencyClient::endJob ( void  ) [protected, virtual]

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 152 of file TrackEfficiencyClient.cc.

{
} 
void TrackEfficiencyClient::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
) [protected, virtual]

End Luminosity Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 165 of file TrackEfficiencyClient.cc.

References algoName_, dqmStore_, effCompatibleLayers, effD0, effEta, effPhi, effX, effY, effZ, FolderName_, DQMStore::get(), getTH1F(), MonitorElement::getTH1F(), histName, PatBasicFWLiteAnalyzer::muonEta, PatBasicFWLiteAnalyzer::muonPhi, trackEfficiency_, reco::btau::trackEta, and reco::btau::trackPhi.

{
 edm::LogInfo( "TrackEfficiencyClient") << "TrackEfficiencyClient::endLuminosityBlock"; 

 histName = "/trackX_";
 MonitorElement* trackX = dqmStore_->get(FolderName_+histName+algoName_);
 
 histName = "/muonX_";
 MonitorElement* muonX  = dqmStore_->get(FolderName_+histName+algoName_);
 
 histName = "/trackY_";
 MonitorElement* trackY = dqmStore_->get(FolderName_+histName+algoName_);
 histName = "/muonY_";
 MonitorElement* muonY  = dqmStore_->get(FolderName_+histName+algoName_);
 
 histName = "/trackZ_";
 MonitorElement* trackZ = dqmStore_->get(FolderName_+histName+algoName_);
 histName = "/muonZ_";
 MonitorElement* muonZ  = dqmStore_->get(FolderName_+histName+algoName_);
  
 histName = "/trackEta_";
 MonitorElement* trackEta = dqmStore_->get(FolderName_+histName+algoName_);
 histName = "/muonEta_";
 MonitorElement* muonEta  = dqmStore_->get(FolderName_+histName+algoName_);
 
 histName = "/trackPhi_";
 MonitorElement* trackPhi = dqmStore_->get(FolderName_+histName+algoName_);
 histName = "/muonPhi_";
 MonitorElement* muonPhi  = dqmStore_->get(FolderName_+histName+algoName_);
 
 histName = "/trackD0_";
 MonitorElement* trackD0 = dqmStore_->get(FolderName_+histName+algoName_);
 histName = "/muonD0_";
 MonitorElement* muonD0  = dqmStore_->get(FolderName_+histName+algoName_);

 histName = "/trackCompatibleLayers_";
 MonitorElement* trackCompatibleLayers = dqmStore_->get(FolderName_+histName+algoName_);
 histName = "/muonCompatibleLayers_";
 MonitorElement* muonCompatibleLayers  = dqmStore_->get(FolderName_+histName+algoName_);

 if(trackX && muonX && trackY && muonY && trackZ && muonZ && trackEta && muonEta && trackPhi && muonPhi && trackD0 && muonD0 && trackCompatibleLayers && muonCompatibleLayers){
   if (trackEfficiency_)
     { 
       if (effX  ->getTH1F() && trackX  ->getTH1F() && muonX  ->getTH1F()) { effX       -> getTH1F()->Divide(trackX->getTH1F(),muonX->getTH1F(),1.,1.,"");}
       if (effY  ->getTH1F() && trackY  ->getTH1F() && muonY  ->getTH1F()) { effY       -> getTH1F()->Divide(trackY->getTH1F(),muonY->getTH1F(),1.,1.,"");}
       if (effZ  ->getTH1F() && trackZ  ->getTH1F() && muonZ  ->getTH1F()) { effZ       -> getTH1F()->Divide(trackZ->getTH1F(),muonZ->getTH1F(),1.,1.,"");}
       if (effEta->getTH1F() && trackEta->getTH1F() && muonEta->getTH1F()) { effEta -> getTH1F()->Divide(trackEta->getTH1F(),muonEta->getTH1F(),1.,1.,"");}
       if (effPhi->getTH1F() && trackPhi->getTH1F() && muonPhi->getTH1F()) { effPhi -> getTH1F()->Divide(trackPhi->getTH1F(),muonPhi->getTH1F(),1.,1.,"");}
       if (effD0 ->getTH1F() && trackD0 ->getTH1F() && muonD0 ->getTH1F()) { effD0  -> getTH1F()->Divide(trackD0->getTH1F(),muonD0->getTH1F(),1.,1.,"");}
       if (effCompatibleLayers->getTH1F() && trackCompatibleLayers->getTH1F() && muonCompatibleLayers->getTH1F()) { effCompatibleLayers -> getTH1F()->Divide(trackCompatibleLayers->getTH1F(),muonCompatibleLayers->getTH1F(),1.,1.,"");}
 }
   else {
     if (effX  ->getTH1F() && trackX  ->getTH1F() && muonX  ->getTH1F()) { effX -> getTH1F()->Divide(muonX->getTH1F(),trackX->getTH1F(),1.,1.,"");}
     if (effY  ->getTH1F() && trackY  ->getTH1F() && muonY  ->getTH1F()) { effY -> getTH1F()->Divide(muonY->getTH1F(),trackY->getTH1F(),1.,1.,"");}
     if (effZ  ->getTH1F() && trackZ  ->getTH1F() && muonZ  ->getTH1F()) { effZ -> getTH1F()->Divide(muonZ->getTH1F(),trackZ->getTH1F(),1.,1.,"");}
     if (effEta->getTH1F() && trackEta->getTH1F() && muonEta->getTH1F()) { effEta -> getTH1F()->Divide(muonEta->getTH1F(),trackEta->getTH1F(),1.,1.,"");}
     if (effPhi->getTH1F() && trackPhi->getTH1F() && muonPhi->getTH1F()) { effPhi -> getTH1F()->Divide(muonPhi->getTH1F(),trackPhi->getTH1F(),1.,1.,"");}
     if (effD0 ->getTH1F() && trackD0 ->getTH1F() && muonD0 ->getTH1F()) { effD0  -> getTH1F()->Divide(muonD0->getTH1F(),trackD0->getTH1F(),1.,1.,"");}
   }
 }
 
}
void TrackEfficiencyClient::endRun ( void  ) [protected]

EndRun.

Definition at line 158 of file TrackEfficiencyClient.cc.

{
}

Member Data Documentation

std::string TrackEfficiencyClient::algoName_ [private]

Definition at line 73 of file TrackEfficiencyClient.h.

Referenced by beginJob(), endLuminosityBlock(), and TrackEfficiencyClient().

Definition at line 67 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and TrackEfficiencyClient().

Definition at line 66 of file TrackEfficiencyClient.h.

Referenced by beginJob(), endLuminosityBlock(), and TrackEfficiencyClient().

Definition at line 82 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

Definition at line 81 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

Definition at line 79 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

Definition at line 80 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

Definition at line 76 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

Definition at line 77 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

Definition at line 78 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

std::string TrackEfficiencyClient::FolderName_ [private]

Definition at line 74 of file TrackEfficiencyClient.h.

Referenced by beginJob(), endLuminosityBlock(), and TrackEfficiencyClient().

std::string TrackEfficiencyClient::histName [private]

Definition at line 72 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

Definition at line 69 of file TrackEfficiencyClient.h.

Referenced by endLuminosityBlock(), and TrackEfficiencyClient().