CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQM/RPCMonitorClient/src/RPCRechitProbabilityClient.cc

Go to the documentation of this file.
00001 // Original Author:  Anna Cimmino
00002 
00003 #include "DQM/RPCMonitorClient/interface/RPCRecHitProbabilityClient.h"
00004 //Framework
00005 #include "FWCore/ServiceRegistry/interface/Service.h"
00006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00007 //DQMServices
00008 #include "DQMServices/Core/interface/MonitorElement.h"
00009 
00010 #include <string>
00011 
00012 RPCRecHitProbabilityClient::RPCRecHitProbabilityClient(const edm::ParameterSet& iConfig){
00013 
00014   edm::LogVerbatim ("rpcdqmclient") << "[RPCRecHitProbabilityClient]: Constructor";
00015 
00016   
00017   std::string subsystemFolder= iConfig.getUntrackedParameter<std::string>("RPCFolder", "RPC");
00018   std::string recHitTypeFolder= iConfig.getUntrackedParameter<std::string>("MuonFolder", "Muon");
00019 
00020   std::string summaryFolder = iConfig.getUntrackedParameter<std::string>("GlobalFolder", "SummaryHistograms");
00021 
00022   globalFolder_ = subsystemFolder + "/"+ recHitTypeFolder + "/"+ summaryFolder ;
00023 
00024 }
00025 
00026 RPCRecHitProbabilityClient::~RPCRecHitProbabilityClient(){dbe_ = 0;}
00027 
00028 void RPCRecHitProbabilityClient::beginJob(){
00029 
00030   edm::LogVerbatim ("rpcrechitprobabilityclient") << "[RPCRecHitProbabilityClient]: Begin Job";
00031 
00032   dbe_ = edm::Service<DQMStore>().operator->();
00033   dbe_->setVerbose(0);
00034   
00035 }
00036 
00037 
00038 void  RPCRecHitProbabilityClient::beginRun(const edm::Run& r, const edm::EventSetup& c){}
00039 
00040 void RPCRecHitProbabilityClient::beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) {}
00041 
00042 void RPCRecHitProbabilityClient::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){}
00043 
00044 void RPCRecHitProbabilityClient::endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& c){}
00045 
00046 void  RPCRecHitProbabilityClient::endRun(const edm::Run& r, const edm::EventSetup& c){
00047   
00048   edm::LogVerbatim ("rpcrechitprobabilityclient") << "[RPCRecHitProbabilityClient]: End Run";
00049   
00050   MonitorElement *  NumberOfMuonEta = dbe_->get( globalFolder_ +"/NumberOfMuonEta");
00051   MonitorElement *  NumberOfMuonPt_B = dbe_->get( globalFolder_ + "/NumberOfMuonPt_Barrel");
00052   MonitorElement *  NumberOfMuonPt_EP = dbe_->get( globalFolder_ + "/NumberOfMuonPt_EndcapP");
00053   MonitorElement *  NumberOfMuonPt_EM = dbe_->get( globalFolder_ + "/NumberOfMuonPt_EndcapM");
00054   MonitorElement *  NumberOfMuonPhi_B = dbe_->get( globalFolder_ + "/NumberOfMuonPhi_Barrel");
00055   MonitorElement *  NumberOfMuonPhi_EP = dbe_->get( globalFolder_ + "/NumberOfMuonPhi_EndcapP");
00056   MonitorElement *  NumberOfMuonPhi_EM = dbe_->get( globalFolder_ + "/NumberOfMuonPhi_EndcapM");
00057   
00058   if(NumberOfMuonEta == 0  || 
00059      NumberOfMuonPt_B == 0  || NumberOfMuonPt_EP == 0  || NumberOfMuonPt_EM == 0  || 
00060      NumberOfMuonPhi_B == 0  || NumberOfMuonPhi_EP == 0  || NumberOfMuonPhi_EM == 0 ) return;
00061 
00062 
00063   TH1F *    NumberOfMuonEtaTH1F = NumberOfMuonEta->getTH1F(); 
00064   TH1F *    NumberOfMuonPtBTH1F = NumberOfMuonPt_B->getTH1F(); 
00065   TH1F *    NumberOfMuonPtEPTH1F = NumberOfMuonPt_EP->getTH1F(); 
00066   TH1F *    NumberOfMuonPtEMTH1F = NumberOfMuonPt_EM->getTH1F(); 
00067   TH1F *    NumberOfMuonPhiBTH1F = NumberOfMuonPhi_B->getTH1F(); 
00068   TH1F *    NumberOfMuonPhiEPTH1F = NumberOfMuonPhi_EP->getTH1F(); 
00069   TH1F *    NumberOfMuonPhiEMTH1F = NumberOfMuonPhi_EM->getTH1F(); 
00070       
00071   MonitorElement *  recHit;
00072   TH1F *  recHitTH1F; 
00073   std::stringstream name;
00074       
00075   for(int i = 1 ; i<= 6  ; i++) {
00076     
00077     recHit = NULL;
00078     recHitTH1F = NULL;
00079 
00080     name.str("");
00081     name<< globalFolder_ <<"/"<<i<<"RecHitMuonEta";
00082     recHit = dbe_->get(name.str());
00083 
00084     if(recHit){
00085       
00086       recHitTH1F = recHit->getTH1F(); 
00087       recHitTH1F->Divide(NumberOfMuonEtaTH1F);
00088     }
00089 
00090     recHit = NULL;
00091     recHitTH1F = NULL;
00092 
00093     name.str("");
00094     name<< globalFolder_ <<"/"<<i<<"RecHitMuonPtB";
00095     recHit = dbe_->get(name.str());
00096 
00097     if(recHit){      
00098       recHitTH1F = recHit->getTH1F(); 
00099       recHitTH1F->Divide(NumberOfMuonPtBTH1F);
00100     }
00101 
00102     recHit = NULL;
00103     recHitTH1F = NULL;
00104     
00105     name.str("");
00106     name<< globalFolder_ <<"/"<<i<<"RecHitMuonPhiB";
00107     recHit = dbe_->get(name.str());
00108 
00109     if(recHit){      
00110       recHitTH1F = recHit->getTH1F(); 
00111       recHitTH1F->Divide(NumberOfMuonPhiBTH1F);
00112     }
00113 
00114     recHit = NULL;
00115     recHitTH1F = NULL;
00116 
00117     name.str("");
00118     name<< globalFolder_ <<"/"<<i<<"RecHitMuonPtEP";
00119     recHit = dbe_->get(name.str());
00120 
00121     if(recHit){      
00122       recHitTH1F = recHit->getTH1F(); 
00123       recHitTH1F->Divide(NumberOfMuonPtEPTH1F);
00124     }
00125 
00126     recHit = NULL;
00127     recHitTH1F = NULL;
00128 
00129     name.str("");
00130     name<< globalFolder_ <<"/"<<i<<"RecHitMuonPhiEP";
00131     recHit = dbe_->get(name.str());
00132 
00133     if(recHit){      
00134       recHitTH1F = recHit->getTH1F(); 
00135       recHitTH1F->Divide(NumberOfMuonPhiEPTH1F);
00136     }
00137 
00138     
00139     recHit = NULL;
00140     recHitTH1F = NULL;
00141 
00142     name.str("");
00143     name<< globalFolder_ <<"/"<<i<<"RecHitMuonPtEM";
00144     recHit = dbe_->get(name.str());
00145 
00146     if(recHit){      
00147       recHitTH1F = recHit->getTH1F(); 
00148       recHitTH1F->Divide(NumberOfMuonPtEMTH1F);
00149     }
00150 
00151     recHit = NULL;
00152     recHitTH1F = NULL;
00153 
00154     name.str("");
00155     name<< globalFolder_ <<"/"<<i<<"RecHitMuonPhiEM";
00156     recHit = dbe_->get(name.str());
00157 
00158     if(recHit){     
00159       recHitTH1F = recHit->getTH1F(); 
00160       recHitTH1F->Divide(NumberOfMuonPhiEMTH1F);
00161     }
00162 
00163 
00164 
00165   }
00166 
00167 }
00168 
00169 void RPCRecHitProbabilityClient::endJob() {}
00170 
00171