#include <Histograms.h>
Public Member Functions | |
MonitorElement * | charge () |
double | computeEfficiency (HTrackVariables *sim) |
MonitorElement * | computeEfficiency (MonitorElement *reco, MonitorElement *sim) |
int | entries () |
MonitorElement * | eta () |
void | Fill (double p, double pt, double eta, double phi, double charge) |
void | Fill (double pt, double eta, double phi) |
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_, TrackerOfflineValidation_Dqm_cff::dirName, hCharge, hDeltaR, hEta, hEtaVsGen, hP, hPhi, hPhiVsGen, hPt, hPtVsGen, cmsCodeRules::cppFunctionSkipper::operator, Geom::pi(), DQMStore::setCurrentFolder(), theEntries, theName, and where.
:theName(name.c_str()),where(whereIs.c_str()){ dbe_ = edm::Service<DQMStore>().operator->(); dbe_->cd(); std::string dirName=dirName_; //dirName+="/"; //dirName+=name.c_str(); dbe_->setCurrentFolder(dirName.c_str()); hEta = dbe_->book1D(theName+"_Eta_"+where,"#eta at "+where,120,-3.,3.); hPhi = dbe_->book1D(theName+"_Phi_"+where,"#phi at "+where,100,-Geom::pi(),Geom::pi()); hP = dbe_->book1D(theName+"_P_"+where,"p_{t} at "+where,1000,0,2000); hPt = dbe_->book1D(theName+"_Pt_"+where,"p_{t} at "+where,1000,0,2000); hCharge = dbe_->book1D(theName+"_charge_"+where,"Charge at "+where,4,-2.,2.); hEtaVsGen = dbe_->book1D(theName+"_EtaVsGen_"+where,"#eta at "+where,120,-3.,3.); hPhiVsGen = dbe_->book1D(theName+"_PhiVsGen_"+where,"#phi at "+where,100,-Geom::pi(),Geom::pi()); hPtVsGen = dbe_->book1D(theName+"_PtVsGen_"+where,"p_{t} at "+where,1000,0,2000); hDeltaR = dbe_->book1D(theName+"_DeltaR_"+where,"Delta R w.r.t. sim track for "+where,1000,0,20); theEntries = 0; }
HTrackVariables::~HTrackVariables | ( | ) | [inline] |
Definition at line 64 of file Histograms.h.
{}
MonitorElement* HTrackVariables::charge | ( | void | ) | [inline] |
double HTrackVariables::computeEfficiency | ( | HTrackVariables * | sim | ) | [inline] |
Definition at line 92 of file Histograms.h.
References efficiencyHistos, entries(), eta(), hEtaVsGen, hPhiVsGen, hPtVsGen, phi(), and pt().
{ efficiencyHistos.push_back(computeEfficiency(hEtaVsGen,sim->eta())); efficiencyHistos.push_back(computeEfficiency(hPhiVsGen,sim->phi())); // efficiencyHistos.push_back(computeEfficiency(p(),sim->p())); efficiencyHistos.push_back(computeEfficiency(hPtVsGen,sim->pt())); // efficiencyHistos.push_back(computeEfficiency(charge(),sim->charge())); double efficiency = 100*entries()/sim->entries(); return efficiency; }
MonitorElement* HTrackVariables::computeEfficiency | ( | MonitorElement * | reco, |
MonitorElement * | sim | ||
) | [inline] |
Definition at line 104 of file Histograms.h.
References newFWLiteAna::bin, DQMStore::book1D(), dbe_, error, MonitorElement::getTH1F(), AlCaRecoCosmics_cfg::name, mathSSE::sqrt(), and indexGen::title.
{ TH1F* hReco = reco->getTH1F(); TH1F* hSim = sim->getTH1F(); std::string name = hReco->GetName(); std::string title = hReco->GetTitle(); MonitorElement * me = dbe_->book1D( "Eff_"+name, "Efficiecny as a function of "+title, hSim->GetNbinsX(), hSim->GetXaxis()->GetXmin(), hSim->GetXaxis()->GetXmax() ); me->getTH1F()->Divide(hReco,hSim,1.,1.,"b"); // Set the error accordingly to binomial statistics int nBinsEta = me->getTH1F()->GetNbinsX(); for(int bin = 1; bin <= nBinsEta; bin++) { float nSimHit = hSim->GetBinContent(bin); float eff = me->getTH1F()->GetBinContent(bin); float error = 0; if(nSimHit != 0 && eff <= 1) { error = sqrt(eff*(1-eff)/nSimHit); } me->getTH1F()->SetBinError(bin, error); } return me; }
int HTrackVariables::entries | ( | ) | [inline] |
Definition at line 71 of file Histograms.h.
References theEntries.
Referenced by computeEfficiency().
{return theEntries;}
MonitorElement* HTrackVariables::eta | ( | void | ) | [inline] |
Definition at line 66 of file Histograms.h.
References hEta.
Referenced by computeEfficiency().
{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(), and HTrack::Fill().
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().
{return hPhi;}
MonitorElement* HTrackVariables::pt | ( | ) | [inline] |
Definition at line 69 of file Histograms.h.
References hPt.
Referenced by computeEfficiency().
{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] |
Definition at line 158 of file Histograms.h.
Referenced by computeEfficiency().
MonitorElement* HTrackVariables::hCharge [private] |
Definition at line 150 of file Histograms.h.
Referenced by charge(), Fill(), and HTrackVariables().
MonitorElement* HTrackVariables::hDeltaR [private] |
Definition at line 156 of file Histograms.h.
Referenced by FillDeltaR(), and HTrackVariables().
MonitorElement* HTrackVariables::hEta [private] |
Definition at line 146 of file Histograms.h.
Referenced by eta(), Fill(), and HTrackVariables().
MonitorElement* HTrackVariables::hEtaVsGen [private] |
Definition at line 152 of file Histograms.h.
Referenced by computeEfficiency(), Fill(), and HTrackVariables().
MonitorElement* HTrackVariables::hP [private] |
Definition at line 148 of file Histograms.h.
Referenced by Fill(), HTrackVariables(), and p().
MonitorElement* HTrackVariables::hPhi [private] |
Definition at line 147 of file Histograms.h.
Referenced by Fill(), HTrackVariables(), and phi().
MonitorElement* HTrackVariables::hPhiVsGen [private] |
Definition at line 153 of file Histograms.h.
Referenced by computeEfficiency(), Fill(), and HTrackVariables().
MonitorElement* HTrackVariables::hPt [private] |
Definition at line 149 of file Histograms.h.
Referenced by Fill(), HTrackVariables(), and pt().
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] |
Definition at line 141 of file Histograms.h.
Referenced by HTrackVariables().
std::string HTrackVariables::where [private] |
Definition at line 142 of file Histograms.h.
Referenced by HTrackVariables().