CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MagneticField.h
Go to the documentation of this file.
1 #ifndef MagneticField_MagneticField_h
2 #define MagneticField_MagneticField_h
3 
11 #include <atomic>
12 
18 
20 public:
21  MagneticField();
22  MagneticField(const MagneticField& orig);
23  virtual ~MagneticField();
24 
27  virtual MagneticField* clone() const { return nullptr; }
28 
30  virtual GlobalVector inTesla(const GlobalPoint& gp) const = 0;
31 
33  GlobalVector inKGauss(const GlobalPoint& gp) const { return inTesla(gp) * 10.F; }
34 
36  GlobalVector inInverseGeV(const GlobalPoint& gp) const { return inTesla(gp) * 2.99792458e-3F; }
37 
39  // engine is defined.
40  virtual bool isDefined(const GlobalPoint& /*gp*/) const { return true; }
41 
44  virtual GlobalVector inTeslaUnchecked(const GlobalPoint& gp) const {
45  return inTesla(gp); // default dummy implementation
46  }
47 
49  int nominalValue() const { return theNominalValue; }
50 
53 
54 protected:
55  // need to be called from the constructor of the deriving classes
56  void setNominalValue();
57 
58 private:
59  //nominal field values
60  int theNominalValue = 0;
62 };
63 
64 #endif
virtual GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const
Definition: MagneticField.h:44
float theInverseBzAtOriginInGeV
Definition: MagneticField.h:61
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:49
virtual ~MagneticField()
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:36
virtual bool isDefined(const GlobalPoint &) const
True if the point is within the region where the concrete field.
Definition: MagneticField.h:40
float inverseBzAtOriginInGeV() const
The inverse of field z component for this map in GeV.
Definition: MagneticField.h:52
GlobalVector inKGauss(const GlobalPoint &gp) const
Field value ad specified global point, in KGauss.
Definition: MagneticField.h:33
void setNominalValue()
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
virtual MagneticField * clone() const
Definition: MagneticField.h:27