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
HEff1DHit Class Reference

#include <Histograms.h>

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

Constructor & Destructor Documentation

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

Definition at line 165 of file Histograms.h.

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

165  {
166  std::string pre ="1D_";
167  pre += name_;
168  name = pre;
169  dbe_->setCurrentFolder("DT/1DRecHits/");
170  hEtaMuSimHit=0; hEtaMuSimHit = dbe_->book1D(pre+"_hEtaMuSimHit", "SimHit Eta distribution",100, -1.5, 1.5);
171  hEtaRecHit=0; hEtaRecHit = dbe_->book1D(pre+"_hEtaRecHit", "SimHit Eta distribution with 1D RecHit",100, -1.5, 1.5);
172  hEffVsEta = 0;
173  hPhiMuSimHit=0; hPhiMuSimHit = dbe_->book1D(pre+"_hPhiMuSimHit", "SimHit Phi distribution",100, -TMath::Pi(),TMath::Pi());
174  hPhiRecHit=0; hPhiRecHit = dbe_->book1D(pre+"_hPhiRecHit", "SimHit Phi distribution with 1D RecHit",100, -TMath::Pi(),TMath::Pi());
175  hEffVsPhi = 0;
176  hDistMuSimHit=0;hDistMuSimHit = dbe_->book1D(pre+"_hDistMuSimHit", "SimHit Distance from wire distribution",100, 0, 2.5);
177  hDistRecHit=0; hDistRecHit = dbe_->book1D(pre+"_hDistRecHit", "SimHit Distance from wire distribution with 1D RecHit",100, 0, 2.5);
178  hEffVsDist = 0;
179 
180  }
const double Pi
MonitorElement * hEtaRecHit
Definition: Histograms.h:312
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
MonitorElement * hPhiMuSimHit
Definition: Histograms.h:315
TH1F * hEffVsPhi
Definition: Histograms.h:317
TString name
Definition: Histograms.h:323
TH1F * hEffVsDist
Definition: Histograms.h:321
MonitorElement * hPhiRecHit
Definition: Histograms.h:316
MonitorElement * hDistRecHit
Definition: Histograms.h:320
TH1F * hEffVsEta
Definition: Histograms.h:313
MonitorElement * hDistMuSimHit
Definition: Histograms.h:319
MonitorElement * hEtaMuSimHit
Definition: Histograms.h:311
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
HEff1DHit::~HEff1DHit ( )
inline

Definition at line 198 of file Histograms.h.

198  {
199 
200  // delete hEtaMuSimHit;
201  // delete hEtaRecHit;
202  // if(hEffVsEta != 0)
203  // delete hEffVsEta;
204 
205  // delete hPhiMuSimHit;
206  // delete hPhiRecHit;
207  // if(hEffVsPhi != 0)
208  // delete hEffVsPhi;
209 
210  // delete hDistMuSimHit;
211  // delete hDistRecHit;
212  // if(hEffVsDist != 0)
213  // delete hEffVsDist;
214 
215  }

Member Function Documentation

void HEff1DHit::ComputeEfficiency ( )
inline

Definition at line 234 of file Histograms.h.

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

234  {
235 
236 
237  // hEffVsEta = (TH1F *) hEtaRecHit->Clone();
238  hEffVsEta = (TH1F *) hEtaRecHit->getTH1();
239  TH1F * hEffEtaMuSimHit = (TH1F *) hEtaMuSimHit->getTH1();
240  hEffVsEta->SetTitle("1D RecHit Efficiency as a function of Eta");
241  hEffVsEta->SetName(name+"_hEffVsEta");
242  //hEffVsEta->Divide(hEtaMuSimHit);
243  hEffVsEta->Divide(hEffEtaMuSimHit);
244  // Set the error accordingly to binomial statistics
245  int nBinsEta = hEffVsEta->GetNbinsX();
246  for(int bin = 1; bin <= nBinsEta; bin++) {
247  float nSimHit = hEffEtaMuSimHit->GetBinContent(bin);
248  float eff = hEffVsEta->GetBinContent(bin);
249  float error = 0;
250  if(nSimHit != 0) {
251  error = sqrt(eff*(1-eff)/nSimHit);
252  }
253  hEffVsEta->SetBinError(bin, error);
254  }
255 
256  //hEffVsPhi = (TH1F *) hPhiRecHit->Clone();
257  hEffVsPhi = (TH1F *) hPhiRecHit->getTH1();
258  TH1F * hEffPhiMuSimHit = (TH1F *) hPhiMuSimHit->getTH1();
259  hEffVsPhi->SetTitle("1D RecHit Efficiency as a function of Phi");
260  hEffVsPhi->SetName(name+"_hEffVsPhi");
261  hEffVsPhi->Divide(hEffPhiMuSimHit);
262  // Set the error accordingly to binomial statistics
263  int nBinsPhi = hEffVsPhi->GetNbinsX();
264  for(int bin = 1; bin <= nBinsPhi; bin++) {
265  float nSimHit = hEffPhiMuSimHit->GetBinContent(bin);
266  float eff = hEffVsPhi->GetBinContent(bin);
267  float error = 0;
268  if(nSimHit != 0) {
269  error = sqrt(eff*(1-eff)/nSimHit);
270  }
271  hEffVsPhi->SetBinError(bin, error);
272  }
273 
274  //hEffVsDist = (TH1F *) hDistRecHit->Clone();
275  hEffVsDist = (TH1F *) hDistRecHit->getTH1();
276  TH1F * hEffDistMuSimHit = (TH1F *) hDistMuSimHit->getTH1();
277  hEffVsDist->SetTitle("1D RecHit Efficiency as a function of Dist");
278  hEffVsDist->SetName(name+"_hEffVsDist");
279  hEffVsDist->Divide(hEffDistMuSimHit);
280  // Set the error accordingly to binomial statistics
281  int nBinsDist = hEffVsDist->GetNbinsX();
282  for(int bin = 1; bin <= nBinsDist; bin++) {
283  float nSimHit = hEffDistMuSimHit->GetBinContent(bin);
284  float eff = hEffVsDist->GetBinContent(bin);
285  float error = 0;
286  if(nSimHit != 0) {
287  error = sqrt(eff*(1-eff)/nSimHit);
288  }
289  hEffVsDist->SetBinError(bin, error);
290  }
291 
292 
293  }
MonitorElement * hEtaRecHit
Definition: Histograms.h:312
MonitorElement * hPhiMuSimHit
Definition: Histograms.h:315
TH1F * hEffVsPhi
Definition: Histograms.h:317
TString name
Definition: Histograms.h:323
T sqrt(T t)
Definition: SSEVec.h:48
TH1F * hEffVsDist
Definition: Histograms.h:321
TH1 * getTH1(void) const
MonitorElement * hPhiRecHit
Definition: Histograms.h:316
MonitorElement * hDistRecHit
Definition: Histograms.h:320
TH1F * hEffVsEta
Definition: Histograms.h:313
MonitorElement * hDistMuSimHit
Definition: Histograms.h:319
MonitorElement * hEtaMuSimHit
Definition: Histograms.h:311
void HEff1DHit::Fill ( float  distSimHit,
float  etaSimHit,
float  phiSimHit,
bool  fillRecHit 
)
inline

Definition at line 217 of file Histograms.h.

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

Referenced by DTRecHitQuality::compute().

220  {
221 
222  hEtaMuSimHit->Fill(etaSimHit);
223  hPhiMuSimHit->Fill(phiSimHit);
224  hDistMuSimHit->Fill(distSimHit);
225  if(fillRecHit) {
226  hEtaRecHit->Fill(etaSimHit);
227  hPhiRecHit->Fill(phiSimHit);
228  hDistRecHit->Fill(distSimHit);
229  }
230  }
MonitorElement * hEtaRecHit
Definition: Histograms.h:312
MonitorElement * hPhiMuSimHit
Definition: Histograms.h:315
void Fill(long long x)
MonitorElement * hPhiRecHit
Definition: Histograms.h:316
MonitorElement * hDistRecHit
Definition: Histograms.h:320
MonitorElement * hDistMuSimHit
Definition: Histograms.h:319
MonitorElement * hEtaMuSimHit
Definition: Histograms.h:311

Member Data Documentation

MonitorElement* HEff1DHit::hDistMuSimHit

Definition at line 319 of file Histograms.h.

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

MonitorElement* HEff1DHit::hDistRecHit

Definition at line 320 of file Histograms.h.

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

TH1F* HEff1DHit::hEffVsDist

Definition at line 321 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff1DHit().

TH1F* HEff1DHit::hEffVsEta

Definition at line 313 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff1DHit().

TH1F* HEff1DHit::hEffVsPhi

Definition at line 317 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff1DHit().

MonitorElement* HEff1DHit::hEtaMuSimHit

Definition at line 311 of file Histograms.h.

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

MonitorElement* HEff1DHit::hEtaRecHit

Definition at line 312 of file Histograms.h.

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

MonitorElement* HEff1DHit::hPhiMuSimHit

Definition at line 315 of file Histograms.h.

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

MonitorElement* HEff1DHit::hPhiRecHit

Definition at line 316 of file Histograms.h.

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

TString HEff1DHit::name