CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DQMOffline/EGamma/plugins/ElectronOfflineClient.cc

Go to the documentation of this file.
00001 
00002 #include "DQMOffline/EGamma/plugins/ElectronOfflineClient.h"
00003 #include "DQMServices/Core/interface/MonitorElement.h"
00004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00006 #include <string>
00007 
00008 ElectronOfflineClient::ElectronOfflineClient( const edm::ParameterSet & conf )
00009  : ElectronDqmAnalyzerBase(conf)
00010  {
00011   effHistoTitle_ = conf.getParameter<std::string>("EffHistoTitle") ;
00012  }
00013 
00014 ElectronOfflineClient::~ElectronOfflineClient()
00015  {}
00016 
00017 void ElectronOfflineClient::finalize()
00018  {
00019 //  MonitorElement * h1_matchedEle_eta = get("matchedEle_eta");
00020 //  MonitorElement * h1_matchedEle_eta_golden = get("matchedEle_eta_golden");
00021 //  MonitorElement * h1_matchedEle_eta_shower = get("matchedEle_eta_shower");
00022 //  //MonitorElement * h1_matchedEle_eta_bbrem = get("matchedEle_eta_bbrem");
00023 //  //MonitorElement * h1_matchedEle_eta_narrow = get("matchedEle_eta_narrow");
00024 //  MonitorElement * h1_matchedEle_eta_goldenFrac = cloneH1("matchedEle_eta_goldenFrac","matchedEle_eta","fraction of golden electrons") ;
00025 //  MonitorElement * h1_matchedEle_eta_showerFrac = cloneH1("matchedEle_eta_showerFrac","matchedEle_eta","fraction of showering electrons") ;
00026 //  //MonitorElement * h1_matchedEle_eta_bbremFrac = cloneH1("matchedEle_eta_bbremFrac","matchedEle_eta","fraction of bbrem electrons") ;
00027 //  //MonitorElement * h1_matchedEle_eta_narrowFrac = cloneH1("matchedEle_eta_narrowFrac","matchedEle_eta","fraction of narrow electrons") ;
00028 //  int nb, nbins=h_matchedEle_eta->getNbinsX() ;
00029 //  for (  nb=0 ; nb<nbins ; ++nb )
00030 //   {
00031 //    float content = h1_matchedEle_eta->getBinContent(nb) ;
00032 //    if (content==0.) continue ;
00033 //    float contgold =( h1_matchedEle_eta_golden->getBinContent(nb))/content ;
00034 //    float contshower =( h1_matchedEle_eta_shower->getBinContent(nb))/content ;
00035 //    //float contbbrem =( h1_matchedEle_eta_bbrem->getBinContent(nb))/content ;
00036 //    //float contnarrow =( h1_matchedEle_eta_narrow->getBinContent(nb))/content ;
00037 //    h1_matchedEle_eta_goldenFrac ->setBinContent(nb,contgold) ;
00038 //    h1_matchedEle_eta_showerFrac ->setBinContent(nb,contshower) ;
00039 //    //h1_matchedEle_eta_bbremFrac ->setBinContent(nb,contbbrem) ;
00040 //    //h1_matchedEle_eta_narrowFrac ->setBinContent(nb,contnarrow) ;
00041 //   }
00042 //  remove("matchedEle_eta") ;
00043 //  remove("matchedEle_eta_golden") ;
00044 //  remove("matchedEle_eta_shower") ;
00045 //  //remove("matchedEle_eta_bbrem") ;
00046 //  //remove("matchedEle_eta_narrow") ;
00047 
00048   setBookIndex(100) ;
00049   if (effHistoTitle_=="")
00050    {
00051     bookH1andDivide("ptEff","matchedObject_Pt","matchingObject_Pt","p_{T} (GeV/c)","Efficiency","efficiency vs p_{T}") ;
00052     bookH1andDivide("etaEff","matchedObject_Eta","matchingObject_Eta","#eta","Efficiency","efficiency vs #eta") ;
00053   //  bookH1andDivide("absEtaEff","matchedObject_AbsEta","matchingObject_AbsEta","|#eta|","Efficiency","efficiency vs |#eta|") ;
00054     bookH1andDivide("phiEff","matchedObject_Phi","matchingObject_Phi","#phi (rad)","Efficiency","efficiency vs #phi") ;
00055 //    bookH1andDivide("zEff","matchedObject_Z","matchingObject_Z","z (cm)","Efficiency","efficiency vs z") ;
00056    }
00057   else
00058    {
00059     bookH1andDivide("ptEff","matchedObject_Pt","matchingObject_Pt","p_{T} (GeV/c)","Efficiency",effHistoTitle_) ;
00060     bookH1andDivide("etaEff","matchedObject_Eta","matchingObject_Eta","#eta","Efficiency",effHistoTitle_) ;
00061   //  bookH1andDivide("absEtaEff","matchedObject_AbsEta","matchingObject_AbsEta","|#eta|","Efficiency",effHistoTitle_) ;
00062     bookH1andDivide("phiEff","matchedObject_Phi","matchingObject_Phi","#phi (rad)","Efficiency",effHistoTitle_) ;
00063 //    bookH1andDivide("zEff","matchedObject_Z","matchingObject_Z","z (cm)","Efficiency",effHistoTitle_) ;
00064    }
00065 
00066   remove("matchedObject_Pt") ;
00067   remove("matchedObject_Eta") ;
00068 //  remove("matchedObject_AbsEta") ;
00069   remove("matchedObject_Phi") ;
00070 //  remove("matchedObject_Z") ;
00071 
00072   remove("matchingObject_Pt") ;
00073   remove("matchingObject_Eta") ;
00074 //  remove("matchingObject_AbsEta") ;
00075   remove("matchingObject_Phi") ;
00076 //  remove("matchingObject_Z") ;
00077  }
00078