Dear friends, If one stores the TLorentzVector components in the class as 'the invariant' and a 3-vector in spherical coordinates, these sort of rounding problems can be prevented (this is one of the cases I meant in one of my earlier mails when we discussed about how to treat 4-vectors). Another thing is (as was mentioned by somenone already, but I forgot the name <must be the age!>) that by storing the invariant the particle identity (i.e. mass) is always conserved in physics processes and doesn't have to be re-calculated in case the energy/momentum changes. Cheers, Nick. Matt Dobbs wrote: > > Hi, > > Looking at TLorentzVector class, I wish to find the cosine of the angle > between the vector and the z axis. For this I would expect to use > CosTheta() method which is defined in TLorentzVector.h as follows: > > inline Double_t TLorentzVector::CosTheta() const { > Double_t ptot = Mag(); > return ptot == 0.0 ? 1.0 : fZ/ptot; > } > > If I check the definition of Mag() I find that it is the invariant mass > NOT the Magnitude of the three vector: > > inline Double_t TLorentzVector::Mag2() const { > return T()*T() - Vect().Mag2(); > } > inline Double_t TLorentzVector::Mag() const { > Double_t mm = Mag2(); > return mm < 0.0 ? -TMath::Sqrt(-mm) : TMath::Sqrt(mm); > } > > As example: > > root [49] v = new TLorentzVector(1,1,1,1.75) > (class TLorentzVector*)0x8723668 > root [50] v.Vect().CosTheta() > (Double_t)5.77350269189625731e-01 > root [51] v.Mag() > (Double_t)2.50000000000000000e-01 > root [52] v.CosTheta() > (Double_t)4.00000000000000000e+00 > (Root V2.22 Redhat linux 5.1) > So v.Vect().CosTheta() gives the expected value but > v.CosTheta() gives a non-physical cosine > 1. > > Have I misuderstood the meaning of CosTheta? It seems intuitive to me that > TLorentzVector::Mag() would call TVector3::Mag() and likewise for > TLorentzVector::CosTheta(). > > ~Matt > > _________________________________________________________________________ > Matt D O B B S > CERN EP Division, ATLAS Experiment Office Tel: 41.22.76.71272 (Swiss) > Office: 40-1-C15, ATLAS Bldg. Home Tel: 0450 282544 (France) > Email: Matthew.Adam.Dobbs@Cern.CH http://wwwhep.phys.uvic.ca/~mdobbs/ > Department of Physics and Astronomy, University of Victoria, Canada
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:39 MET