Ex1.tar
, you will find three files PseudoData_Histogram_100fb.root
, Signal_1fb.root
and Background_1fb.root
PseudoData_Histogram_100fb.root
is the data we have measured corresponding to 100 inverse fbsignal
, which shows the invariant diphoton mass, plot it.We have measured some data, let's read it in:
TFile *histoFile = new TFile("PseudoData_Histogram_100fb.root", "READ");
TH1D *hData = (TH1D*) histoFile -> Get("signal");
Let's see how many events we have in the data:
std::cout << hData -> Integral() << std::endl;
Now we want to have a look at it, so lets plot it! We will need a canvas for this, which we already divided into two pads:
TCanvas *c = new TCanvas("c", "c", 600, 600);
TPad *pad1 = new TPad("pad1","main", 0, 0.3, 1, 1.0);
pad1->SetFillColor(0);
pad1->Draw();
TPad *pad2 = new TPad("pad2","ratio", 0, 0.05, 1, 0.3);
pad2->SetFillColor(0);
pad2->Draw();
pad1->cd();
Now we can plot our data and draw the canvas!
hData -> SetLineColor(kBlack);
hData -> SetMarkerColor(kBlack);
hData -> SetMarkerStyle(2);
hData -> SetMarkerSize(1.5);
hData->Draw();
c->Draw();