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

A set of histograms for efficiency 4D RecHits. More...

#include <Histograms.h>

Public Member Functions

void ComputeEfficiency ()
 
void Fill (float etaSimSegm, float phiSimSegm, float xSimSegm, float ySimSegm, float alphaSimSegm, float betaSimSegm, bool fillRecHit)
 
 HEff4DHit (std::string name_, DQMStore *dbe_)
 
 ~HEff4DHit ()
 

Public Attributes

MonitorElementhAlphaRecHit
 
MonitorElementhAlphaSimSegm
 
MonitorElementhBetaRecHit
 
MonitorElementhBetaSimSegm
 
TH1F * hEffVsAlpha
 
TH1F * hEffVsBeta
 
TH1F * hEffVsEta
 
TH1F * hEffVsPhi
 
TH1F * hEffVsX
 
TH1F * hEffVsY
 
MonitorElementhEtaRecHit
 
MonitorElementhEtaSimSegm
 
MonitorElementhPhiRecHit
 
MonitorElementhPhiSimSegm
 
MonitorElementhXRecHit
 
MonitorElementhXSimSegm
 
MonitorElementhYRecHit
 
MonitorElementhYSimSegm
 
TString name
 

Detailed Description

A set of histograms for efficiency 4D RecHits.

Definition at line 1116 of file Histograms.h.

Constructor & Destructor Documentation

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

Definition at line 1118 of file Histograms.h.

References DQMStore::book1D(), hAlphaRecHit, hAlphaSimSegm, hBetaRecHit, hBetaSimSegm, hEffVsAlpha, hEffVsBeta, hEffVsEta, hEffVsPhi, hEffVsX, hEffVsY, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hXRecHit, hXSimSegm, hYRecHit, hYSimSegm, name, Pi, DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

1118  {
1119  std::string pre ="4D_";
1120  pre += name_;
1121  name = pre;
1122  dbe_->setCurrentFolder("DT/4DSegments/");
1123  hEtaSimSegm=0;hEtaSimSegm = dbe_->book1D(pre+"_hEtaSimSegm", "Eta of SimHit segment", 100, -1.5, 1.5);
1124  hEtaRecHit=0;hEtaRecHit = dbe_->book1D(pre+"_hEtaRecHit", "Eta distribution of SimHit segment with 4D RecHit",
1125  100, -1.5, 1.5);
1126  hEffVsEta = 0;
1127 
1128  hPhiSimSegm=0;hPhiSimSegm = dbe_->book1D(pre+"_hPhiSimSegm", "Phi of SimHit segment",
1129  100, -TMath::Pi(),TMath::Pi());
1130  hPhiRecHit=0;hPhiRecHit = dbe_->book1D(pre+"_hPhiRecHit", "Phi distribution of SimHit segment with 4D RecHit",
1131  100, -TMath::Pi(),TMath::Pi());
1132  hEffVsPhi = 0;
1133 
1134 
1135  hXSimSegm=0;hXSimSegm = dbe_->book1D(pre+"_hXSimSegm", "X position in Chamber of SimHit segment (cm)",
1136  100, -200, 200);
1137  hXRecHit=0;hXRecHit = dbe_->book1D(pre+"_hXRecHit", "X position in Chamber of SimHit segment with 4D RecHit (cm)",
1138  100, -200, 200);
1139  hEffVsX = 0;
1140 
1141  hYSimSegm=0;hYSimSegm = dbe_->book1D(pre+"_hYSimSegm", "Y position in Chamber of SimHit segment (cm)",
1142  100, -200, 200);
1143  hYRecHit=0;hYRecHit = dbe_->book1D(pre+"_hYRecHit", "Y position in Chamber of SimHit segment with 4D RecHit (cm)",
1144  100, -200, 200);
1145  hEffVsY = 0;
1146 
1147  hAlphaSimSegm=0;hAlphaSimSegm = dbe_->book1D(pre+"_hAlphaSimSegm", "Alpha of SimHit segment (rad)",
1148  100, -1.5, 1.5);
1149  hAlphaRecHit=0;hAlphaRecHit = dbe_->book1D(pre+"_hAlphaRecHit", "Alpha of SimHit segment with 4D RecHit (rad)",
1150  100, -1.5, 1.5);
1151  hEffVsAlpha = 0;
1152 
1153  hBetaSimSegm=0;hBetaSimSegm = dbe_->book1D(pre+"_hBetaSimSegm", "Beta of SimHit segment (rad)",
1154  100, -2, 2);
1155  hBetaRecHit=0;hBetaRecHit = dbe_->book1D(pre+"_hBetaRecHit", "Beta of SimHit segment with 4D RecHit (rad)",
1156  100, -2, 2);
1157  hEffVsBeta = 0;
1158 
1159  }
const double Pi
MonitorElement * hAlphaRecHit
Definition: Histograms.h:1387
TH1F * hEffVsEta
Definition: Histograms.h:1376
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * hBetaSimSegm
Definition: Histograms.h:1389
TH1F * hEffVsX
Definition: Histograms.h:1382
MonitorElement * hXRecHit
Definition: Histograms.h:1381
MonitorElement * hEtaSimSegm
Definition: Histograms.h:1374
MonitorElement * hPhiRecHit
Definition: Histograms.h:1378
TH1F * hEffVsBeta
Definition: Histograms.h:1391
MonitorElement * hPhiSimSegm
Definition: Histograms.h:1377
TString name
Definition: Histograms.h:1393
MonitorElement * hEtaRecHit
Definition: Histograms.h:1375
TH1F * hEffVsAlpha
Definition: Histograms.h:1388
MonitorElement * hBetaRecHit
Definition: Histograms.h:1390
MonitorElement * hAlphaSimSegm
Definition: Histograms.h:1386
MonitorElement * hYSimSegm
Definition: Histograms.h:1383
TH1F * hEffVsY
Definition: Histograms.h:1385
TH1F * hEffVsPhi
Definition: Histograms.h:1379
MonitorElement * hYRecHit
Definition: Histograms.h:1384
MonitorElement * hXSimSegm
Definition: Histograms.h:1380
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
HEff4DHit::~HEff4DHit ( )
inline

Definition at line 1189 of file Histograms.h.

1189  {
1190 
1191  /*delete hEtaSimSegm;
1192  delete hEtaRecHit;
1193  delete hEffVsEta;
1194  delete hPhiSimSegm;
1195  delete hPhiRecHit;
1196  delete hEffVsPhi;
1197  delete hXSimSegm;
1198  delete hXRecHit;
1199  delete hEffVsX;
1200  delete hYSimSegm;
1201  delete hYRecHit;
1202  delete hEffVsY;
1203  delete hAlphaSimSegm;
1204  delete hAlphaRecHit;
1205  delete hEffVsAlpha;
1206  delete hBetaSimSegm;
1207  delete hBetaRecHit;
1208  delete hEffVsBeta;*/
1209  }

Member Function Documentation

void HEff4DHit::ComputeEfficiency ( )
inline

Definition at line 1238 of file Histograms.h.

References newFWLiteAna::bin, relativeConstraints::error, MonitorElement::getTH1(), hAlphaRecHit, hAlphaSimSegm, hBetaRecHit, hBetaSimSegm, hEffVsAlpha, hEffVsBeta, hEffVsEta, hEffVsPhi, hEffVsX, hEffVsY, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hXRecHit, hXSimSegm, hYRecHit, hYSimSegm, name, and mathSSE::sqrt().

1238  {
1239  //hEffVsEta = (TH1F *) hEtaRecHit->Clone();
1240  hEffVsEta = (TH1F *) hEtaRecHit->getTH1();
1241  TH1F * hEffEtaSimSegm = (TH1F *) hEtaSimSegm->getTH1();
1242  hEffVsEta->SetName(name+"_hEffVsEta");
1243  hEffVsEta->SetTitle("4D RecHit Efficiency as a function of Eta");
1244  hEffVsEta->Divide(hEffEtaSimSegm);
1245  // Set the error accordingly to binomial statistics
1246  int nBinsEta = hEffVsEta->GetNbinsX();
1247  for(int bin = 1; bin <= nBinsEta; bin++) {
1248  float nSimHit = hEffEtaSimSegm->GetBinContent(bin);
1249  float eff = hEffVsEta->GetBinContent(bin);
1250  float error = 0;
1251  if(nSimHit != 0) {
1252  error = sqrt(eff*(1-eff)/nSimHit);
1253  }
1254  hEffVsEta->SetBinError(bin, error);
1255  }
1256 
1257  hEffVsPhi = (TH1F *) hPhiRecHit->getTH1();
1258  TH1F * hEffPhiSimSegm = (TH1F *) hPhiSimSegm->getTH1();
1259  hEffVsPhi->SetName(name+"_hEffVsPhi");
1260  hEffVsPhi->SetTitle("4D RecHit Efficiency as a function of Phi");
1261  hEffVsPhi->Divide(hEffPhiSimSegm);
1262  // Set the error accordingly to binomial statistics
1263  int nBinsPhi = hEffVsPhi->GetNbinsX();
1264  for(int bin = 1; bin <= nBinsPhi; bin++) {
1265  float nSimHit = hEffPhiSimSegm->GetBinContent(bin);
1266  float eff = hEffVsPhi->GetBinContent(bin);
1267  float error = 0;
1268  if(nSimHit != 0) {
1269  error = sqrt(eff*(1-eff)/nSimHit);
1270  }
1271  hEffVsPhi->SetBinError(bin, error);
1272  }
1273 
1274  hEffVsX = (TH1F *) hXRecHit->getTH1();
1275  TH1F * hEffXSimSegm = (TH1F *) hXSimSegm->getTH1();
1276  hEffVsX->SetName(name+"_hEffVsX");
1277  hEffVsX->SetTitle("4D RecHit Efficiency as a function of x position in Chamber");
1278  hEffVsX->Divide(hEffXSimSegm);
1279  // Set the error accordingly to binomial statistics
1280  int nBinsX = hEffVsX->GetNbinsX();
1281  for(int bin = 1; bin <= nBinsX; bin++) {
1282  float nSimHit = hEffXSimSegm->GetBinContent(bin);
1283  float eff = hEffVsX->GetBinContent(bin);
1284  float error = 0;
1285  if(nSimHit != 0) {
1286  error = sqrt(eff*(1-eff)/nSimHit);
1287  }
1288  hEffVsX->SetBinError(bin, error);
1289  }
1290 
1291 
1292  hEffVsY = (TH1F *) hYRecHit->getTH1();
1293  TH1F * hEffYSimSegm = (TH1F *) hYSimSegm->getTH1();
1294  hEffVsY->SetName(name+"_hEffVsY");
1295  hEffVsY->SetTitle("4D RecHit Efficiency as a function of y position in Chamber");
1296  hEffVsY->Divide(hEffYSimSegm);
1297  // Set the error accordingly to binomial statistics
1298  int nBinsY = hEffVsY->GetNbinsX();
1299  for(int bin = 1; bin <= nBinsY; bin++) {
1300  float nSimHit = hEffYSimSegm->GetBinContent(bin);
1301  float eff = hEffVsY->GetBinContent(bin);
1302  float error = 0;
1303  if(nSimHit != 0) {
1304  error = sqrt(eff*(1-eff)/nSimHit);
1305  }
1306  hEffVsY->SetBinError(bin, error);
1307  }
1308 
1309  hEffVsAlpha = (TH1F *) hAlphaRecHit->getTH1();
1310  TH1F * hEffAlphaSimSegm = (TH1F *) hAlphaSimSegm->getTH1();
1311  hEffVsAlpha->SetName(name+"_hEffVsAlpha");
1312  hEffVsAlpha->SetTitle("4D RecHit Efficiency as a function of alpha");
1313  hEffVsAlpha->Divide(hEffAlphaSimSegm);
1314  // Set the error accordingly to binomial statistics
1315  int nBinsAlpha = hEffVsAlpha->GetNbinsX();
1316  for(int bin = 1; bin <= nBinsAlpha; bin++) {
1317  float nSimHit = hEffAlphaSimSegm->GetBinContent(bin);
1318  float eff = hEffVsAlpha->GetBinContent(bin);
1319  float error = 0;
1320  if(nSimHit != 0) {
1321  error = sqrt(eff*(1-eff)/nSimHit);
1322  }
1323  hEffVsAlpha->SetBinError(bin, error);
1324  }
1325 
1326 
1327  hEffVsBeta = (TH1F *) hBetaRecHit->getTH1();
1328  TH1F * hEffBetaSimSegm = (TH1F *) hBetaSimSegm->getTH1();
1329  hEffVsBeta->SetName(name+"_hEffVsBeta");
1330  hEffVsBeta->SetTitle("4D RecHit Efficiency as a function of beta");
1331  hEffVsBeta->Divide(hEffBetaSimSegm);
1332  // Set the error accordingly to binomial statistics
1333  int nBinsBeta = hEffVsBeta->GetNbinsX();
1334  for(int bin = 1; bin <= nBinsBeta; bin++) {
1335  float nSimHit = hEffBetaSimSegm->GetBinContent(bin);
1336  float eff = hEffVsBeta->GetBinContent(bin);
1337  float error = 0;
1338  if(nSimHit != 0) {
1339  error = sqrt(eff*(1-eff)/nSimHit);
1340  }
1341  hEffVsBeta->SetBinError(bin, error);
1342  }
1343  }
MonitorElement * hAlphaRecHit
Definition: Histograms.h:1387
TH1F * hEffVsEta
Definition: Histograms.h:1376
MonitorElement * hBetaSimSegm
Definition: Histograms.h:1389
TH1F * hEffVsX
Definition: Histograms.h:1382
MonitorElement * hXRecHit
Definition: Histograms.h:1381
MonitorElement * hEtaSimSegm
Definition: Histograms.h:1374
MonitorElement * hPhiRecHit
Definition: Histograms.h:1378
TH1F * hEffVsBeta
Definition: Histograms.h:1391
MonitorElement * hPhiSimSegm
Definition: Histograms.h:1377
TString name
Definition: Histograms.h:1393
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * hEtaRecHit
Definition: Histograms.h:1375
TH1 * getTH1(void) const
TH1F * hEffVsAlpha
Definition: Histograms.h:1388
MonitorElement * hBetaRecHit
Definition: Histograms.h:1390
MonitorElement * hAlphaSimSegm
Definition: Histograms.h:1386
MonitorElement * hYSimSegm
Definition: Histograms.h:1383
TH1F * hEffVsY
Definition: Histograms.h:1385
TH1F * hEffVsPhi
Definition: Histograms.h:1379
MonitorElement * hYRecHit
Definition: Histograms.h:1384
MonitorElement * hXSimSegm
Definition: Histograms.h:1380
void HEff4DHit::Fill ( float  etaSimSegm,
float  phiSimSegm,
float  xSimSegm,
float  ySimSegm,
float  alphaSimSegm,
float  betaSimSegm,
bool  fillRecHit 
)
inline

Definition at line 1211 of file Histograms.h.

References MonitorElement::Fill(), hAlphaRecHit, hAlphaSimSegm, hBetaRecHit, hBetaSimSegm, hEtaRecHit, hEtaSimSegm, hPhiRecHit, hPhiSimSegm, hXRecHit, hXSimSegm, hYRecHit, and hYSimSegm.

Referenced by DTSegment4DQuality::analyze().

1217  {
1218 
1219  hEtaSimSegm->Fill(etaSimSegm);
1220  hPhiSimSegm->Fill(phiSimSegm);
1221  hXSimSegm->Fill(xSimSegm);
1222  hYSimSegm->Fill(ySimSegm);
1223  hAlphaSimSegm->Fill(alphaSimSegm);
1224  hBetaSimSegm->Fill(betaSimSegm);
1225 
1226  if(fillRecHit) {
1227  hEtaRecHit->Fill(etaSimSegm);
1228  hPhiRecHit->Fill(phiSimSegm);
1229  hXRecHit->Fill(xSimSegm);
1230  hYRecHit->Fill(ySimSegm);
1231  hAlphaRecHit->Fill(alphaSimSegm);
1232  hBetaRecHit->Fill(betaSimSegm);
1233  }
1234  }
MonitorElement * hAlphaRecHit
Definition: Histograms.h:1387
MonitorElement * hBetaSimSegm
Definition: Histograms.h:1389
MonitorElement * hXRecHit
Definition: Histograms.h:1381
MonitorElement * hEtaSimSegm
Definition: Histograms.h:1374
MonitorElement * hPhiRecHit
Definition: Histograms.h:1378
void Fill(long long x)
MonitorElement * hPhiSimSegm
Definition: Histograms.h:1377
MonitorElement * hEtaRecHit
Definition: Histograms.h:1375
MonitorElement * hBetaRecHit
Definition: Histograms.h:1390
MonitorElement * hAlphaSimSegm
Definition: Histograms.h:1386
MonitorElement * hYSimSegm
Definition: Histograms.h:1383
MonitorElement * hYRecHit
Definition: Histograms.h:1384
MonitorElement * hXSimSegm
Definition: Histograms.h:1380

Member Data Documentation

MonitorElement* HEff4DHit::hAlphaRecHit

Definition at line 1387 of file Histograms.h.

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

MonitorElement* HEff4DHit::hAlphaSimSegm

Definition at line 1386 of file Histograms.h.

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

MonitorElement* HEff4DHit::hBetaRecHit

Definition at line 1390 of file Histograms.h.

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

MonitorElement* HEff4DHit::hBetaSimSegm

Definition at line 1389 of file Histograms.h.

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

TH1F* HEff4DHit::hEffVsAlpha

Definition at line 1388 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff4DHit().

TH1F* HEff4DHit::hEffVsBeta

Definition at line 1391 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff4DHit().

TH1F* HEff4DHit::hEffVsEta

Definition at line 1376 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff4DHit().

TH1F* HEff4DHit::hEffVsPhi

Definition at line 1379 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff4DHit().

TH1F* HEff4DHit::hEffVsX

Definition at line 1382 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff4DHit().

TH1F* HEff4DHit::hEffVsY

Definition at line 1385 of file Histograms.h.

Referenced by ComputeEfficiency(), and HEff4DHit().

MonitorElement* HEff4DHit::hEtaRecHit

Definition at line 1375 of file Histograms.h.

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

MonitorElement* HEff4DHit::hEtaSimSegm

Definition at line 1374 of file Histograms.h.

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

MonitorElement* HEff4DHit::hPhiRecHit

Definition at line 1378 of file Histograms.h.

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

MonitorElement* HEff4DHit::hPhiSimSegm

Definition at line 1377 of file Histograms.h.

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

MonitorElement* HEff4DHit::hXRecHit

Definition at line 1381 of file Histograms.h.

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

MonitorElement* HEff4DHit::hXSimSegm

Definition at line 1380 of file Histograms.h.

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

MonitorElement* HEff4DHit::hYRecHit

Definition at line 1384 of file Histograms.h.

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

MonitorElement* HEff4DHit::hYSimSegm

Definition at line 1383 of file Histograms.h.

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

TString HEff4DHit::name