00001
00002 #ifndef DETDESC_VOLUMES_LVOLUME_H
00003 #define DETDESC_VOLUMES_LVOLUME_H
00004
00006 #include "DetDesc/LogVolBase.h"
00007 #include "DetDesc/CLIDLVolume.h"
00008
00010 template <class TYPE>
00011 class DataObjectFactory;
00012
00020 class LVolume: public LogVolBase
00021 {
00023 friend class DataObjectFactory<LVolume>;
00024
00025 public:
00026
00036 LVolume( const std::string& name ,
00037 ISolid* Solid ,
00038 const std::string& material ,
00039 const std::string& sensitivity = "" ,
00040 const std::string& magnetic = "" );
00041
00043 virtual ~LVolume();
00044
00045 public:
00046
00050 virtual const CLID& clID () const ;
00051
00055 static const CLID& classID () ;
00056
00065 inline virtual bool
00066 isAssembly () const { return false ; }
00067
00072 inline virtual const ISolid*
00073 solid () const { return m_solid ; }
00074
00081 inline virtual const Material*
00082 material () const
00083 { return 0 != m_material ? m_material : findMaterial() ; };
00084
00089 inline virtual const std::string&
00090 materialName () const { return m_materialName; }
00091
00098 inline virtual bool isInside
00099 ( const Gaudi::XYZPoint& LocalPoint ) const
00100 { return m_solid->isInside( LocalPoint ) ; };
00101
00111 virtual StatusCode belongsTo
00112 ( const Gaudi::XYZPoint& LocalPoint ,
00113 const int Level ,
00114 ILVolume::PVolumePath& pVolumePath ) const ;
00115
00125 virtual StatusCode belongsTo
00126 ( const Gaudi::XYZPoint& LocalPoint ,
00127 const int Level ,
00128 ILVolume::ReplicaPath& replicaPath ) const ;
00129
00150 virtual unsigned int intersectLine
00151 ( const Gaudi::XYZPoint & Point ,
00152 const Gaudi::XYZVector & Vector ,
00153 ILVolume::Intersections & intersections ,
00154 const double threshold ) const ;
00155
00178 virtual unsigned int intersectLine
00179 ( const Gaudi::XYZPoint & Point ,
00180 const Gaudi::XYZVector & Vector ,
00181 ILVolume::Intersections & intersections ,
00182 const ISolid::Tick tickMin ,
00183 const ISolid::Tick tickMax ,
00184 const double Threshold ) const ;
00185
00191 virtual std::ostream& printOut
00192 ( std::ostream & os = std::cout ) const ;
00193
00199 virtual MsgStream& printOut
00200 ( MsgStream & os ) const;
00201
00207 inline ILVolume* reset ()
00208 {
00210 if( 0 != m_solid ) { m_solid->reset() ; }
00212 m_material = 0 ;
00214 return LogVolBase::reset() ;
00215 };
00216
00217
00218
00222 LVolume( const std::string& Name = "");
00223
00224 private:
00225
00227 LVolume ( const LVolume& );
00229 LVolume& operator=( const LVolume& );
00230
00231 private:
00232
00237 const Material* findMaterial() const ;
00238
00249 bool intersectBody
00250 ( const Gaudi::XYZPoint & Point ,
00251 const Gaudi::XYZVector & Vector ,
00252 ILVolume::Intersections & intersections ,
00253 ISolid::Tick & tickMin ,
00254 ISolid::Tick & tickMax ,
00255 const double Threshold ) const ;
00256
00265 bool intersectBody
00266 ( const Gaudi::XYZPoint& Point ,
00267 const Gaudi::XYZVector& Vector ,
00268 ILVolume::Intersections& intersections ,
00269 const double Threshold ) const ;
00270
00271 private:
00272
00274 ISolid* m_solid ;
00276 std::string m_materialName ;
00277 mutable const Material* m_material ;
00278
00279 };
00280
00281
00282
00283
00284 #endif
00285 // ============================================================================
00286
00287
00288
00289
00290
00291
00292
00293