CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
HEff2DHit Class Reference

#include <Histograms.h>

Public Member Functions

void ComputeEfficiency ()
 
void Fill (float etaSimSegm, float phiSimSegm, float posSimSegm, float angleSimSegm, bool fillRecHit)
 
 HEff2DHit (std::string name_, DQMStore *dbe_)
 
 ~HEff2DHit ()
 

Public Attributes

MonitorElementhAngleRecHit
 
MonitorElementhAngleSimSegm
 
TH1F * hEffVsAngle
 
TH1F * hEffVsEta
 
TH1F * hEffVsPhi
 
TH1F * hEffVsPos
 
MonitorElementhEtaRecHit
 
MonitorElementhEtaSimSegm
 
MonitorElementhPhiRecHit
 
MonitorElementhPhiSimSegm
 
MonitorElementhPosRecHit
 
MonitorElementhPosSimSegm
 
TString name
 

Detailed Description

Definition at line 456 of file Histograms.h.

Constructor & Destructor Documentation

HEff2DHit::HEff2DHit ( std::string  name_,
DQMStore dbe_ 
)
inline

Definition at line 458 of file Histograms.h.

References DQMStore::book1D(), hAngleRecHit, hAngleSimSegm, hEffVsAngle, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hPosRecHit, hPosSimSegm, name, Pi, DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

458  {
459  std::string pre ="2D_";
460  pre += name_;
461  name = pre;
462  dbe_->setCurrentFolder("DT/2DSegments/");
463  hEtaSimSegm=0;hEtaSimSegm = dbe_->book1D(pre+"_hEtaSimSegm", "Eta of SimHit segment", 100, -1.5, 1.5);
464  hEtaRecHit=0;hEtaRecHit = dbe_->book1D(pre+"_hEtaRecHit", "Eta distribution of SimHit segment with 2D RecHit",
465  100, -1.5, 1.5);
466  //hEffVsEta = 0;
467 
468  hPhiSimSegm=0;hPhiSimSegm = dbe_->book1D(pre+"_hPhiSimSegm", "Phi of SimHit segment",
469  100, -TMath::Pi(),TMath::Pi());
470  hPhiRecHit=0;hPhiRecHit = dbe_->book1D(pre+"_hPhiRecHit", "Phi distribution of SimHit segment with 2D RecHit",
471  100, -TMath::Pi(),TMath::Pi());
472  //hEffVsPhi = 0;
473 
474 
475  hPosSimSegm=0;hPosSimSegm = dbe_->book1D(pre+"_hPosSimSegm", "Position in SL of SimHit segment (cm)",
476  100, -250, 250);
477  hPosRecHit=0;hPosRecHit = dbe_->book1D(pre+"_hPosRecHit", "Position in SL of SimHit segment with 2D RecHit (cm)",
478  100, -250, 250);
479  //hEffVsPos = 0;
480 
481 
482  hAngleSimSegm=0;hAngleSimSegm = dbe_->book1D(pre+"_hAngleSimSegm", "Angle of SimHit segment (rad)",
483  100, -2, 2);
484  hAngleRecHit=0;hAngleRecHit = dbe_->book1D(pre+"_hAngleRecHit", "Angle of SimHit segment with 2D RecHit (rad)",
485  100, -2, 2);
486  hEffVsAngle=0;hEffVsAngle = 0;
487 
488  }
const double Pi
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
TString name
Definition: Histograms.h:663
MonitorElement * hPosRecHit
Definition: Histograms.h:657
MonitorElement * hEtaSimSegm
Definition: Histograms.h:650
MonitorElement * hPhiRecHit
Definition: Histograms.h:654
MonitorElement * hAngleSimSegm
Definition: Histograms.h:659
TH1F * hEffVsAngle
Definition: Histograms.h:661
MonitorElement * hPosSimSegm
Definition: Histograms.h:656
MonitorElement * hAngleRecHit
Definition: Histograms.h:660
MonitorElement * hPhiSimSegm
Definition: Histograms.h:653
MonitorElement * hEtaRecHit
Definition: Histograms.h:651
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
HEff2DHit::~HEff2DHit ( )
inline

Definition at line 510 of file Histograms.h.

510  {
511  //delete hEtaSimSegm;
512  //delete hEtaRecHit;
513  //if(hEffVsEta != 0)
514  // delete hEffVsEta;
515 
516  //delete hPhiSimSegm;
517  //delete hPhiRecHit;
518  //if(hEffVsPhi != 0)
519  // delete hEffVsPhi;
520 
521  //delete hPosSimSegm;
522  //delete hPosRecHit;
523  //if(hEffVsPos != 0)
524  // delete hEffVsPos;
525 
526  //delete hAngleSimSegm;
527  //delete hAngleRecHit;
528  //if(hEffVsAngle != 0)
529  // delete hEffVsAngle;
530  }

Member Function Documentation

void HEff2DHit::ComputeEfficiency ( )
inline

Definition at line 552 of file Histograms.h.

References newFWLiteAna::bin, error, MonitorElement::getTH1(), hAngleRecHit, hAngleSimSegm, hEffVsAngle, hEffVsEta, hEffVsPhi, hEffVsPos, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hPosRecHit, hPosSimSegm, name, and mathSSE::sqrt().

552  {
553 
554  //hEffVsEta = (TH1F *) hEtaRecHit->Clone();
555  hEffVsEta = (TH1F *) hEtaRecHit->getTH1();
556  TH1F * hEffEtaSimSegm = (TH1F *) hEtaSimSegm->getTH1();
557  hEffVsEta->SetTitle("2D RecHit Efficiency as a function of Eta");
558  hEffVsEta->SetName(name+"_hEffVsEta");
559  hEffVsEta->Divide(hEffEtaSimSegm);
560  // Set the error accordingly to binomial statistics
561  int nBinsEta = hEffVsEta->GetNbinsX();
562  for(int bin = 1; bin <= nBinsEta; bin++) {
563  float nSimHit = hEffEtaSimSegm->GetBinContent(bin);
564  float eff = hEffVsEta->GetBinContent(bin);
565  float error = 0;
566  if(nSimHit != 0) {
567  error = sqrt(eff*(1-eff)/nSimHit);
568  }
569  hEffVsEta->SetBinError(bin, error);
570  }
571 
572  //hEffVsPhi = (TH1F *) hPhiRecHit->Clone();
573  hEffVsPhi = (TH1F *) hPhiRecHit->getTH1();
574  TH1F * hEffPhiSimSegm = (TH1F *) hPhiSimSegm->getTH1();
575  hEffVsPhi->SetTitle("2D RecHit Efficiency as a function of Phi");
576  hEffVsPhi->SetName(name+"_hEffVsPhi");
577  hEffVsPhi->Divide(hEffPhiSimSegm);
578  // Set the error accordingly to binomial statistics
579  int nBinsPhi = hEffVsPhi->GetNbinsX();
580  for(int bin = 1; bin <= nBinsPhi; bin++) {
581  float nSimHit = hEffPhiSimSegm->GetBinContent(bin);
582  float eff = hEffVsPhi->GetBinContent(bin);
583  float error = 0;
584  if(nSimHit != 0) {
585  error = sqrt(eff*(1-eff)/nSimHit);
586  }
587  hEffVsPhi->SetBinError(bin, error);
588  }
589 
590  hEffVsPos = (TH1F *) hPosRecHit->getTH1();
591  TH1F * hEffPosSimSegm = (TH1F *) hPosSimSegm->getTH1();
592  //hEffVsPos = (TH1F *) hPosRecHit->Clone();
593  hEffVsPos->SetName(name+"_hEffVsPos");
594  hEffVsPos->SetTitle("2D RecHit Efficiency as a function of position in SL");
595  hEffVsPos->Divide(hEffPosSimSegm);
596  // Set the error accordingly to binomial statistics
597  int nBinsPos = hEffVsPos->GetNbinsX();
598  for(int bin = 1; bin <= nBinsPos; bin++) {
599  float nSimHit = hEffPosSimSegm->GetBinContent(bin);
600  float eff = hEffVsPos->GetBinContent(bin);
601  float error = 0;
602  if(nSimHit != 0) {
603  error = sqrt(eff*(1-eff)/nSimHit);
604  }
605  hEffVsPos->SetBinError(bin, error);
606  }
607 
608  //hEffVsAngle = (TH1F *) hAngleRecHit->Clone();
609  hEffVsAngle = (TH1F *) hAngleRecHit->getTH1();
610  TH1F * hEffAngleSimSegm = (TH1F *) hAngleSimSegm->getTH1();
611  hEffVsAngle->SetTitle("2D RecHit Efficiency as a function of angle");
612  hEffVsAngle->SetName(name+"_hEffVsAngle");
613  hEffVsAngle->Divide(hEffAngleSimSegm);
614  // Set the error accordingly to binomial statistics
615  int nBinsAngle = hEffVsAngle->GetNbinsX();
616  for(int bin = 1; bin <= nBinsAngle; bin++) {
617  float nSimHit = hEffAngleSimSegm->GetBinContent(bin);
618  float eff = hEffVsAngle->GetBinContent(bin);
619  float error = 0;
620  if(nSimHit != 0) {
621  error = sqrt(eff*(1-eff)/nSimHit);
622  }
623  hEffVsAngle->SetBinError(bin, error);
624  }
625 
626  }
TString name
Definition: Histograms.h:663
TH1F * hEffVsPos
Definition: Histograms.h:658
MonitorElement * hPosRecHit
Definition: Histograms.h:657
MonitorElement * hEtaSimSegm
Definition: Histograms.h:650
MonitorElement * hPhiRecHit
Definition: Histograms.h:654
MonitorElement * hAngleSimSegm
Definition: Histograms.h:659
TH1F * hEffVsAngle
Definition: Histograms.h:661
T sqrt(T t)
Definition: SSEVec.h:48
TH1F * hEffVsPhi
Definition: Histograms.h:655
TH1F * hEffVsEta
Definition: Histograms.h:652
TH1 * getTH1(void) const
MonitorElement * hPosSimSegm
Definition: Histograms.h:656
MonitorElement * hAngleRecHit
Definition: Histograms.h:660
MonitorElement * hPhiSimSegm
Definition: Histograms.h:653
MonitorElement * hEtaRecHit
Definition: Histograms.h:651
void HEff2DHit::Fill ( float  etaSimSegm,
float  phiSimSegm,
float  posSimSegm,
float  angleSimSegm,
bool  fillRecHit 
)
inline

Definition at line 532 of file Histograms.h.

References MonitorElement::Fill(), hAngleRecHit, hAngleSimSegm, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hPosRecHit, and hPosSimSegm.

Referenced by DTSegment2DQuality::analyze().

536  {
537 
538  hEtaSimSegm->Fill(etaSimSegm);
539  hPhiSimSegm->Fill(phiSimSegm);
540  hPosSimSegm->Fill(posSimSegm);
541  hAngleSimSegm->Fill(angleSimSegm);
542 
543  if(fillRecHit) {
544  hEtaRecHit->Fill(etaSimSegm);
545  hPhiRecHit->Fill(phiSimSegm);
546  hPosRecHit->Fill(posSimSegm);
547  hAngleRecHit->Fill(angleSimSegm);
548  }
549  }
MonitorElement * hPosRecHit
Definition: Histograms.h:657
void Fill(long long x)
MonitorElement * hEtaSimSegm
Definition: Histograms.h:650
MonitorElement * hPhiRecHit
Definition: Histograms.h:654
MonitorElement * hAngleSimSegm
Definition: Histograms.h:659
MonitorElement * hPosSimSegm
Definition: Histograms.h:656
MonitorElement * hAngleRecHit
Definition: Histograms.h:660
MonitorElement * hPhiSimSegm
Definition: Histograms.h:653
MonitorElement * hEtaRecHit
Definition: Histograms.h:651

Member Data Documentation

MonitorElement* HEff2DHit::hAngleRecHit

Definition at line 660 of file Histograms.h.

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

MonitorElement* HEff2DHit::hAngleSimSegm

Definition at line 659 of file Histograms.h.

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

TH1F* HEff2DHit::hEffVsAngle

Definition at line 661 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff2DHit().

TH1F* HEff2DHit::hEffVsEta

Definition at line 652 of file Histograms.h.

Referenced by ComputeEfficiency().

TH1F* HEff2DHit::hEffVsPhi

Definition at line 655 of file Histograms.h.

Referenced by ComputeEfficiency().

TH1F* HEff2DHit::hEffVsPos

Definition at line 658 of file Histograms.h.

Referenced by ComputeEfficiency().

MonitorElement* HEff2DHit::hEtaRecHit

Definition at line 651 of file Histograms.h.

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

MonitorElement* HEff2DHit::hEtaSimSegm

Definition at line 650 of file Histograms.h.

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

MonitorElement* HEff2DHit::hPhiRecHit

Definition at line 654 of file Histograms.h.

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

MonitorElement* HEff2DHit::hPhiSimSegm

Definition at line 653 of file Histograms.h.

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

MonitorElement* HEff2DHit::hPosRecHit

Definition at line 657 of file Histograms.h.

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

MonitorElement* HEff2DHit::hPosSimSegm

Definition at line 656 of file Histograms.h.

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

TString HEff2DHit::name