Hello everybody,
I have created 2 histos (on and off) with TChain and I want to draw them according some criteria I have defined and called kCut. When I try to normalize them one to another I don’t know how to do …In this case BGOff=0 and I have to normalize off before drawning it (!!)
Here is the code: (read and readoff are TChain pointers):
read->Draw(“abs(MSource.fHeight)>>on”,kCut);
readoff->Draw(“abs(MSource.fHeight)>>off”,kCut);
Float_t BGOn = on->Integral(bin1, bin2);
Float_t BGOff = off->Integral(bin1, bin2);
cout<<"BGOn="<< BGOn << "BGOff=" << BGOff <<endl;
Float_t ScaleN = BGOn/BGOff;
off->Scale(ScaleN);
off->Draw("");
[color=red]I tried to create a new histo hist_temp [/color]:
ead->Draw(“abs( MSource.fHeight>)>on”,kCut);
readoff->Draw(“abs( MSource.fHeight )>>[color=red]hist_temp[/color]”,kCut);
Float_t BGOn = on->Integral(bin1, bin2);
Float_t BGOff = [color=red]hist_temp[/color]->Integral(bin1, bin2);
cout<<"BGOn="<< BGOn << "BGOff=" << BGOff <<endl;
Float_t ScaleN = BGOn/BGOff;
[color=red]and then I have to fill off with hist_temp…but I am not able to do it![/color]
Could you helpme ??
Thank U very much