View Javadoc

1   package org.lcsim.geometry;
2   
3   import hep.physics.vec.BasicHep3Vector;
4   import hep.physics.vec.Hep3Vector;
5   
6   /**
7    * A field map, allows getting the field at a given point
8    * 
9    * @author tonyj
10   */
11  public interface FieldMap
12  {
13      /**
14       * Get the field magnitude and direction at a particular point.
15       * 
16       * @param position The position at which the field is requested
17       * @param b The field (the object is passed by reference and set to the correct field)
18       */
19      public void getField( double[] position, double[] b );
20  
21      /**
22       * Get the field magnitude and direction at a particular point. This method requires
23       * allocation of a new object on each call, and should therefore not be used if it may
24       * be called many times.
25       * 
26       * @param position The position at which the field is requested
27       * @return The field.
28       * @deprecated @use getField(double[], double[])
29       */
30      public double[] getField( double[] position );
31  
32      /**
33       * Get the field magnitude and direction at a particular point.
34       * 
35       * @param position The position at which the field is requested.
36       * @param field The field. If not <code>null</code> this is passed by reference and
37       *            set to the correct field
38       * @return The field. This will be the same object passed as field, unless field was
39       *         <code>null</code>
40       */
41      public Hep3Vector getField( Hep3Vector position, BasicHep3Vector field );
42  
43      /**
44       * Get the field magnitude and direction at a particular point. Equivalent to
45       * <code>getField(position,null)</code>.
46       */
47      public Hep3Vector getField( Hep3Vector position );
48  }