Re: TF3::GetHistogram() seg violation

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Wed, 30 Mar 2011 12:30:10 +0000


As you see I get 100 .
I am using the trunk

On 3/30/11 2:21 PM, "Serhiy Senyukov" <Serhiy.Senyukov_at_cern.ch> wrote:

>Hi Oliver,
>
>> I do not see what you describe here.
>[Serhiy Senyukov] Ok. I have found the reason for the first issue. There
>were parameters missing in the declaration of the 3D function. However
>the bin content of the produced histogram is always zero.
>
>Regards,
>Serhiy.
>
>> root [0] .x ser.C
>> Processing ser.C...
>> Test function3 test = 100
>> Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
>>
>> The macro is:
>>
>> Double_t test(Double_t *x, Double_t *par)
>> {
>> return 100;
>> }
>>
>> void ser(Int_t nPoints=5){
>> TF3* test_f3=new TF3("test_f3",test,0,10,0,10,0,10,2);
>> test_f3->SetParameters(1,2);
>> test_f3->SetNpx(nPoints);
>> test_f3->SetNpy(nPoints);
>> test_f3->SetNpz(nPoints);
>>
>> cout<<"Test function3 test = "<<test_f3->Eval(5,5,5)<<endl;
>>
>> test_f3->Draw();
>> TH3F* test3_hist=(TH3F*)test_f3->GetHistogram();
>> }
Received on Wed Mar 30 2011 - 14:30:18 CEST

This archive was generated by hypermail 2.2.0 : Wed Mar 30 2011 - 17:50:01 CEST