////////////////////////////////////////////////////////////////////////
/// \class RAT::EnvelopeConstructor
///
/// \brief Class that constructs the Envelope Logical Volume
///
/// \author Phil Jones
/// \author Aksel Hallin -- contact person
///
/// REVISION HISTORY:\n
/// 07/09 : P.Jones - First Revision, new file. \n
/// 03/12 : P.Jones - Allowed for cuboid envelopes. \n
///
/// \details Takes the envelope parameters and constructs a
/// envelope solid and places it into a logical volume
///
///
////////////////////////////////////////////////////////////////////////
#ifndef __RAT_EnvelopeConstructor__
#define __RAT_EnvelopeConstructor__
#include
#include
#include
class G4LogicalVolume;
class G4Material;
class G4VisAttributes;
namespace RAT
{
class EnvelopeConstructor : public ConstructorBase
{
public:
/// Constructor for polyhedra (faces>0) or cylindrical (faces==0) envelope version. Needs parameters and a name
EnvelopeConstructor( const std::string &prefix,///< Prefix to name objects
double top, ///< Position of envelope top, above PMT equator
double bottom, ///< Position of envelope bottom, -ve if below equator
double radius, ///< The face radius, see G4Polyhedra definition
int faces, ///< The number of faces, 6 for hex
G4VisAttributes* visAttribues, ///< Visualisation attributes
G4Material* exterior ///< Pointer to the exterior material
);
// Constructor for cuboid envelope version. Needs parameters and a name
EnvelopeConstructor( const std::string &prefix,///< Prefix to name objects
double top, ///< Position of envelope top, above PMT equator
double bottom, ///< Position of envelope bottom, -ve if below equator
double xWidth, ///< X width
double yWidth, ///< Y width
G4VisAttributes* visAttribues, ///< Visualisation attributes
G4Material* exterior ///< Pointer to the exterior material
);
virtual ~EnvelopeConstructor() {}
/// Constructs the logical volume
void Construct();
/// Returns the logical volume for the bucket
G4LogicalVolume* GetLogicalVolume();
/// Sets the logical volume, if the user has set no envelope option
void SetLogicalVolume( G4LogicalVolume* envLogic );
// Returns the top in z co-ord relative to PMT equator
double GetMaxHeight();
/// Returns the bottom in z co-ord relative to PMT equator
double GetMaxDepth();
/// Returns the radius of the concentrator, for a hex shape this is the distance of the plane that has \n
/// a normal that passes through the origin (See G4Polyhedra definition).
double GetHexRadius();
/// Returns the offset from the pmt equator (in Z) where the concentrator should be placed
double GetOffset();
protected:
std::string fPrefix; ///< Prefix to name objects
double fTop; ///< Top of the Envelope Z coord
double fBottom; ///< Bottom of the Envelope Z coord
// Radius or width
double fRadius; ///< Radius of the Envelope rho coord
double fXWidth; ///< X dimension width of the cuboid
double fYWidth; ///< Y dimension width of the cuboid
double fOffset; ///< Envelope offset along z axis
int fNumFaces; ///< Number of faces on the envelope
G4VisAttributes* fVisAttributes; ///< Visualisation attributes
G4LogicalVolume* fEnvelopeLogic; ///< The completed logical volume
G4Material* fExterior; ///< The material for the envelope (same as mother volume)
private:
/// To prevent usage
EnvelopeConstructor();
};
inline double EnvelopeConstructor::GetMaxHeight()
{
return fTop;
}
inline double EnvelopeConstructor::GetMaxDepth()
{
return fBottom;
}
inline double EnvelopeConstructor::GetHexRadius()
{
return fRadius;
}
inline double EnvelopeConstructor::GetOffset()
{
return fOffset;
}
} //::RAT
#endif