//////////////////////////////////////////////////////////////////////// /// \class RAT::GeoPMTBuilderBase /// /// \brief Base class for any pmt factory. /// /// \author Phil Jones /// \author Aksel Hallin -- contact person /// /// REVISION HISTORY:\n /// 07/09 : P.Jones - First Revision, new file.\n /// 02/12 : P.Jones - Second Revision, split functions out into GeoPMTFactoryBase.\n /// 06/12 : P.Jones - Third Revision, add multiple PMT build types.\n /// 2013-12-18 : P.Jones - Removed PMTSD as no longer useful.\n /// /// \details PMT Factories that derive from this class directly should /// call the Construct* functions with the correct params, as /// read from the db or created. Then call assemble full PMT /// to complete the pmt construction. /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_GeoPMTBuilderBase__ #define __RAT_GeoPMTBuilderBase__ #include #include #include class G4Material; class G4VisAttributes; namespace RAT { class PMTConstructorParams; class ConcentratorConstructorParams; class BucketConstructorParams; class PMTBaseConstructorParams; class PMTConstructor; class ConcentratorConstructor; class EnvelopeConstructor; class BucketConstructor; class PMTBaseConstructor; class GeoPMTBuilderBase { public: /// Default constructor GeoPMTBuilderBase(); /// Deletes the pmt objects virtual ~GeoPMTBuilderBase(); protected: /// Initialise, i.e. set the volume name inline void Initialise( const std::string& volumeName, G4Material* motherMaterial ); /// Constructs a PMT void ConstructPMT( const int pmtBuildType, const PMTConstructorParams& params ); /// Constructs a Concentrator void ConstructConc( const int pmtBuildType, const ConcentratorConstructorParams& params ); /// Constructs a bucket, construct a concentrator first if one is required void ConstructBucket( const int pmtBuildType, const BucketConstructorParams& params ); /// Constructs a PMTBase void ConstructPMTBase( const int pmtBuildType, const PMTBaseConstructorParams& params ); /// Adds the pre built parts together into a single envelope volume void AssembleFullPMT( const int pmtBuildType, G4VisAttributes* visAttributes ); /// Creates and attaches a full optical model to the PMT components /// /// @param[in] pmtBuildType as indexed in this classes maps void SetupFullOpticalModel( const int pmtBuildType ); /// Creates and attaches a disc optical model to the envelope /// /// @param[in] pmtBuildType as indexed in this classes maps /// @param[in] model ratdb index of the model to use /// @param[in] params ratdb index of the params to use void SetupDiscOpticalModel( const int pmtBuildType, const std::string& model, const std::string& params ); /// Helpful function to correct the position and direction (from snoman like in db to rat like as used) RATDB Should match RAT, PHIL FIXME void CorrectPMTPosAndDir( const int pmtBuildType, ///< Not all PMT types need correcting G4ThreeVector& position, ///< Input & output position G4ThreeVector& direction ///< Input & output direction ) const; std::string fPrefix; ///< All geometries will be prefixed with this G4Material* fMotherMaterial; ///< The material of the mother volume std::map fPMT; ///< The PMT mapping between build type and constructor (volumes) std::map fConcentrator;///< The Concentrator mapping between build type and constructor (volumes) std::map fEnvelope; ///< The Envelope mapping between build type and constructor (volumes) std::map fBucket; ///< The Bucket mapping between build type and constructor (volumes) std::map fPMTBase; ///< The PMTBase mapping between build type and constructor (volumes) //Add extras e.g. waveguide here }; void GeoPMTBuilderBase::Initialise( const std::string& volumeName, G4Material* motherMaterial ) { fPrefix = volumeName; fMotherMaterial = motherMaterial; } } //::RAT #endif