File indexing completed on 2025-01-18 09:55:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DDREC_DDGEAR_H
0014 #define DDREC_DDGEAR_H
0015
0016 #include "DD4hep/Detector.h"
0017 #include "DD4hep/DetElement.h"
0018
0019 #include "gear/GEAR.h"
0020 #include "gearimpl/GearParametersImpl.h"
0021 #include "gearimpl/SimpleMaterialImpl.h"
0022 #include "gear/GearMgr.h"
0023
0024 namespace gear{
0025 class GearParametersImpl ;
0026 class GearMgr ;
0027 }
0028
0029 namespace dd4hep {
0030 namespace rec {
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 class GearHandle {
0041
0042 protected:
0043 gear::GearParametersImpl* _gObj ;
0044 std::string _name ;
0045 std::vector< gear::SimpleMaterialImpl > _materials ;
0046
0047 public :
0048
0049 GearHandle() : _gObj( 0 ) , _name( "UNKNOWN" ) {}
0050
0051
0052
0053 GearHandle( gear::GearParametersImpl* gearObj, const std::string& nam ) : _gObj( gearObj ) , _name( nam ) {}
0054
0055
0056 virtual ~GearHandle() {
0057 if( _gObj)
0058 delete _gObj ;
0059 }
0060
0061
0062 const std::string& name() { return _name ; }
0063
0064
0065 gear::GearParametersImpl* gearObject() { return _gObj ; }
0066
0067
0068 gear::GearParametersImpl* takeGearObject() {
0069 gear::GearParametersImpl* obj = _gObj ;
0070 _gObj = 0 ;
0071 return obj ;
0072 }
0073
0074
0075
0076 void addMaterial(const std::string nam, double A, double Z, double density, double radLen, double intLen){
0077
0078 _materials.push_back( gear::SimpleMaterialImpl (nam, A, Z, density, radLen, intLen) ) ;
0079 }
0080
0081
0082 const std::vector< gear::SimpleMaterialImpl >& materials() { return _materials ; }
0083
0084
0085
0086 GearHandle(const DetElement& ) : _gObj(0) {}
0087 GearHandle(const GearHandle& ,const DetElement& ) : _gObj(0) {}
0088 } ;
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098 gear::GearMgr* createGearMgr( Detector& description , const std::string& pluginName="GearForILD" ) ;
0099
0100 }}
0101
0102
0103
0104 #endif