CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MagVolume.h
Go to the documentation of this file.
1 #ifndef MagVolume_H
2 #define MagVolume_H
3 
7 
8 #include <vector>
9 
10 template <class T>
12 
13 class MagVolume : public GloballyPositioned<float>, public MagneticField {
14 public:
20 
21  MagVolume(const PositionType& pos, const RotationType& rot, const MagneticFieldProvider<float>* mfp, double sf = 1.)
22  : Base(pos, rot),
23  MagneticField(),
24  theProvider(mfp),
26  theScalingFactor(sf),
27  isIronFlag(false) {}
28 
29  ~MagVolume() override;
30 
31  LocalVector fieldInTesla(const LocalPoint& lp) const;
32  GlobalVector fieldInTesla(const GlobalPoint& lp) const;
33 
34  virtual bool inside(const GlobalPoint& gp, double tolerance = 0.) const = 0;
35  virtual bool inside(const LocalPoint& lp, double tolerance = 0.) const { return inside(toGlobal(lp), tolerance); }
36 
38 
40  virtual const std::vector<VolumeSide>& faces() const = 0;
41 
42  ::GlobalVector inTesla(const ::GlobalPoint& gp) const override { return fieldInTesla(gp); }
43 
45  bool isIron() const { return isIronFlag; }
46  void setIsIron(bool iron) { isIronFlag = iron; }
48 
49 private:
53  // Temporary hack to keep information on material. Will eventually be replaced!
54  bool isIronFlag;
55 };
56 
57 #endif
bool theProviderOwned
Definition: MagVolume.h:51
::GlobalVector inTesla(const ::GlobalPoint &gp) const override
Definition: MagVolume.h:42
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition: MagVolume.h:18
void setIsIron(bool iron)
Definition: MagVolume.h:46
const double tolerance
double theScalingFactor
Definition: MagVolume.h:52
~MagVolume() override
Definition: MagVolume.cc:6
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
bool isIronFlag
Definition: MagVolume.h:54
const MagneticFieldProvider< float > * provider() const
Definition: MagVolume.h:37
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MagVolume.h:16
GloballyPositioned< float >::LocalVector LocalVector
Definition: MagVolume.h:17
virtual bool inside(const GlobalPoint &gp, double tolerance=0.) const =0
GloballyPositioned< float > Base
Definition: MagVolume.h:15
bool isIron() const
Temporary hack to pass information on material. Will eventually be replaced!
Definition: MagVolume.h:45
GlobalPoint toGlobal(const LocalPoint &lp) const
MagVolume(const PositionType &pos, const RotationType &rot, const MagneticFieldProvider< float > *mfp, double sf=1.)
Definition: MagVolume.h:21
virtual const std::vector< VolumeSide > & faces() const =0
Access to volume faces.
GloballyPositioned< float >::GlobalVector GlobalVector
Definition: MagVolume.h:19
LocalVector fieldInTesla(const LocalPoint &lp) const
Definition: MagVolume.cc:11
const MagneticFieldProvider< float > * theProvider
Definition: MagVolume.h:50
virtual bool inside(const LocalPoint &lp, double tolerance=0.) const
Definition: MagVolume.h:35
void ownsFieldProvider(bool o)
Definition: MagVolume.h:47