Geant4  10.02.p03
G3toG4DetectorConstruction Class Reference

#include <G3toG4DetectorConstruction.hh>

Inheritance diagram for G3toG4DetectorConstruction:
Collaboration diagram for G3toG4DetectorConstruction:

Public Member Functions

 G3toG4DetectorConstruction (G4String inFile="svt.dat")
 
virtual ~G3toG4DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void ConstructSDandField ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Private Member Functions

G4LogicalVolumeSimpleConstruct ()
 

Private Attributes

G4String fInFile
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Detector construction class.

Most the work is done in G4BuildGeom(), which returns a pointer to the top-level logical volume in the detector defined by the call list file inFile.

Definition at line 47 of file G3toG4DetectorConstruction.hh.

Constructor & Destructor Documentation

◆ G3toG4DetectorConstruction()

G3toG4DetectorConstruction::G3toG4DetectorConstruction ( G4String  inFile = "svt.dat")

Definition at line 50 of file G3toG4DetectorConstruction.cc.

52  fInFile(inFile)
53 {
54  G4cout << "Instantiated G3toG4DetectorConstruction using call list file \""
55  << fInFile << "\"" << G4endl;
56 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

◆ ~G3toG4DetectorConstruction()

G3toG4DetectorConstruction::~G3toG4DetectorConstruction ( )
virtual

Definition at line 60 of file G3toG4DetectorConstruction.cc.

61 {
62  // G4cout << "Deleted G3toG4DetectorConstruction..." << G4endl;
63 }

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * G3toG4DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 67 of file G3toG4DetectorConstruction.cc.

68 {
70  //G4LogicalVolume* lv = SimpleConstruct();
71  if ( lv ) {
73  = new G4PVPlacement(0, G4ThreeVector(), lv, lv->GetName(), 0, false, 0);
74  G4cout << "Top-level G3toG4 logical volume " << lv->GetName() << " "
75  << *(lv -> GetVisAttributes()) << G4endl;
76  return pv;
77  }
78 
79  G4cerr << "creation of logical mother failed !!!" << G4endl;
80  return 0;
81 }
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
G4LogicalVolume * G4BuildGeom(G4String &inFile)
Definition: G4BuildGeom.cc:55
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:

◆ SimpleConstruct()

G4LogicalVolume * G3toG4DetectorConstruction::SimpleConstruct ( )
private

Definition at line 85 of file G3toG4DetectorConstruction.cc.

86 {
87  G4String name, symbol; //a=mass of a mole;
88  G4double a, z, density, fractionmass; //z=mean number of protons;
89  G4int ncomponents; //iz=number of protons in an isotope;
90  // n=number of nucleons in an isotope;
91 
92  a = 14.01*g/mole;
93  G4Element* eN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
94 
95  a = 16.00*g/mole;
96  G4Element* eO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
97 
98  //
99  // define a material from elements. case 2: mixture by fractional mass
100  //
101 
102  density = 1.290*mg/cm3;
103  G4Material* air = new G4Material(name="Air" , density, ncomponents=2);
104  air->AddElement(eN, fractionmass=0.7);
105  air->AddElement(eO, fractionmass=0.3);
106  G4VSolid* mother = new G4Box("TestMother", //its name
107  100*cm, 100*cm, 100*cm); //its size
108 
109  G4VSolid* daughter = new G4Box("TestDaughter", 50*cm, 20*cm, 10*cm);
110 
111  G4LogicalVolume* logicMother = new G4LogicalVolume(mother, //its solid
112  air, //its material
113  "LTestMother");//its name
114 
115  G4LogicalVolume* logicDaughter = new G4LogicalVolume(daughter, //its solid
116  air, //its material
117  "LTestDaughter");
118 
119  new G4PVPlacement(0,
120  G4ThreeVector(),
121  logicDaughter,
122  "PTestDaughter",
123  logicMother,
124  false,0);
125  //
126  // Visualization attributes
127  //
128 
130  G4VisAttributes* daughterVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
131  daughterVisAtt->SetVisibility(true);
132  logicDaughter->SetVisAttributes(daughterVisAtt);
133  return logicMother;
134 }
static const double cm
Definition: G4SIunits.hh:118
G4String symbol
Definition: TRTMaterials.hh:40
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:64
G4String name
Definition: TRTMaterials.hh:40
void SetVisibility(G4bool)
static const double mg
Definition: G4SIunits.hh:181
int G4int
Definition: G4Types.hh:78
G4double density
Definition: TRTMaterials.hh:39
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
static const double cm3
Definition: G4SIunits.hh:120
static const G4VisAttributes Invisible
static const double mole
Definition: G4SIunits.hh:283
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:364
double G4double
Definition: G4Types.hh:76
void SetVisAttributes(const G4VisAttributes *pVA)
Here is the call graph for this function:

Member Data Documentation

◆ fInFile

G4String G3toG4DetectorConstruction::fInFile
private

Definition at line 57 of file G3toG4DetectorConstruction.hh.


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