1 #ifndef EDepSim_Builder_hh_Seen 2 #define EDepSim_Builder_hh_Seen 4 namespace EDepSim {
class Builder;}
5 namespace EDepSim {
class UserDetectorConstruction;}
10 #include <G4LogicalVolume.hh> 11 #include <G4Material.hh> 12 #include <G4UImessenger.hh> 13 #include <G4UIdirectory.hh> 14 #include <G4UIcmdWithoutParameter.hh> 15 #include <G4UIcmdWithABool.hh> 16 #include <G4UIcmdWithAnInteger.hh> 17 #include <G4UIcmdWithADouble.hh> 18 #include <G4UIcmdWithAString.hh> 19 #include <G4UIcmdWith3Vector.hh> 20 #include <G4UIcmdWithADoubleAndUnit.hh> 21 #include <G4UIcmdWith3VectorAndUnit.hh> 22 #include <G4RotationMatrix.hh> 23 #include <G4VisAttributes.hh> 45 namespace EDepSim {
class Builder;}
56 virtual G4LogicalVolume *
GetPiece(
void) = 0;
116 std::cout <<
"Multiply defined constructor name " 119 EDepSimThrow(
"EDepSim::Builder::AddBuilder(): Multiple defines");
126 template <
class T>
T&
Get(G4String n) {
131 std::cout <<
" Undefined constructor requested " 133 std::cout <<
" The choices are: " <<
std::endl;
137 std::cout <<
" \"" << (*p).first <<
"\"" 138 <<
" for constructor: " << (*p).second->GetName()
143 T* c =
dynamic_cast<T*
>((*p).second);
146 std::cout <<
" Cannot type cast " << n
156 template <
class T>
T*
Find(G4String n) {
160 T* c =
dynamic_cast<T*
>((*p).second);
182 G4VisAttributes
GetColor(G4LogicalVolume*
volume,
double opacity = 0.0);
191 G4VisAttributes
GetColor(G4Material* volume,
double opacity = 0.0);
250 G4String
name = GetDirectory() +
cmd;
254 void SetNewValue(G4UIcommand *
cmd, G4String
val);
EDepSim::UserDetectorConstruction * GetConstruction(void)
Return the detector construction that is building this piece.
G4String GetName(void)
Return the base name of the object that this builds.
G4String fLocalName
The short local name of the constructor.
EDepSim::Builder * fBuilder
G4UImessenger * fMessenger
The user interface messenger that will provide values for this class.
virtual void SetMaximumHitLength(double length)
Set the maximum length of a single hit segment.
void SetMessenger(G4UImessenger *m)
Set the messenger for this constructor.
bool fCheck
If this is true, then check the constructed object for overlaps.
G4String GetLocalName(void)
Return the base name of the object that this builds.
virtual G4VSensitiveDetector * GetSensitiveDetector(void)
Get the sensitive detector for this component.
EDepSim::UserDetectorConstruction * fConstruction
The G4VUserDetectorConstruction class that this is cooperating with.
static const std::string volume[nvol]
G4String fName
The name of the constructor.
void SetCheck(bool v)
Set the check value.
G4Material * FindMaterial(G4String m)
void SetLocalName(const G4String &name)
Set the base name of the logical volume that this builds.
#define EDepSimThrow(message)
Print an error message, and then throw an exception.
double fOpacity
The relative opacity of the constructed object.
virtual G4LogicalVolume * GetPiece(void)=0
G4UIcmdWithADoubleAndUnit * fMaximumHitSagittaCMD
virtual void SetMaximumHitSagitta(double sagitta)
G4UIcmdWithADoubleAndUnit * fMaximumHitLengthCMD
void AddBuilder(EDepSim::Builder *c)
Construct a module from components.
G4UIcmdWithADouble * fDaughterOpacityCMD
Builder(G4String n, EDepSim::UserDetectorConstruction *c)
double GetOpacity(void) const
Get the relative opacity of the constructed object.
void SetOpacity(double v)
Set the relative opacity of the constructed object.
EDepSim::Builder * fParent
The parent of this constructor.
G4VSensitiveDetector * fSensitiveDetector
The sensitive detector for this tracking component.
G4String GetDirectory(void)
Return the name of the directory.
G4UIcmdWithABool * fCheckCMD
G4UIdirectory * fDirectory
The UI directory for this messenger.
G4String fDirName
The directory name for this messenger.
virtual void SetSensitiveDetector(G4VSensitiveDetector *s)
Set the sensitive detector for this component.
std::map< G4String, EDepSim::Builder * > fSubBuilders
The sub constructors that might be used in this class.
G4VisAttributes GetColor(G4LogicalVolume *volume, double opacity=0.0)
G4UIcommand * fSensitiveCMD
G4String CommandName(G4String cmd)
Build a command name with the directory prefix.
def parent(G, child, parent_type)
void SetDaughterOpacity(double v)
Set the relative opacity of the object daughters.
G4UImessenger * GetMessenger(void)
Return the messenger for this constructor.
QTextStream & endl(QTextStream &s)
G4UIcmdWithADouble * fOpacityCMD