CMS 3D CMS Logo

Public Member Functions | Public Attributes

HEff1DHit Class Reference

#include <Histograms.h>

List of all members.

Public Member Functions

void ComputeEfficiency ()
void Fill (float distSimHit, float etaSimHit, float phiSimHit, bool fillRecHit)
 HEff1DHit (std::string name_, DQMStore *dbe_)
 ~HEff1DHit ()

Public Attributes

MonitorElementhDistMuSimHit
MonitorElementhDistRecHit
TH1F * hEffVsDist
TH1F * hEffVsEta
TH1F * hEffVsPhi
MonitorElementhEtaMuSimHit
MonitorElementhEtaRecHit
MonitorElementhPhiMuSimHit
MonitorElementhPhiRecHit
TString name

Detailed Description

Definition at line 165 of file Histograms.h.


Constructor & Destructor Documentation

HEff1DHit::HEff1DHit ( std::string  name_,
DQMStore dbe_ 
) [inline]

Definition at line 167 of file Histograms.h.

References DQMStore::book1D(), hDistMuSimHit, hDistRecHit, hEffVsDist, hEffVsEta, hEffVsPhi, hEtaMuSimHit, hEtaRecHit, hPhiMuSimHit, hPhiRecHit, name, Pi, and DQMStore::setCurrentFolder().

                                             {
      std::string pre ="1D_";
      pre += name_;
      name = pre;
      dbe_->setCurrentFolder("DT/1DRecHits/");
      hEtaMuSimHit=0; hEtaMuSimHit = dbe_->book1D(pre+"_hEtaMuSimHit", "SimHit Eta distribution",100, -1.5, 1.5);
      hEtaRecHit=0; hEtaRecHit = dbe_->book1D(pre+"_hEtaRecHit", "SimHit Eta distribution with 1D RecHit",100, -1.5, 1.5);
      hEffVsEta = 0;
      hPhiMuSimHit=0; hPhiMuSimHit = dbe_->book1D(pre+"_hPhiMuSimHit", "SimHit Phi distribution",100, -TMath::Pi(),TMath::Pi());
      hPhiRecHit=0; hPhiRecHit = dbe_->book1D(pre+"_hPhiRecHit", "SimHit Phi distribution with 1D RecHit",100, -TMath::Pi(),TMath::Pi());
      hEffVsPhi = 0;
      hDistMuSimHit=0;hDistMuSimHit = dbe_->book1D(pre+"_hDistMuSimHit", "SimHit Distance from wire distribution",100, 0, 2.5);
      hDistRecHit=0; hDistRecHit = dbe_->book1D(pre+"_hDistRecHit", "SimHit Distance from wire distribution with 1D RecHit",100, 0, 2.5);
      hEffVsDist = 0;

    }
HEff1DHit::~HEff1DHit ( ) [inline]

Definition at line 200 of file Histograms.h.

                {

      //     delete hEtaMuSimHit;
      //     delete hEtaRecHit;
      //     if(hEffVsEta != 0)
      //       delete hEffVsEta;

      //     delete hPhiMuSimHit;
      //     delete hPhiRecHit;
      //     if(hEffVsPhi != 0)
      //       delete hEffVsPhi;

      //     delete hDistMuSimHit;
      //     delete hDistRecHit;
      //     if(hEffVsDist != 0)
      //       delete hEffVsDist;

    }

Member Function Documentation

void HEff1DHit::ComputeEfficiency ( ) [inline]

Definition at line 236 of file Histograms.h.

References newFWLiteAna::bin, error, MonitorElement::getTH1(), hDistMuSimHit, hDistRecHit, hEffVsDist, hEffVsEta, hEffVsPhi, hEtaMuSimHit, hEtaRecHit, hPhiMuSimHit, hPhiRecHit, name, and mathSSE::sqrt().

                             {


      //      hEffVsEta = (TH1F *) hEtaRecHit->Clone();
      hEffVsEta = (TH1F *) hEtaRecHit->getTH1();
      TH1F * hEffEtaMuSimHit = (TH1F *) hEtaMuSimHit->getTH1();
      hEffVsEta->SetTitle("1D RecHit Efficiency as a function of Eta");
      hEffVsEta->SetName(name+"_hEffVsEta");
      //hEffVsEta->Divide(hEtaMuSimHit);
      hEffVsEta->Divide(hEffEtaMuSimHit);
      // Set the error accordingly to binomial statistics
      int nBinsEta = hEffVsEta->GetNbinsX();
      for(int bin = 1; bin <=  nBinsEta; bin++) {
        float nSimHit = hEffEtaMuSimHit->GetBinContent(bin);
        float eff = hEffVsEta->GetBinContent(bin);
        float error = 0;
        if(nSimHit != 0) {
          error = sqrt(eff*(1-eff)/nSimHit);
        }
        hEffVsEta->SetBinError(bin, error);
      }

      //hEffVsPhi = (TH1F *) hPhiRecHit->Clone();
      hEffVsPhi = (TH1F *) hPhiRecHit->getTH1();
      TH1F * hEffPhiMuSimHit = (TH1F *) hPhiMuSimHit->getTH1();
      hEffVsPhi->SetTitle("1D RecHit Efficiency as a function of Phi");
      hEffVsPhi->SetName(name+"_hEffVsPhi");
      hEffVsPhi->Divide(hEffPhiMuSimHit);
      // Set the error accordingly to binomial statistics
      int nBinsPhi = hEffVsPhi->GetNbinsX();
      for(int bin = 1; bin <=  nBinsPhi; bin++) {
        float nSimHit = hEffPhiMuSimHit->GetBinContent(bin);
        float eff = hEffVsPhi->GetBinContent(bin);
        float error = 0;
        if(nSimHit != 0) {
          error = sqrt(eff*(1-eff)/nSimHit);
        }
        hEffVsPhi->SetBinError(bin, error);
      }

      //hEffVsDist = (TH1F *) hDistRecHit->Clone();
      hEffVsDist = (TH1F *) hDistRecHit->getTH1();
      TH1F * hEffDistMuSimHit = (TH1F *) hDistMuSimHit->getTH1();
      hEffVsDist->SetTitle("1D RecHit Efficiency as a function of Dist");
      hEffVsDist->SetName(name+"_hEffVsDist");
      hEffVsDist->Divide(hEffDistMuSimHit);
      // Set the error accordingly to binomial statistics
      int nBinsDist = hEffVsDist->GetNbinsX();
      for(int bin = 1; bin <=  nBinsDist; bin++) {
        float nSimHit = hEffDistMuSimHit->GetBinContent(bin);
        float eff = hEffVsDist->GetBinContent(bin);
        float error = 0;
        if(nSimHit != 0) {
          error = sqrt(eff*(1-eff)/nSimHit);
        }
        hEffVsDist->SetBinError(bin, error);
      }


    }
void HEff1DHit::Fill ( float  distSimHit,
float  etaSimHit,
float  phiSimHit,
bool  fillRecHit 
) [inline]

Definition at line 219 of file Histograms.h.

References MonitorElement::Fill(), hDistMuSimHit, hDistRecHit, hEtaMuSimHit, hEtaRecHit, hPhiMuSimHit, and hPhiRecHit.

Referenced by DTRecHitQuality::compute().

                               {
      
      hEtaMuSimHit->Fill(etaSimHit);
      hPhiMuSimHit->Fill(phiSimHit);
      hDistMuSimHit->Fill(distSimHit);
      if(fillRecHit) {
        hEtaRecHit->Fill(etaSimHit);
        hPhiRecHit->Fill(phiSimHit);
        hDistRecHit->Fill(distSimHit);
      }
    }

Member Data Documentation

Definition at line 321 of file Histograms.h.

Referenced by ComputeEfficiency(), Fill(), and HEff1DHit().

Definition at line 322 of file Histograms.h.

Referenced by ComputeEfficiency(), Fill(), and HEff1DHit().

Definition at line 323 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff1DHit().

Definition at line 315 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff1DHit().

Definition at line 319 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff1DHit().

Definition at line 313 of file Histograms.h.

Referenced by ComputeEfficiency(), Fill(), and HEff1DHit().

Definition at line 314 of file Histograms.h.

Referenced by ComputeEfficiency(), Fill(), and HEff1DHit().

Definition at line 317 of file Histograms.h.

Referenced by ComputeEfficiency(), Fill(), and HEff1DHit().

Definition at line 318 of file Histograms.h.

Referenced by ComputeEfficiency(), Fill(), and HEff1DHit().

TString HEff1DHit::name

Definition at line 325 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff1DHit().