RE: [ROOT] TLorentzVector

From: Philippe Canal (pcanal@fnal.gov)
Date: Fri May 25 2001 - 21:23:18 MEST


Hi Matthew,

The TTree::Draw mechanism has been going through a lot of changes lately
(due to the new I/O scheme and additional features added).   Some of the
changes made after 3.00.06 did involve calling member functions as in your
case.

I tried your example with the latest ROOT version and had no problem with
it.

Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Matthew Bellis
Sent: Friday, May 25, 2001 1:38 PM
To: Rene Brun
Cc: roottalk@pcroot.cern.ch
Subject: Re: [ROOT] TLorentzVector


Rene,

	If I do it in an interactive session as you have described, yes, it
works fine.

	But I am creating a root file, and then reading it in. This all used
to work fine. And I can still access all the other member functions of
TLorentzVector. However, I cannot access the M(). In fact, I cannot get it
to
execute tree->Draw("P.E()*P.E() - P.Rho()*P.Rho()"), which should return the
mass, albeit in a brute force fashion.

	Here is a sketch of what I do, which used to work under v2.23...

int main{

 TLorentzVector *pP = NULL;
  TLorentzVector P;
  pP = &P;

  TFile RootOut (ROOTFILE, "recreate", "");
  TTree *mytree = new TTree ("mytree", "A TTree object");
  mytree->Branch ("P", "TLorentzVector", &pP, 64000, 1);

///// Loop over events

  P.SetXYZM(px, py, pz, 0.938);

  mytree->Fill ();

///// End loop


  RootOut.Write ();

}

Then I write a macro to execute in Root...

{
  gROOT->Reset();

  gSystem->Load("libPhysics");

  TFile f("Output.root");

  TTree* tree = (TTree*) f.Get("mytree");

  tree->Draw("P.M()");
}

 	At this point Root freezes and I have to kill it. If the last line
was

  tree->Draw("P.X()");

	it works fine.

	Am I doing something wrong? Am I using some old syntax which is no
longer appropriate? I am no Root expert. Any advice at all would be welcome.

Matt Bellis
RPI



On May 25,  3:20pm, Rene Brun wrote:
> Subject: Re: [ROOT] TLorentzVector
> Hi Matt,
>
> The M and M2 functions have always been and still are in TLorentzVector.
> Try the following in an interactive session:
>
> root > gSystem->Load("libPhysics");
> root > TLorentzVector junk(1,2,3,4);
> root > junk.M()
> root > junk.M2()
>
> Rene Brun
>
> Matthew Bellis wrote:
> >
> > Hi Root users,
> >
> >     I recently installed v3.00.06 on my Debian machine. I used the
> > linuxdeb2 architecture for configure, but I changed the compiler to gcc,
> > instead of egcc.
> >
> >     I am finding though that I cannot access the M() or M2() member
> > functions of a TLorentzVector. I have tried filling the Vector a number
> > of ways, but it always hangs the program when I try to acess these
> > functions.
> >
> >     Has anyone else encountered this problem? It used to work fine with
> > v2.23. Otherwise the newer version seems to be fine.
> >
> > Matt Bellis
> > RPI
>-- End of excerpt from Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:46 MET