[ROOT] Still a memory leak with TLorentzVector ?

From: Maurik Holtrop (maurik.holtrop@unh.edu)
Date: Thu May 02 2002 - 18:46:22 MEST


Dear Root, Masa,

This is most likely a Cint issue. 
The memory leak in TLorentzVector reported earlier:
http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk01/2232.html
does not seem to be entirely resolved.

Using root 3.02/07 with the test program below, the execution of
.x test.C
does not give any problems.
However,
.L test.C
test()
seems to leak memory quite seriously.
If one comments out the V4gamma1 = V4Eb - V4e1; line and replaces it
with the commented line, all is well.

The subtleties behind all this escape me.

Cheers,

	Maurik
--------------------------------------------------------------------- 

void test()
{
  TLorentzVector V4e1(0.5,0.30,0.50,0.6);
  TLorentzVector V4Eb(0,0,6.0,6.0);
  TLorentzVector V4gamma1(0,0,0,0);

  Float_t Q2=0;
  Float_t W2=0;
  Float_t W =0; 

  Float_t TORAD=TMath::Pi()/180;
  Float_t TODEG=180/TMath::Pi();

  Int_t i;
  Int_t BigNum = 500000;
  Float_t masa=0.;

  for(i=0;i< BigNum ;i++)
    {
      V4e1.SetXYZM(i/BigNum, -i/BigNum, 4.*i/BigNum,0.000511);
      
      V4gamma1 = V4Eb - V4e1;

      //      V4gamma1.SetXYZT(V4Eb.X()-V4e1.X(),V4Eb.Y()-V4e1.Y(),
      //	       V4Eb.Z()-V4e1.Z(),V4Eb.T()-V4e1.T());

      
      Q2 = -V4gamma1.M2();
      W2 = .938272*.938272+2*.938272*(V4Eb.E()-V4e1.E())-Q2;
      W  = TMath::Sqrt(W2);
      
    }
  gObjectTable->Print(); 
}



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:52 MET