Linear Collider Forum



Home » Software Tools » org.lcsim » SpacePoint, SpaceVector etc
SpacePoint, SpaceVector etc [message #1243] Fri, 02 November 2007 10:01 Go to next message
kutschke
Messages: 16
Registered: June 2007
Location: Fermiliab
I understand that, in new code, we have been asked to use SpacePoint, SpaceVector etc, in preference to Hep3Vector.

However there are two SpacePoint classes in the org.lcsim repository:

org.lcsim.spacegeom
org.lcsim.recon.tracking.spacegeom.SpacePath

Similarly for all of the Space* classes except SpaceVector, which is only found in org.lcsim.spacegeom

From this, I presume that we are to use the version in org.lcsim.spacegeom.

I also understand that for 4 vectors the recommended class is still Hep4Vector.

Do I have this right?

Rob


Rob Kutschke Computing Division, MS#234
kutschke@fnal.gov Fermi National Accelerator Laboratory
Phone: (630) 840-5645 P.O. Box 500
Fax: (630) 840-2783 Batavia, IL 60510
http://home.fnal.gov/~kutschke/
Re: SpacePoint, SpaceVector etc [message #1248 is a reply to message #1243] Fri, 02 November 2007 13:58 Go to previous messageGo to next message
jfstrube
Messages: 64
Registered: September 2004
Location: Tohoku University
Hi Rob,

I have taken the liberty to add SpaceVector to org.lcsim.spacegeom, because it was missing in my estimation.

Classes in org.lcsim.spacegeom implement Hep3Vector, so you should be able to use them with any class that expects Hep3Vectors.

Note, however, that the method v() in its current implementation returns the vector as an array, with whatever coordinates the SpaceVector comes in, so a polar vector would return r, phi, theta rather than x, y, z. On the other hand, every implementation of Hep3Vector that I am aware of assumes cartesian coordinates.
In other words, if you have classes that take Hep3Vectors and operate on .X(), .Y() and .Z(), then you are safe.
If your classes use v() and indices, you will be in trouble.

To answer your last question, there is no LorentzVector implementation in SpaceGeom AFAIK.

Hope that helps,
Jan
Re: SpacePoint, SpaceVector etc [message #1250 is a reply to message #1248] Fri, 02 November 2007 14:19 Go to previous messageGo to next message
kutschke
Messages: 16
Registered: June 2007
Location: Fermiliab

Thanks Jan,

Is it intended to depracate the other copy of Space* that is in org.lcsim?

I am trying to understand why the Space* are prefered to Hep3Vector. Is it because the Space* classes allow one to distinguish between a displacement vector and a direction vector, thereby giving an extra layer of type safety. Or are there other reasons.

I presume that VecOp is usable on org.lcsim.spacegeom objects ( with the caveat of the v() method that you mentioned.).

Rob


Rob Kutschke Computing Division, MS#234
kutschke@fnal.gov Fermi National Accelerator Laboratory
Phone: (630) 840-5645 P.O. Box 500
Fax: (630) 840-2783 Batavia, IL 60510
http://home.fnal.gov/~kutschke/
Re: SpacePoint, SpaceVector etc [message #1251 is a reply to message #1250] Fri, 02 November 2007 14:37 Go to previous messageGo to next message
Dmitry Onoprienko
Messages: 26
Registered: May 2004
Location: Kansas State University
Hi Rob,

One advantage of SpacePoint compared to BasicHep3Vector is that it does "lazy" transformations between cartesian, spherical, and cylindrical representations. I also like having SpacePointVector to represent straight line segments in space (silicon strips, for example).

A serious disadvantage in my view is that any SpacePoint is a heavyweight object compared to BasicHep3Vector - it holds 7 doubles and a reference. So if I used it as a field in any hit class, for example, I would be wasting memory.

No idea why there are two spacegeom packages.

- Dima.

[Updated on: Sat, 10 November 2007 21:52]

Re: SpacePoint, SpaceVector etc [message #1252 is a reply to message #1248] Fri, 02 November 2007 14:39 Go to previous messageGo to next message
NormanGraf
Messages: 80
Registered: January 2004
Hello Rob,
One should use the org.lcsim.spacegeom package. As Jan points out, the relevant classes in that package implement the Hep3Vector interface.
Norman
Re: SpacePoint, SpaceVector etc [message #1256 is a reply to message #1243] Mon, 05 November 2007 10:05 Go to previous message
tonyj
Messages: 138
Registered: January 2004

Hi Rob, I don't think that in general one should use Space* in preference to Hep3Vector etc. In general I would say that one should use:

hep.physics.vec.Hep3Vector (or its implementation BasicHep3Vector)

whenever one is referring to anything other than a point in space (e.g. momentum, fields, etc), and perhaps

org.lcsim.spacegeom.SpacePoint

(which implements Hep3Vector) when one is referring to a point in space. My personal opinion is that all other Space* classes should be restricted to use inside TRF only (although I am willing to listen to counter arguments).

To try to make things clearer (but in fact doing the opposite) I started to move SpacePoint to hep.physics.vec so we could recommend using only hep.physics.vec classes. In doing so I found several problems with the current incarnation of the class, which are documented in the source code here:

http://java.freehep.org/svn/showfile.svn?path=%2ffreehep%2ft runk%2fhep%2ffreehep-physics%2fsrc%2fmain%2fjava%2fhep%2fphy sics%2fvec%2fSpacePoint.java&revision=HEAD&name=free hep

The problems are not yet fixed. The same issues may exist with other versions of SpacePoint.

Tony
Previous Topic: Bug in AIDA.SaveaAsZip
Next Topic:Units for material properties
Goto Forum:
  

[ PDF ]

Current Time: Fri Dec 6 07:02:24 Pacific Standard Time 2019
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software