LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
MagneticFieldStandard.h
Go to the documentation of this file.
1 // \file MagneticFieldStandard.h
3 //
4 // \brief header of class for storing/accessing magnetic fields
5 //
6 // \author ebrianne@fnal.gov
7 //
9 #ifndef MAGNETICFIELD_MAGNETICFIELDSTANDARD_H
10 #define MAGNETICFIELD_MAGNETICFIELDSTANDARD_H
11 
12 // nug4 libraries
14 
15 // std includes
16 #include <string>
17 
18 // Geant4 includes
19 #include "Geant4/G4ThreeVector.hh"
20 
21 // FHiCL libraries
22 namespace fhicl { class ParameterSet; }
23 
24 namespace mag {
25 
27 
28  public:
29 
30  explicit MagneticFieldStandard(fhicl::ParameterSet const& pset);
32  virtual ~MagneticFieldStandard() = default;
33 
34  void reconfigure(fhicl::ParameterSet const& pset);
35 
36  //Return std::vector<MagneticFieldDescription>
37  std::vector<MagneticFieldDescription> const& Fields() const override { return fFieldDescriptions; }
38 
39  //Return the size of std::vector<MagneticFieldDescription>
40  size_t NumFields() const override { return fFieldDescriptions.size(); }
41 
42  //Return the field mode
43  MagFieldMode_t const& UseField(size_t f) const override { return fFieldDescriptions[f].fMode; }
44 
45  //return the magnetized volumes
46  std::string const& MagnetizedVolume(size_t f) const override { return fFieldDescriptions[f].fVolume; }
47 
48  // return the field at a particular point
49  G4ThreeVector const FieldAtPoint(G4ThreeVector const& p=G4ThreeVector(0)) const override;
50 
51  // This method will only return a uniform field based on the input
52  // volume name. If the input volume does not have a uniform field
53  // caveat emptor
54  G4ThreeVector const UniformFieldInVolume(std::string const& volName) const override;
55 
56  private:
57 
58  // The simplest implmentation has a constant field inside a named
59  // detector volume
60  std::vector<MagneticFieldDescription> fFieldDescriptions;
61 
62  protected:
63 
64  }; // class MagneticFieldStandard
65 } //namespace mag
66 #endif // MAGNETICFIELD_MAGNETICFIELDSTANDARD_H
std::vector< MagneticFieldDescription > const & Fields() const override
size_t NumFields() const override
TFile f
Definition: plotHisto.C:6
parameter set interface
std::vector< MagneticFieldDescription > fFieldDescriptions
Descriptions of the fields.
enum mag::MagneticFieldMode MagFieldMode_t
MagFieldMode_t const & UseField(size_t f) const override
std::string const & MagnetizedVolume(size_t f) const override