Strange dots

From: Billi Enrico <crazyeinstein82_at_tiscali.it>
Date: Tue, 14 Jun 2005 21:49:27 +0200


Hi ROOTers,
i recently installed version 4.04, i want to save an histogram, but i obtain another one similar but with more dots! You may see the results in the .ps file, do you know how may i can save the original histograms?

E.Billi

void readfile()
{

        gROOT->Reset();

	Int_t TempoA;
	Int_t CountA;
	Int_t CountB;
	Int_t CountC1;
	Int_t Counts;
	Int_t Error;

	FILE *filepointer = fopen("sogliaA.dat","r");
	char line[45];

	TFile *ftree = new TFile("sogliaA.root","RECREATE");
	TTree *tree = new TTree("tree", "Soglia del fotomoltiplicatore A");

	tree->Branch("TempoA",&TempoA,"TempoA/I");
	tree->Branch("CountA",&CountA,"CountA/I");
	tree->Branch("CountB",&CountB,"CountB/I");
	tree->Branch("CountC1",&CountC1,"CountC1/I");
	tree->Branch("Counts",&Counts,"Counts/I");
	tree->Branch("Error",&Error,"Error/I");

	while (fgets(&line,45,filepointer)) 
	{
		sscanf(&line[0],"%d%d%d%d%d%d",&TempoA,&CountA,&CountB,&CountC1,&Counts,&Error);
		tree->Fill();
	}
	
	tree->Print();
	tree->Write();

//fclose(ftree);
ftree->Close();

}

2000	4094	5093	1919	216	14
1500	60	5180	1979	23	4
1600	144	5130	1928	58	7
1700	306	5174	2008	94	9
1800	793	4953	1921	158	12
1900	1888	5074	1972	207	14
2100	11581	5437	2050	249	15
2200	47071	4996	1861	238	15
2300	99474	5053	1973	238	15
2400	129882	5118	1977	267	16
2150	23389	5117	1886	236	15
2050	6341	5146	1946	238	15
1950	2865	5026	1881	189	14
1850	1258	5096	1955	190	14
2250	73516	4829	1947	231	15
2350	114556	4924	1937	222	15




void buildfile()
{

        gROOT->Reset();         

//Se non presente lancia il programma di lettura del file .dat

	if (gSystem->AccessPathName("sogliaA.root")) 
	{
		gROOT->ProcessLine(".x readfile.C");
	}

	TFile *f = new TFile("sogliaA.root","r");
	TTree *tree = (TTree*)f->Get("tree");

	TCanvas *MyC = new TCanvas("MyCanvas","Prova",1);
	MyC->Divide(2,2);
	MyC->cd(1);
	tree->Draw("Counts:TempoA>>histo1");
	MyC->cd(2);
	histo1->Draw();
	MyC->cd(3);
	tree->Draw("Counts:TempoA");
	/*TH1F *soglia = (TH1F*)gDirectory->Get("histo1");

	MyC->cd(2);
	soglia->SetTitle("prova");
	soglia->Draw();
	MyC->cd(3);
	soglia->Draw();
	MyC->cd(4);
	histo1->Draw();*/


//soglia->Write();
//hprova->Write();

}

Received on Tue Jun 14 2005 - 21:49:06 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:09 MET