Belle II Software  release-05-02-19
EveVisBField.h
1 #pragma once
2 #include <framework/geometry/BFieldManager.h>
3 
4 #include <TEveTrackPropagator.h>
5 
6 namespace Belle2 {
12  class EveVisBField : public TEveMagField {
13  public:
14  EveVisBField(): TEveMagField() { }
15  virtual ~EveVisBField() { }
16 
18  virtual TEveVector GetField(Float_t x, Float_t y, Float_t z) const override
19  {
20  TEveVector v;
21 
22  v.Set(BFieldManager::getField(x, y, z) / Unit::T);
23  v.fZ *= -1; //Eve has inverted B field convention
24  v.fZ -= 1e-6; //field must not be zero!
25 
26  return v;
27  }
29  virtual Float_t GetMaxFieldMag() const override { return 1.5; }
30  };
32 }
Belle2::BFieldManager::getField
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Definition: BFieldManager.h:110
Belle2::Unit::T
static const double T
[tesla]
Definition: Unit.h:130
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::EveVisBField::GetMaxFieldMag
virtual Float_t GetMaxFieldMag() const override
maximal field strength (is this correct?)
Definition: EveVisBField.h:29
Belle2::EveVisBField
Provide magnetic field values for TEveTrackPropagator.
Definition: EveVisBField.h:12
Belle2::EveVisBField::GetField
virtual TEveVector GetField(Float_t x, Float_t y, Float_t z) const override
return field strength at given coordinates, using Eve conventions.
Definition: EveVisBField.h:18