Thank you all who replied me.
There was nothing strange and there was no problem with absolute
value. It was a silly mistake.
Actually TBrowser confused me(Thanks to Marc)
Actually, i had defined histograms
Myhist_2D_abs= new TH2F( " Myhist_2D_abs", "dt Vs dx", 35,0,3.5, 60, 0, 30);
Myhist_2D = new TH2F( "Myhist_2D", "dt Vs dx", 35,0,3.5, 60, 0, 30);
in first histogram there was additional space in inverted commas "" Instead of " Myhist_2D_abs" it should be "Myhist_2D_abs". That's it.
I apologize everyone who spent their time on this.
Cheers, Asif
Quoting "Marc Escalier" <escalier_at_lal.in2p3.fr>:
> Hi,
>
> the fact that it works with TBrowser is not a proof : TBrowser could
> be a very evoluated class that have protection against some strange
> values and so on.
>
> ok, so you say that TH1 with fabs(dx) works
> and 2D doesn't work
>
>> I also draw 1D histogram of "dx" which is fine.
>> myhist_1D->Fill(fabs(dx));
>
> but i guess that if you make some prints, you could see something
> strange appear, maybe NotANumber, or something like this (maybe some
> absence of protection from sqrt(negative number) and so on
>
> if you do that for the same size of sample and that you see
> anomalous values, then i don't know, and maybe experts of root will
> reply.
>
> But if had your problems, i would have proceeded in 2 steps :
> -see if the problem occurs for some typical events (isolate events
> for which i see the strange behaviour)
> -print the values to see if what i think enter the histogram is
> really what i expect
>
>
> regards
>
> ==================
> On Mon, 9 Aug 2010, asaddiqu_at_ualberta.ca wrote:
>
>> I am not on lxplus server. It's cdf stuff. "dt" and "dx" are well
>> defined in cdf coding, like
>>
>> float dt = fCosmicBlock->DeltaTof();
>> float dx = d0Corr(track1);
>>
>> But please don't forget that i can see these histograms in
>> "TBrowser" . My only problem is "Draw()".
>> I also draw 1D histogram of "dx" which is fine.
>> myhist_1D->Fill(fabs(dx));
>>
>> If there is some problem in filling then i shouldn't be able to see
>> in "TBrowser".
>>
>> Cheers, Asif
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Quoting "Marc Escalier" <escalier_at_lal.in2p3.fr>:
>>
>>> Hi,
>>>
>>> the behaviour that you observe is strange.
>>>
>>> ==> Maybe you should put some printing in your code to see what dt
>>> and fabs(dx) are.
>>>
>>> maybe that fabs(dx) give you back a strange stuff : so printing it
>>> could help for the investigation
>>>
>>> i assume that dt and dx are not pointers and not vectors.
>>>
>>> and maybe provide a minimal code to check (if feasible)
>>>
>>> and provide some copy/paste of the line that define :
>>> myhist_2D
>>> myhist_2D_abs
>>> dt
>>> dx
>>>
>>> (or also, put your code in a public directory of lxplus (i don't
>>> find it in ~asaddiqu at lxplus)
>>>
>>> regards
>>>
>>> ====
>>> On Mon, 9 Aug 2010, asaddiqu_at_ualberta.ca wrote:
>>>
>>>> Thank you Stephan & Marc for your reply.
>>>>
>>>> I am pretty sure that there is no sub directory problem. I just
>>>> found an interesting thing which might explain my problem.
>>>> Let say i have two parameters time "dt"(which is always positive)
>>>> & distance from either side of a vertex"dx"(could be positive or
>>>> negative)to fill a 2D histogram. In first case i take absolute
>>>> value of "dx" and in second case i don't,
>>>>
>>>> Case1:
>>>> myhist_2D_abs->Fill(dt,fabs(dx));
>>>>
>>>> Case2 :
>>>> myhist_2D->Fill(dt,dx);
>>>>
>>>> So, "Draw()" command works for second case but does not work for
>>>> first case(for absolute value) and gives an error message that i
>>>> already mentioned.
>>>>
>>>>
>>>> Cheers, Asif
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Quoting asaddiqu_at_ualberta.ca:
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I can view my 2D histogram by "TBrowser" but whenever i try to
>>>>> see it by "Draw()".
>>>>> It shows an error message which is following.
>>>>>
>>>>> ============================================
>>>>> root[1] myhist_2D->Draw()
>>>>> Error: Symbol myhist_2D is not defined in current scope
>>>>> FILE:(tmpfile) LINE:1
>>>>> Error: Failed to evaluate myhist_2D->Draw()Possible candidates are...
>>>>> filename line:size busy function type and name
>>>>> =============================================
>>>>>
>>>>> Unfortunately, i am using an older version of root{4.00/08
>>>>> December 2004 } but there should be no problem of version with
>>>>> this basic thing.
>>>>>
>>>>> Cheers, Asif
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>
Received on Tue Aug 10 2010 - 00:30:10 CEST
This archive was generated by hypermail 2.2.0 : Tue Aug 10 2010 - 17:50:01 CEST