CMS 3D CMS Logo

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