MarlinTPC  1.2.0
MagneticField.h
1 #ifndef MAGNETICFIELD_H
2 #define MAGNETICFIELD_H 1
3 
4 
5 
6 // MarlinTPC
7 #include "Field.h"
8 
9 // CLHEP
10 #include "CLHEP/Vector/ThreeVector.h"
11 #include "CLHEP/Vector/EulerAngles.h"
12 
13 
14 namespace marlintpc {
15 
20 class MagneticField: public Field {
21 
22 public:
25  MagneticField( std::string field_typename );
26 
29  virtual ~MagneticField();
30 
33  virtual Field *new_field( void ) = 0;
34 
37  virtual bool construct( EVENT::LCCollection * ) = 0;
38 
41  virtual CLHEP::Hep3Vector get_field_value( const CLHEP::Hep3Vector & );
42 
45  virtual CLHEP::Hep3Vector get_field_error( );
46 
50  void set_translation ( const CLHEP::Hep3Vector & );
51 
54  void set_rotation ( const double &, const double & );
55 
58  void set_scale_factor ( const double & );
59 
60 
61 protected:
62 
65  virtual CLHEP::Hep3Vector get_field_value_coil_coordinates( const CLHEP::Hep3Vector & ) = 0;
66 
67 private:
68 
69  CLHEP::Hep3Vector _translation;
70  double _x_rotation;
71  double _y_rotation;
72  double _scale_factor;
73 };
74 
75 } // namespace marlintpc
76 
77 #endif // MAGNETICFIELD_H
void set_translation(const CLHEP::Hep3Vector &)
sets the relative position of the origin of the field map (i.e.
Definition: MagneticField.cc:29
Field : A base interface to an electric or magnetic field.
Definition: Field.h:22
MagneticField(std::string field_typename)
constructor
Definition: MagneticField.cc:13
void set_scale_factor(const double &)
sets the scale factor for the magnetic field, i.e.
Definition: MagneticField.cc:45
MagneticField : A base interface to a magnetic field.
Definition: MagneticField.h:20
virtual bool construct(EVENT::LCCollection *)=0
constructs the field from an LCCollection of data objects (could be anything...
virtual CLHEP::Hep3Vector get_field_value(const CLHEP::Hep3Vector &)
gets the field value at a specified point
Definition: MagneticField.cc:51
virtual CLHEP::Hep3Vector get_field_error()
gets the field error.
Definition: MagneticField.cc:66
virtual Field * new_field(void)=0
returns a new field...
virtual ~MagneticField()
destructor
Definition: MagneticField.cc:23
void set_rotation(const double &, const double &)
sets the orientation of the TPC with respect to the coil axis
Definition: MagneticField.cc:38
virtual CLHEP::Hep3Vector get_field_value_coil_coordinates(const CLHEP::Hep3Vector &)=0
gets the field value at a point given in coil coordinates