20 std::string hist1Name,
23 std::string hist2Name,
25 std::string inFile3 =
"",
26 std::string hist3Name =
"",
29 std::cout <<
"Opening file: " << inFile1 << std::endl;
30 TFile inputFile1(inFile1.c_str());
31 std::cout <<
"Opening file: " << inFile2 << std::endl;
32 TFile inputFile2(inFile2.c_str());
33 std::cout <<
"Comparing Histograms: " << hist1Name <<
" & " << hist2Name
36 TH1F*
h1 = (TH1F*)inputFile1.Get(hist1Name.c_str());
37 TH1F*
h2 = (TH1F*)inputFile2.Get(hist2Name.c_str());
38 std::cout <<
"col1: " << col1 <<
", col2: " << col2 << std::endl;
40 h1->SetMarkerColor(col1);
41 h1->SetLineColor(col1);
42 h1->SetMarkerStyle(3);
44 h2->SetMarkerColor(col2);
45 h2->SetLineColor(col2);
47 TLegend*
leg =
new TLegend(0.72, 0.696, 0.99, 0.936);
48 leg->AddEntry(h1, hist1Name.c_str());
49 leg->AddEntry(h2, hist2Name.c_str());
51 if (!inFile3.empty()) {
52 TFile inputFile3(inFile3.c_str());
53 TH1F* h3 = (TH1F*)inputFile3.Get(hist3Name.c_str());
54 std::cout <<
" & " << hist3Name << std::endl;
55 std::cout <<
"from file: " << inFile3 << std::endl;
56 h3->SetMarkerColor(col3);
57 h3->SetLineColor(col3);
60 leg->AddEntry(h3, hist3Name.c_str());