15 {
16
17 TRandom3
rand(349867);
18
19 LhoodMM_tools*
l =
new LhoodMM_tools();
20 if (l ==0) {
21 std::cout << "null!" << std::endl;
22 return 1;
23 }
24
25 TH1F* h_ht =
new TH1F(
"ht",
"ht", 10, 0, 1000);
26 float ht;
27 TH1F* h_phi =
new TH1F(
"phi",
"phi", 10, 0, 7);
29 TH2F* h_2d =
new TH2F(
"ht_vs_phi",
"ht_vs_phi", 10, 0, 7, 10, 0, 1000);
30 l->register1DHistogram(h_ht, &ht);
31 l->register1DHistogram(h_phi, &
phi);
32 l->register2DHistogram(h_2d, &
phi, &ht);
33
34
35 for (
int itxtfile = 1; itxtfile <
argc-1; itxtfile++) {
36
37 char* txtFilename =
argv[itxtfile];
40 std::cout << "reading..." << std::endl;
41 int nlep;
42 std::vector<bool> isTight_vals;
43 std::vector<double> realEff_vals;
44 std::vector<double> fakeEff_vals;
46 std::vector<FakeBkgTools::Particle>
particles;
47 for (int ilep = 0; ilep<nlep; ilep++) {
48 bool is_tight;
49 float real_eff;
50 float fake_eff;
51 FakeBkgTools::Particle
p;
52 txtFile >> is_tight >> real_eff >> fake_eff;
53 p.is_tight = is_tight;
54 p.real_eff = real_eff;
55 p.fake_eff = fake_eff;
56
58 }
59
60 ht = 1000.*
rand.Uniform();
61 phi = 2*TMath::Pi()*
rand.Uniform();
62
64 l->BaseFakeBkgTool::addEvent(particles);
65 }
66 }
67
69
70 TFile
f(
"test.root",
"RECREATE");
72 h_ht->Write();
73 h_phi->Write();
74 h_2d->Write();
76 }
77
78 double nfakes, poserr, negerr;
79
81
82
86 poserr =
y.uncertainties[
u].up;
87 negerr =
y.uncertainties[
u].down;
88
89 std::cout << "nfakes = " << nfakes << " + " << poserr << " - " << -1.0*negerr << std::endl;
90
91 TFile
rootFile(argv[argc-1],
"RECREATE");
92 TH1F* h_count =
new TH1F(
"h_count",
"h_count", 2, 0, 2);
93 h_count->SetBinContent(1, nfakes);
94 h_count->SetBinError(1, TMath::Max(TMath::Abs(poserr), TMath::Abs(negerr)));
96 h_count->Write();
98
99}
Scalar phi() const
phi method
l
Printing final latex table to .tex output file.
@ u
Enums for curvilinear frames.
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)