Dear Rooters,
Hi !
I have a 2D histogram ‘hxy’, for which I want to project the Y axis (in second pad) corresponding to the X axis bin range from ‘1700 to 1702’ with the following script -
%%%%%%%%%%%%%%%%%%%%%%%%%%
[code]{
//
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%//
//%%%%%%%%%%%%%%%%% Root 2D Histograms to be Analysed %%%%%%%%%%%%%%%%%%%%%%%//
TString f12U = “Umat_G12_56CoFe_IPAC_r1.root”; TString h12U = “2UG12”;
//%%%%%%%%%%%%%%%%%%%%% Gamma # 1,2 (847 keV) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%//
//
TCanvas C1 = new TCanvas(“C1”,“Fitting canvas”,10,10,1400,1200);
C1->Divide(1,2);
//
C1->cd(1);
TFile f1 = TFile::Open( f12U.Data(), “READ” );
TH2F hxy = (TH2F)f1->FindObjectAny(h12U.Data());
//
TH1D *px = hxy->ProjectionX();
px->Draw();
px->SetLineWidth(2.0);
//
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%//
//
C1->cd(2);
TH1D *h1= hxy->ProjectionY(“Peak”,1700,1702);
h1->Draw();
h1->SetLineColor(kRed);
h1->SetLineWidth(2.0);
//
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
When I do it for individual bins of X-axis (i.e. for bin 1700, 1701 & 1702)
The number of entries in the ‘h1’ (projected Y) histogram are the following -
for bin 1700 of X-axis = 2748861
1701 = 2746779
1702 = 2744624
BUT when I used the above script to do it in one go, then number of entries in ‘h1’ are 1.009153e+07,
which is of course much higher than what it should have been ( the sum of above three numbers, i.e. 8240264).
Is there something wrong in the script above ??
Please suggest me.
Also I noticed that these entries in ‘h1’ (i.e. 1.009153e+07) are the same as in ‘projected X’ (which is the complete projection without any condition) projected in the first pad of the canvas.
Is there any upper limit on the no. of entries in a histogram ??
If yes then please tell me how to increase that.
I am using root 5.21/04 version on my Linux machine.
The data file is very big (2.5 GB) & it is not possible to attach it with the mail.
Please suggest me as soon as possible.
Thanks
[/code]