CMS 3D CMS Logo

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:
15 
21 
23  const MagneticFieldProvider<float> * mfp,
24  double sf=1.) :
25  Base(pos,rot), MagneticField(), theProvider(mfp),
27 
28  ~MagVolume() override;
29 
30  LocalVector fieldInTesla( const LocalPoint& lp) const;
31  GlobalVector fieldInTesla( const GlobalPoint& lp) const;
32 
33  virtual bool inside( const GlobalPoint& gp, double tolerance=0.) const = 0;
34  virtual bool inside( const LocalPoint& lp, double tolerance=0.) const {
35  return inside( toGlobal(lp), tolerance);
36  }
37 
39 
41  virtual const std::vector<VolumeSide>& faces() const = 0;
42 
43  ::GlobalVector inTesla ( const ::GlobalPoint& gp) const override {
44  return fieldInTesla( gp);
45  }
46 
48  bool isIron() const {return isIronFlag;}
49  void setIsIron(bool iron) {isIronFlag = iron;}
51 
52 private:
53 
57  // Temporary hack to keep information on material. Will eventually be replaced!
58  bool isIronFlag;
59 
60 };
61 
62 #endif
bool theProviderOwned
Definition: MagVolume.h:55
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition: MagVolume.h:19
void setIsIron(bool iron)
Definition: MagVolume.h:49
const double tolerance
double theScalingFactor
Definition: MagVolume.h:56
~MagVolume() override
Definition: MagVolume.cc:6
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
bool isIronFlag
Definition: MagVolume.h:58
virtual const std::vector< VolumeSide > & faces() const =0
Access to volume faces.
const MagneticFieldProvider< float > * provider() const
Definition: MagVolume.h:38
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MagVolume.h:17
GloballyPositioned< float >::LocalVector LocalVector
Definition: MagVolume.h:18
virtual bool inside(const GlobalPoint &gp, double tolerance=0.) const =0
GloballyPositioned< float > Base
Definition: MagVolume.h:16
::GlobalVector inTesla(const ::GlobalPoint &gp) const override
Definition: MagVolume.h:43
bool isIron() const
Temporary hack to pass information on material. Will eventually be replaced!
Definition: MagVolume.h:48
GlobalPoint toGlobal(const LocalPoint &lp) const
MagVolume(const PositionType &pos, const RotationType &rot, const MagneticFieldProvider< float > *mfp, double sf=1.)
Definition: MagVolume.h:22
GloballyPositioned< float >::GlobalVector GlobalVector
Definition: MagVolume.h:20
LocalVector fieldInTesla(const LocalPoint &lp) const
Definition: MagVolume.cc:11
const MagneticFieldProvider< float > * theProvider
Definition: MagVolume.h:54
virtual bool inside(const LocalPoint &lp, double tolerance=0.) const
Definition: MagVolume.h:34
void ownsFieldProvider(bool o)
Definition: MagVolume.h:50