Public Member Functions | Private Member Functions | Private Attributes | List of all members
CaptPMTBuilder Class Reference

#include <CaptPMTBuilder.hh>

Inheritance diagram for CaptPMTBuilder:
EDepSim::Builder

Public Member Functions

 CaptPMTBuilder (G4String name, EDepSim::Builder *parent)
 
virtual ~CaptPMTBuilder ()
 
virtual G4LogicalVolume * GetPiece (void)
 
void SetRound (bool v)
 Set that the PMT is round. More...
 
bool IsRound () const
 
void SetBaseLength (double v)
 
double GetBaseLength () const
 
void SetSize (double v)
 
double GetSize () const
 
- Public Member Functions inherited from EDepSim::Builder
 Builder (G4String n, EDepSim::UserDetectorConstruction *c)
 
 Builder (G4String n, EDepSim::Builder *parent)
 
virtual ~Builder ()
 
G4String GetName (void)
 Return the base name of the object that this builds. More...
 
G4String GetLocalName (void)
 Return the base name of the object that this builds. More...
 
void SetLocalName (const G4String &name)
 Set the base name of the logical volume that this builds. More...
 
void SetOpacity (double v)
 Set the relative opacity of the constructed object. More...
 
double GetOpacity (void) const
 Get the relative opacity of the constructed object. More...
 
void SetDaughterOpacity (double v)
 Set the relative opacity of the object daughters. More...
 
EDepSim::UserDetectorConstructionGetConstruction (void)
 Return the detector construction that is building this piece. More...
 
virtual void SetSensitiveDetector (G4VSensitiveDetector *s)
 Set the sensitive detector for this component. More...
 
virtual G4VSensitiveDetector * GetSensitiveDetector (void)
 Get the sensitive detector for this component. More...
 
virtual void SetSensitiveDetector (G4String name, G4String type)
 Set the sensitive detector for this component by name. More...
 
virtual void SetMaximumHitSagitta (double sagitta)
 
virtual void SetMaximumHitLength (double length)
 Set the maximum length of a single hit segment. More...
 
G4UImessenger * GetMessenger (void)
 Return the messenger for this constructor. More...
 
void SetMessenger (G4UImessenger *m)
 Set the messenger for this constructor. More...
 
void AddBuilder (EDepSim::Builder *c)
 
template<class T >
T & Get (G4String n)
 
template<class T >
T * Find (G4String n)
 
bool Check ()
 
void SetCheck (bool v)
 Set the check value. More...
 

Private Member Functions

void Init (void)
 

Private Attributes

double fSize
 The size of the PMT. More...
 
double fBaseLength
 The length of the PMT base. More...
 
bool fRoundPMT
 Flag that the PMT is round (not square). More...
 

Additional Inherited Members

- Protected Member Functions inherited from EDepSim::Builder
G4Material * FindMaterial (G4String m)
 
G4VisAttributes GetColor (G4LogicalVolume *volume, double opacity=0.0)
 
G4VisAttributes GetColor (G4Material *volume, double opacity=0.0)
 

Detailed Description

Construct an unrotated PMT. In the local coordinate system, the PMT points along the positive Z direction.

Definition at line 10 of file CaptPMTBuilder.hh.

Constructor & Destructor Documentation

CaptPMTBuilder::CaptPMTBuilder ( G4String  name,
EDepSim::Builder parent 
)
inline

Definition at line 12 of file CaptPMTBuilder.hh.

13  : EDepSim::Builder(name,parent) {Init();};
static QCString name
Definition: declinfo.cpp:673
void Init(void)
CaptPMTBuilder::~CaptPMTBuilder ( )
virtual

Definition at line 81 of file CaptPMTBuilder.cc.

81 {}

Member Function Documentation

double CaptPMTBuilder::GetBaseLength ( ) const
inline

Definition at line 26 of file CaptPMTBuilder.hh.

26 {return fBaseLength;}
double fBaseLength
The length of the PMT base.
G4LogicalVolume * CaptPMTBuilder::GetPiece ( void  )
virtual

Construct and return a G4 volume for the object. This is a pure virtual function, which means it must be implemented by the inheriting classes. This returns an unplaced logical volume which faces along the Z axis.

Implements EDepSim::Builder.

Definition at line 83 of file CaptPMTBuilder.cc.

83  {
84  const double glassThickness = 3*CLHEP::mm;
85 
86  G4LogicalVolume* logVolume
87  = new G4LogicalVolume(new G4Tubs(GetName(),
88  0.0, GetSize()/2.0,
89  GetBaseLength()/2,
91  FindMaterial("Glass"),
92  GetName());
93  logVolume->SetVisAttributes(GetColor(logVolume));
94 
95  // Construct the photo cathode volume.
96  std::string namePhotoCathode = GetName() + "/PhotoCathode";
97  G4LogicalVolume* logPhotoCathode
98  = new G4LogicalVolume(new G4Tubs(namePhotoCathode,
99  0.0, GetSize()/2.0,
100  glassThickness/2.0,
102  FindMaterial("Glass"),
103  namePhotoCathode);
104  logPhotoCathode->SetVisAttributes(GetColor(logPhotoCathode));
105 
106  // Place the vessel components.
107  new G4PVPlacement(NULL, // rotation.
108  G4ThreeVector(0,0,
109  GetBaseLength()/2.0 - glassThickness/2.0),
110  logPhotoCathode, // logical volume
111  logPhotoCathode->GetName(), // name
112  logVolume, // mother volume
113  false, // (not used)
114  0, // Copy number (zero)
115  Check()); // Check overlaps.
116 
117  // Construct the vacuum.
118  std::string namePMTVoid = GetName() + "/PMTVoid";
119  G4LogicalVolume* logPMTVoid
120  = new G4LogicalVolume(new G4Tubs(namePMTVoid,
121  0.0, GetSize()/2.0-glassThickness,
122  GetBaseLength()/2.0-glassThickness,
124  FindMaterial("Air"), // should be vacuum...
125  namePMTVoid);
126  logPMTVoid->SetVisAttributes(GetColor(logPMTVoid));
127 
128  // Place the vessel components.
129  new G4PVPlacement(NULL, // rotation.
130  G4ThreeVector(0,0,0),
131  logPMTVoid, // logical volume
132  logPMTVoid->GetName(), // name
133  logVolume, // mother volume
134  false, // (not used)
135  0, // Copy number (zero)
136  Check()); // Check overlaps.
137 
138  return logVolume;
139 }
G4String GetName(void)
Return the base name of the object that this builds.
std::string string
Definition: nybbler.cc:12
G4Material * FindMaterial(G4String m)
double GetBaseLength() const
G4VisAttributes GetColor(G4LogicalVolume *volume, double opacity=0.0)
static constexpr double mm
Definition: Units.h:65
static constexpr double degree
Definition: Units.h:161
double GetSize() const
double CaptPMTBuilder::GetSize ( ) const
inline

Definition at line 32 of file CaptPMTBuilder.hh.

32 {return fSize;}
double fSize
The size of the PMT.
void CaptPMTBuilder::Init ( void  )
private

Definition at line 75 of file CaptPMTBuilder.cc.

75  {
76  SetMessenger(new CaptPMTMessenger(this));
77  SetSize(25*CLHEP::mm);
79 }
void SetMessenger(G4UImessenger *m)
Set the messenger for this constructor.
void SetSize(double v)
static constexpr double mm
Definition: Units.h:65
void SetBaseLength(double v)
bool CaptPMTBuilder::IsRound ( ) const
inline

Definition at line 37 of file CaptPMTBuilder.hh.

37 {return fRoundPMT;}
bool fRoundPMT
Flag that the PMT is round (not square).
void CaptPMTBuilder::SetBaseLength ( double  v)
inline

Get or set the length of the base. The base length measures from the face of the photocathode to the back of the PMT.

Definition at line 25 of file CaptPMTBuilder.hh.

25 {fBaseLength = v;}
double fBaseLength
The length of the PMT base.
void CaptPMTBuilder::SetRound ( bool  v)
inline

Set that the PMT is round.

Definition at line 36 of file CaptPMTBuilder.hh.

36 {fRoundPMT = v;}
bool fRoundPMT
Flag that the PMT is round (not square).
void CaptPMTBuilder::SetSize ( double  v)
inline

Set the size of the PMT.

Definition at line 31 of file CaptPMTBuilder.hh.

31 {fSize = v;}
double fSize
The size of the PMT.

Member Data Documentation

double CaptPMTBuilder::fBaseLength
private

The length of the PMT base.

Definition at line 46 of file CaptPMTBuilder.hh.

bool CaptPMTBuilder::fRoundPMT
private

Flag that the PMT is round (not square).

Definition at line 49 of file CaptPMTBuilder.hh.

double CaptPMTBuilder::fSize
private

The size of the PMT.

Definition at line 43 of file CaptPMTBuilder.hh.


The documentation for this class was generated from the following files: