Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
G3toG4DetectorConstruction Class Reference

Detector construction class. More...

#include <Doxymodules_g3tog4.h>

Inheritance diagram for G3toG4DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 G3toG4DetectorConstruction (G4String inFile="svt.dat")
 
virtual ~G3toG4DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 

Private Member Functions

G4LogicalVolumeSimpleConstruct ()
 

Private Attributes

G4String fInFile
 

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 18 of file Doxymodules_g3tog4.h.

Constructor & Destructor Documentation

◆ G3toG4DetectorConstruction()

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

Definition at line 49 of file G3toG4DetectorConstruction.cc.

51 fInFile(inFile)
52{
53 G4cout << "Instantiated G3toG4DetectorConstruction using call list file \""
54 << fInFile << "\"" << G4endl;
55}

◆ ~G3toG4DetectorConstruction()

G3toG4DetectorConstruction::~G3toG4DetectorConstruction ( )
virtual

Definition at line 59 of file G3toG4DetectorConstruction.cc.

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

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * G3toG4DetectorConstruction::Construct ( )
virtual

Definition at line 66 of file G3toG4DetectorConstruction.cc.

67{
68 G4LogicalVolume* lv = G4BuildGeom(fInFile);
69 //G4LogicalVolume* lv = SimpleConstruct();
70 if ( lv ) {
72 = new G4PVPlacement(0, G4ThreeVector(), lv, lv->GetName(), 0, false, 0);
73 G4cout << "Top-level G3toG4 logical volume " << lv->GetName() << " "
74 << *(lv -> GetVisAttributes()) << G4endl;
75 return pv;
76 }
77
78 G4cerr << "creation of logical mother failed !!!" << G4endl;
79 return 0;
80}

◆ SimpleConstruct()

G4LogicalVolume * G3toG4DetectorConstruction::SimpleConstruct ( )
private

Definition at line 84 of file G3toG4DetectorConstruction.cc.

85{
86 G4String name, symbol; //a=mass of a mole;
87 G4double a, z, density, fractionmass; //z=mean number of protons;
88 G4int ncomponents; //iz=number of protons in an isotope;
89 // n=number of nucleons in an isotope;
90
91 a = 14.01*g/mole;
92 G4Element* eN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
93
94 a = 16.00*g/mole;
95 G4Element* eO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
96
97 //
98 // define a material from elements. case 2: mixture by fractional mass
99 //
100
101 density = 1.290*mg/cm3;
102 G4Material* air = new G4Material(name="Air" , density, ncomponents=2);
103 air->AddElement(eN, fractionmass=0.7);
104 air->AddElement(eO, fractionmass=0.3);
105 G4VSolid* mother = new G4Box("TestMother", //its name
106 100*cm, 100*cm, 100*cm); //its size
107
108 G4VSolid* daughter = new G4Box("TestDaughter", 50*cm, 20*cm, 10*cm);
109
110 G4LogicalVolume* logicMother = new G4LogicalVolume(mother, //its solid
111 air, //its material
112 "LTestMother");//its name
113
114 G4LogicalVolume* logicDaughter = new G4LogicalVolume(daughter, //its solid
115 air, //its material
116 "LTestDaughter");
117
118 new G4PVPlacement(0,
119 G4ThreeVector(),
120 logicDaughter,
121 "PTestDaughter",
122 logicMother,
123 false,0);
124 //
125 // Visualization attributes
126 //
127
128 logicMother->SetVisAttributes (G4VisAttributes::GetInvisible());
129 G4VisAttributes* daughterVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
130 daughterVisAtt->SetVisibility(true);
131 logicDaughter->SetVisAttributes(daughterVisAtt);
132 return logicMother;
133}
std::vector< ExP01TrackerHit * > a

Member Data Documentation

◆ fInFile

G4String G3toG4DetectorConstruction::fInFile
private

Definition at line 56 of file G3toG4DetectorConstruction.hh.


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

Applications | User Support | Publications | Collaboration