Hi Peter, > but not between 3 and 4 Vectors. What would you expect to get as result > of the scalar product between a 3-vector and a 4-vector ... It seems me it is evident. It must be used all possible information. Si in the case of scalar product between a 3-vector and a 4-vector must give scalar 3*3 Victor Peter Malzacher wrote: > > Hi Martin, hi Pasha, > > > inline void TLorentzVector::SetPPhiThetaM(Double_t p, > > Double_t phi, > > Double_t theta, > > Double_t m) > > { > > // initialize vector with spherical coordinates > > SetX(p * TMath::Cos(phi) * TMath::Sin(theta)); > > SetY(p * TMath::Sin(phi) * TMath::Sin(theta)); > > SetZ(p * TMath::Cos(theta)); > > fE = TMath::Sqrt(p*p + m*m); > > } > > I can implement setter functions in spherical coordinates, > but I prefer to name it SetRhoPhiTheta. > > > I'd like to raise once again the issue of the relationship between > > TLorentzVector and TVector3. I'm coming back to it every time I realize > > that I can't do something as efficient and convenient as I'd like to. > > As announced some months ago we will cleanup the current implementation > of TLorentzVecter when the corresponding classes of ZOOM and CLHEP will > be merged. We will try to stay as close to their implementation as > possible. > The problem with inheriting from TVector3 occurs when one > uses methods which meke sense between 3-Vectors or between 4-Vectors > but not between 3 and 4 Vectors. What would you expect to get as result > of the scalar product between a 3-vector and a 4-vector ... > Therefore I think it is better to be explicit and get the 3-Vector > component > of a 4-Vector when you need it. Ok its slightly more inconvenient to > type, > but if one gets a const reference to an internal 3-Vector its as > efficient as > inheritance. > > Peter -- Victor M. Perevoztchikov perev@bnl.gov perev@vxcern.cern.ch Brookhaven National Laboratory MS 510A PO Box 5000 Upton NY 11973-5000 tel office : 631-344-7894; fax 631-344-4206; home 631-345-2690
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:41 MET