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 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, DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 200 of file Histograms.h.

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

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().

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

222  {
223 
224  hEtaMuSimHit->Fill(etaSimHit);
225  hPhiMuSimHit->Fill(phiSimHit);
226  hDistMuSimHit->Fill(distSimHit);
227  if(fillRecHit) {
228  hEtaRecHit->Fill(etaSimHit);
229  hPhiRecHit->Fill(phiSimHit);
230  hDistRecHit->Fill(distSimHit);
231  }
232  }
MonitorElement * hEtaRecHit
Definition: Histograms.h:314
MonitorElement * hPhiMuSimHit
Definition: Histograms.h:317
void Fill(long long x)
MonitorElement * hPhiRecHit
Definition: Histograms.h:318
MonitorElement * hDistRecHit
Definition: Histograms.h:322
MonitorElement * hDistMuSimHit
Definition: Histograms.h:321
MonitorElement * hEtaMuSimHit
Definition: Histograms.h:313

Member Data Documentation

MonitorElement* HEff1DHit::hDistMuSimHit

Definition at line 321 of file Histograms.h.

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

MonitorElement* HEff1DHit::hDistRecHit

Definition at line 322 of file Histograms.h.

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

TH1F* HEff1DHit::hEffVsDist

Definition at line 323 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff1DHit().

TH1F* HEff1DHit::hEffVsEta

Definition at line 315 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff1DHit().

TH1F* HEff1DHit::hEffVsPhi

Definition at line 319 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff1DHit().

MonitorElement* HEff1DHit::hEtaMuSimHit

Definition at line 313 of file Histograms.h.

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

MonitorElement* HEff1DHit::hEtaRecHit

Definition at line 314 of file Histograms.h.

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

MonitorElement* HEff1DHit::hPhiMuSimHit

Definition at line 317 of file Histograms.h.

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

MonitorElement* HEff1DHit::hPhiRecHit

Definition at line 318 of file Histograms.h.

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

TString HEff1DHit::name