BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
HistsCompare.cpp File Reference
#include <iostream>
#include <cstdlib>
#include "AutoHistoCompare.h"
#include <TH1F.h>
#include <TCanvas.h>

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 9 of file HistsCompare.cpp.

9 {
10
11 const char* reffilename = std::getenv("REFFILE");
12 const char* curfilename = std::getenv("CURFILE");
13
14 if ( argc > 1 ) {
15 reffilename = argv[1];
16 }
17 if ( argc > 2 ) {
18 curfilename = argv[2];
19 }
20
21 if ( reffilename == nullptr ) {
22 std::cerr << "Error: reffilename should provide." << std::endl;
23 return 1;
24 }
25 if ( curfilename == nullptr ) {
26 std::cerr << "Error: curfilename should provide." << std::endl;
27 return 1;
28 }
29
30 TH1F *PvHisto = new TH1F("PV", "PV Distribution", 200, -0.1, 1.1);
31
32 AutoHistoCompare *myPV = new AutoHistoCompare(PvHisto, reffilename, curfilename, 2, 0);
33
34 TCanvas* canvas = new TCanvas("canvas", "Histogram Canvas", 800, 600);
35 myPV->DoCompare();
36 PvHisto->Draw();
37 canvas->SaveAs("PVdistribution.eps");
38
39 delete PvHisto;
40 delete myPV;
41 delete canvas;
42
43 return 0;
44}