showHists47.cxx 1.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
//#include "TString.h"

void showHists47()
{

	TString location = "../data/WPT_tests";

	TString f0, f1;

	f0.Form("%s/4.7nF_11okt_chargeCalib/TestTriggerMode_chargeCalib_3V_100ns_4.7nF_11oct_0000.root", location.Data());
	f1.Form("%s/4.7nF_11okt_chargeCalib/TestTriggerMode_chargeCalib_3V_100ns_4.7nF_11oct_0001.root", location.Data());

	TFile *fr0 = new TFile(f0.Data());
	TFile *fr1 = new TFile(f1.Data());

//	TH2D *hraw0 = (TH2D*)fr0->Get("cal1eAdcAllWoBaseline");
//	TH2D *hraw1 = (TH2D*)fr1->Get("cal1eAdcAllWoBaseline");

19 20 21 22 23 24 25
	TH2D *hraw0 = (TH2D*)fr0->Get("fhAdcAllWoBaselineNLcorr");
	TH2D *hraw1 = (TH2D*)fr1->Get("fhAdcAllWoBaselineNLcorr");

	if (!hraw0 || !hraw1) {
		Error("showHists47.cxx", "At least one of histograms was not found.");
		return;
	}
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

	TCanvas *c1 = new TCanvas();
	c1->Divide(2,2);

	c1->cd(1);
	hraw0->GetXaxis()->SetRangeUser(0, 64);
	hraw0->Draw();

	c1->cd(2);
	hraw1->GetXaxis()->SetRangeUser(0, 64);
	hraw1->Draw();

	c1->cd(3);
	TH2D *hSum = new TH2D(*hraw1);
	hSum->Add(hraw0);;
	hSum->Draw();

}