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 453 of file Histograms.h.

Constructor & Destructor Documentation

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

Definition at line 455 of file Histograms.h.

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

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

Definition at line 507 of file Histograms.h.

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

Member Function Documentation

void HEff2DHit::ComputeEfficiency ( )
inline

Definition at line 549 of file Histograms.h.

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

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

Definition at line 529 of file Histograms.h.

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

Referenced by DTSegment2DQuality::analyze().

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

Member Data Documentation

MonitorElement* HEff2DHit::hAngleRecHit

Definition at line 657 of file Histograms.h.

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

MonitorElement* HEff2DHit::hAngleSimSegm

Definition at line 656 of file Histograms.h.

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

TH1F* HEff2DHit::hEffVsAngle

Definition at line 658 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff2DHit().

TH1F* HEff2DHit::hEffVsEta

Definition at line 649 of file Histograms.h.

Referenced by ComputeEfficiency().

TH1F* HEff2DHit::hEffVsPhi

Definition at line 652 of file Histograms.h.

Referenced by ComputeEfficiency().

TH1F* HEff2DHit::hEffVsPos

Definition at line 655 of file Histograms.h.

Referenced by ComputeEfficiency().

MonitorElement* HEff2DHit::hEtaRecHit

Definition at line 648 of file Histograms.h.

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

MonitorElement* HEff2DHit::hEtaSimSegm

Definition at line 647 of file Histograms.h.

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

MonitorElement* HEff2DHit::hPhiRecHit

Definition at line 651 of file Histograms.h.

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

MonitorElement* HEff2DHit::hPhiSimSegm

Definition at line 650 of file Histograms.h.

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

MonitorElement* HEff2DHit::hPosRecHit

Definition at line 654 of file Histograms.h.

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

MonitorElement* HEff2DHit::hPosSimSegm

Definition at line 653 of file Histograms.h.

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

TString HEff2DHit::name