chain.Draw and chain.Process

Dear ROOTers,

I am using root Version 4.00/02 20 February 2004.

I am trying to understand how TTree.Process() working.
I have class myselect : public TSelector {…} and following code in myselect::Process():

fChain->GetTree()->GetEntry(entry); for (Int_t count = 0; count<T2IdNtracks; ++count) { if ((T2IdAlgo[count]==3)&&(abs(T2IdEta[count])<0.7)&&(abs(T2IdPt[count])>5.0)) { PtHist->Fill(T2IdPt[count]); } }

I run 2 commands:

chain.Process(“myselect.C”);
and
chain.Draw(“T2IdPt>>nhitsf(100,-150,150)”,"(T2IdAlgo==3)&(abs(T2IdEta)<0.7)&(abs(T2IdPt)>5)");

Should nhitsf and PtHist contain same data?
In my case i have a bit more data in PtHist. Is it correct?
PtHist created by following code:
TH1F PtHist = new TH1F (“pt”, “Selectors Pt”, 100, -150, 150);

Thank you.

In

did you mean & or &&?

Cheers,
Philippe

Hello,

I mean &&, sorry for misprint.
But in my case

and

gives the same picture

Hi,

You should be getting the same result in both case.
The only thing I can think of is a problem of numerical precision.
To investigate more I would need your root file.

Cheers,
Philippe.

Hello,

Thank you for support.

Root files and scripts are in
/afs/cern.ch/user/k/khomich/public/root

Thank you.

Hi,

In C,C++ the function abs takes an int and return an int.
You need to use fabs (which takes a float and return a float) or
the C++ function std::abs (which is not available from CINT).

Cheers,
Philippe.

Hello,

Yes, I always forget about it…

Thank you for help.