![]() |
![]() |
#include <Validation/RecoMuon/src/Histograms.h>
Public Member Functions | |
MonitorElement * | charge () |
MonitorElement * | computeEfficiency (MonitorElement *reco, MonitorElement *sim) |
double | computeEfficiency (HTrackVariables *sim) |
int | entries () |
MonitorElement * | eta () |
void | Fill (double pt, double eta, double phi) |
void | Fill (double p, double pt, double eta, double phi, double charge) |
void | FillDeltaR (double deltaR) |
HTrackVariables (std::string dirName_, std::string name, std::string whereIs="") | |
MonitorElement * | p () |
MonitorElement * | phi () |
MonitorElement * | pt () |
~HTrackVariables () | |
Private Attributes | |
DQMStore * | dbe_ |
std::vector< MonitorElement * > | efficiencyHistos |
MonitorElement * | hCharge |
MonitorElement * | hDeltaR |
MonitorElement * | hEta |
MonitorElement * | hEtaVsGen |
MonitorElement * | hP |
MonitorElement * | hPhi |
MonitorElement * | hPhiVsGen |
MonitorElement * | hPt |
MonitorElement * | hPtVsGen |
int | theEntries |
std::string | theName |
std::string | where |
Definition at line 26 of file Histograms.h.
HTrackVariables::HTrackVariables | ( | std::string | dirName_, | |
std::string | name, | |||
std::string | whereIs = "" | |||
) | [inline] |
Definition at line 29 of file Histograms.h.
References DQMStore::book1D(), DQMStore::cd(), dbe_, test_cfg::dirName, hCharge, hDeltaR, hEta, hEtaVsGen, hP, hPhi, hPhiVsGen, hPt, hPtVsGen, Geom::pi(), DQMStore::setCurrentFolder(), theEntries, theName, and where.
00029 :theName(name.c_str()),where(whereIs.c_str()){ 00030 dbe_ = edm::Service<DQMStore>().operator->(); 00031 dbe_->cd(); 00032 std::string dirName=dirName_; 00033 //dirName+="/"; 00034 //dirName+=name.c_str(); 00035 00036 dbe_->setCurrentFolder(dirName.c_str()); 00037 00038 hEta = dbe_->book1D(theName+"_Eta_"+where,"#eta at "+where,120,-3.,3.); 00039 hPhi = dbe_->book1D(theName+"_Phi_"+where,"#phi at "+where,100,-Geom::pi(),Geom::pi()); 00040 hP = dbe_->book1D(theName+"_P_"+where,"p_{t} at "+where,1000,0,2000); 00041 hPt = dbe_->book1D(theName+"_Pt_"+where,"p_{t} at "+where,1000,0,2000); 00042 hCharge = dbe_->book1D(theName+"_charge_"+where,"Charge at "+where,4,-2.,2.); 00043 00044 hEtaVsGen = dbe_->book1D(theName+"_EtaVsGen_"+where,"#eta at "+where,120,-3.,3.); 00045 hPhiVsGen = dbe_->book1D(theName+"_PhiVsGen_"+where,"#phi at "+where,100,-Geom::pi(),Geom::pi()); 00046 hPtVsGen = dbe_->book1D(theName+"_PtVsGen_"+where,"p_{t} at "+where,1000,0,2000); 00047 00048 hDeltaR = dbe_->book1D(theName+"_DeltaR_"+where,"Delta R w.r.t. sim track for "+where,1000,0,20); 00049 00050 theEntries = 0; 00051 }
HTrackVariables::~HTrackVariables | ( | ) | [inline] |
MonitorElement* HTrackVariables::charge | ( | void | ) | [inline] |
MonitorElement* HTrackVariables::computeEfficiency | ( | MonitorElement * | reco, | |
MonitorElement * | sim | |||
) | [inline] |
Definition at line 104 of file Histograms.h.
References DQMStore::book1D(), dbe_, error, MonitorElement::getTH1F(), me, name, funct::sqrt(), and indexGen::title.
00104 { 00105 00106 TH1F* hReco = reco->getTH1F(); 00107 TH1F* hSim = sim->getTH1F(); 00108 00109 std::string name = hReco->GetName(); 00110 std::string title = hReco->GetTitle(); 00111 00112 MonitorElement * me = dbe_->book1D( 00113 "Eff_"+name, 00114 "Efficiecny as a function of "+title, 00115 hSim->GetNbinsX(), 00116 hSim->GetXaxis()->GetXmin(), 00117 hSim->GetXaxis()->GetXmax() 00118 ); 00119 00120 me->getTH1F()->Divide(hReco,hSim,1.,1.,"b"); 00121 00122 // Set the error accordingly to binomial statistics 00123 int nBinsEta = me->getTH1F()->GetNbinsX(); 00124 for(int bin = 1; bin <= nBinsEta; bin++) { 00125 float nSimHit = hSim->GetBinContent(bin); 00126 float eff = me->getTH1F()->GetBinContent(bin); 00127 float error = 0; 00128 if(nSimHit != 0 && eff <= 1) { 00129 error = sqrt(eff*(1-eff)/nSimHit); 00130 } 00131 me->getTH1F()->SetBinError(bin, error); 00132 } 00133 00134 return me; 00135 }
double HTrackVariables::computeEfficiency | ( | HTrackVariables * | sim | ) | [inline] |
Definition at line 92 of file Histograms.h.
References efficiencyHistos, entries(), eta(), hEtaVsGen, hPhiVsGen, hPtVsGen, phi(), and pt().
Referenced by HTrack::computeEfficiency().
00092 { 00093 00094 efficiencyHistos.push_back(computeEfficiency(hEtaVsGen,sim->eta())); 00095 efficiencyHistos.push_back(computeEfficiency(hPhiVsGen,sim->phi())); 00096 // efficiencyHistos.push_back(computeEfficiency(p(),sim->p())); 00097 efficiencyHistos.push_back(computeEfficiency(hPtVsGen,sim->pt())); 00098 // efficiencyHistos.push_back(computeEfficiency(charge(),sim->charge())); 00099 00100 double efficiency = 100*entries()/sim->entries(); 00101 return efficiency; 00102 }
int HTrackVariables::entries | ( | ) | [inline] |
Definition at line 71 of file Histograms.h.
References theEntries.
Referenced by computeEfficiency().
00071 {return theEntries;}
MonitorElement* HTrackVariables::eta | ( | void | ) | [inline] |
Definition at line 66 of file Histograms.h.
References hEta.
Referenced by computeEfficiency().
00066 {return hEta;}
void HTrackVariables::Fill | ( | double | pt, | |
double | eta, | |||
double | phi | |||
) | [inline] |
void HTrackVariables::Fill | ( | double | p, | |
double | pt, | |||
double | eta, | |||
double | phi, | |||
double | charge | |||
) | [inline] |
Definition at line 73 of file Histograms.h.
References MonitorElement::Fill(), hCharge, hEta, hP, hPhi, hPt, and theEntries.
Referenced by HTrack::computeResolutionAndPull(), HTrack::Fill(), and MuonTrackAnalyzer::fillPlots().
00073 { 00074 hEta->Fill(eta); 00075 hPhi->Fill(phi); 00076 hP->Fill(p); 00077 hPt->Fill(pt); 00078 hCharge->Fill(charge); 00079 ++theEntries; 00080 }
void HTrackVariables::FillDeltaR | ( | double | deltaR | ) | [inline] |
Definition at line 88 of file Histograms.h.
References MonitorElement::Fill(), and hDeltaR.
Referenced by HTrack::FillDeltaR().
MonitorElement* HTrackVariables::p | ( | ) | [inline] |
MonitorElement* HTrackVariables::phi | ( | void | ) | [inline] |
Definition at line 67 of file Histograms.h.
References hPhi.
Referenced by computeEfficiency().
00067 {return hPhi;}
MonitorElement* HTrackVariables::pt | ( | void | ) | [inline] |
Definition at line 69 of file Histograms.h.
References hPt.
Referenced by computeEfficiency().
00069 {return hPt;}
DQMStore* HTrackVariables::dbe_ [private] |
Definition at line 139 of file Histograms.h.
Referenced by computeEfficiency(), and HTrackVariables().
std::vector<MonitorElement*> HTrackVariables::efficiencyHistos [private] |
MonitorElement* HTrackVariables::hCharge [private] |
MonitorElement* HTrackVariables::hDeltaR [private] |
MonitorElement* HTrackVariables::hEta [private] |
MonitorElement* HTrackVariables::hEtaVsGen [private] |
Definition at line 152 of file Histograms.h.
Referenced by computeEfficiency(), Fill(), and HTrackVariables().
MonitorElement* HTrackVariables::hP [private] |
MonitorElement* HTrackVariables::hPhi [private] |
MonitorElement* HTrackVariables::hPhiVsGen [private] |
Definition at line 153 of file Histograms.h.
Referenced by computeEfficiency(), Fill(), and HTrackVariables().
MonitorElement* HTrackVariables::hPt [private] |
MonitorElement* HTrackVariables::hPtVsGen [private] |
Definition at line 154 of file Histograms.h.
Referenced by computeEfficiency(), Fill(), and HTrackVariables().
int HTrackVariables::theEntries [private] |
Definition at line 144 of file Histograms.h.
Referenced by entries(), Fill(), and HTrackVariables().
std::string HTrackVariables::theName [private] |
std::string HTrackVariables::where [private] |