Geant4.10
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
H02DetectorConstruction Class Reference

#include <H02DetectorConstruction.hh>

Inheritance diagram for H02DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 H02DetectorConstruction ()
 
 ~H02DetectorConstruction ()
 
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
 

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

Definition at line 38 of file H02DetectorConstruction.hh.

Constructor & Destructor Documentation

H02DetectorConstruction::H02DetectorConstruction ( )

Definition at line 74 of file H02DetectorConstruction.cc.

75 {
76 }
H02DetectorConstruction::~H02DetectorConstruction ( )

Definition at line 79 of file H02DetectorConstruction.cc.

80 {
81 }

Member Function Documentation

G4VPhysicalVolume * H02DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 84 of file H02DetectorConstruction.cc.

References test::a, AddElement(), Air, python.hepunit::cm3, python.hepunit::deg, density, elC, elH, elN, elO, FALSE, g(), G4SDManager::GetSDMpointer(), G4TransportationManager::GetTransportationManager(), iz, python.hepunit::m, python.hepunit::mole, nel, CLHEP::Hep3Vector::rotateZ(), CLHEP::HepRotation::rotateZ(), G4VUserDetectorConstruction::SetSensitiveDetector(), symbol, and z.

85 {
86  // ==============================================================
87  // Materials
88  // ==============================================================
89 
90  G4double a, iz, z, density;
92  G4int nel;
93 
94  a= 1.01*g/mole;
95  G4Element* elH= new G4Element(name="Hydrogen", symbol="H", iz=1., a);
96 
97  a= 12.01*g/mole;
98  G4Element* elC= new G4Element(name="Carbon", symbol="C", iz=6., a);
99 
100  a= 14.01*g/mole;
101  G4Element* elN= new G4Element(name="Nitrogen", symbol="N", iz=7., a);
102 
103  a = 16.00*g/mole;
104  G4Element* elO= new G4Element(name="Oxygen", symbol="O", iz=8., a);
105 
106  density= 1.29e-03*g/cm3;
107  G4Material* Air= new G4Material(name="Air", density, nel=2);
108  Air-> AddElement(elN, .7);
109  Air-> AddElement(elO, .3);
110 
111  a= 207.19*g/mole;
112  density= 11.35*g/cm3;
113  G4Material* Lead= new G4Material(name="Lead", z=82., a, density);
114 
115  a= 39.95*g/mole;
116  density= 1.782e-03*g/cm3;
117  G4Material* Ar= new G4Material(name="ArgonGas", z=18., a, density);
118 
119  density= 1.032*g/cm3;
120  G4Material* Scinti= new G4Material(name="Scintillator", density, nel=2);
121  Scinti-> AddElement(elC, 9);
122  Scinti-> AddElement(elH, 10);
123 
124 
125  // ==============================================================
126  // Experimental Hall (world)
127  // ==============================================================
128  G4Tubs* expHallSolid=
129  new G4Tubs("EXP_HALL", 0., R_EXPHALL, DZ_EXPHALL, 0., 360.*deg);
130 
131  G4LogicalVolume* expHallLV=
132  new G4LogicalVolume(expHallSolid, Air, "EXP_HALL_LV");
133 
134  // visualization attributes
135  G4VisAttributes* expHallVisAtt=
136  new G4VisAttributes(false, G4Colour(1., 1., 1.));
137  //expHallVisAtt-> SetForceWireframe(TRUE);
138  expHallLV-> SetVisAttributes(expHallVisAtt);
139 
140  G4PVPlacement* expHall= new G4PVPlacement(0, G4ThreeVector(), "EXP_HALL_PV",
141  expHallLV, 0, FALSE, 0);
142  // ... MV, MANY, copy#
143 
144  // ==============================================================
145  // each detector component
146  // ==============================================================
147  // calorimeter system
148  G4Tubs* barrelCalSolid=
149  new G4Tubs("BARREL_CAL", RIN_BARREL_CAL, ROUT_BARREL_CAL,
150  DZ_BARREL_CAL, 0., 360.*deg);
151 
152  G4Tubs* endcapCalSolid=
153  new G4Tubs("ENDCAP_CAL", RIN_ENDCAP_CAL, ROUT_ENDCAP_CAL,
154  DZ_ENDCAP_CAL, 0., 360.*deg);
155 
156  G4LogicalVolume* barrelCalLV=
157  new G4LogicalVolume(barrelCalSolid, Lead, "BARREL_CAL_LV");
158 
159  G4LogicalVolume* endcapCalLV=
160  new G4LogicalVolume(endcapCalSolid, Lead, "ENDCAP_CAL_LV");
161 
162  G4VisAttributes* calVisAtt=
163  new G4VisAttributes(true, G4Colour(0., 1., 1.));
164  barrelCalLV-> SetVisAttributes(calVisAtt);
165  endcapCalLV-> SetVisAttributes(calVisAtt);
166 
167  // G4PVPlacement* barrelCal=
168  new G4PVPlacement(0, G4ThreeVector(), "BARREL_CAL_PV",
169  barrelCalLV, expHall, FALSE, 0);
170 
171  G4ThreeVector posCal(0.,0.,6.*m);
172  // G4PVPlacement* endcapCal1=
173  new G4PVPlacement(0, posCal, "ENDCAP_CAL_PV",
174  endcapCalLV, expHall, FALSE, 0);
175 
176  //G4PVPlacement* endcapCal2=
177  new G4PVPlacement(0, -posCal, "ENDCAP_CAL_PV",
178  endcapCalLV, expHall, FALSE, 1);
179 
180  // muon system
181  G4Box* barrelMuonSolid= new G4Box("BARREL_MUON", DX_BARREL_MUON,
182  DY_BARREL_MUON, DZ_BARREL_MUON);
183  G4Tubs* endcapMuonSolid=
184  new G4Tubs("ENDCAP_MUON", RIN_ENDCAP_MUON, ROUT_ENDCAP_MUON,
185  DZ_ENDCAP_MUON, 0., 360.*deg);
186 
187  G4LogicalVolume* barrelMuonLV=
188  new G4LogicalVolume(barrelMuonSolid, Ar, "BARREL_MUON_LV");
189 
190  G4LogicalVolume* endcapMuonLV=
191  new G4LogicalVolume(endcapMuonSolid, Ar, "ENDCAP_MUON_LV");
192 
193  G4VisAttributes* muonVisAtt=
194  new G4VisAttributes(true, G4Colour(1., 1., 0.5));
195  //muonVisAtt-> SetForceWireframe(TRUE);
196  barrelMuonLV-> SetVisAttributes(muonVisAtt);
197  endcapMuonLV-> SetVisAttributes(muonVisAtt);
198 
199  const G4double dangle= 45.*deg;
200  G4ThreeVector posM(RIN_BARREL_MUON+DY_BARREL_MUON/2., 0., 0.);
202  rotM->rotateZ(90.*deg);
203 
204  for (G4int k=0; k<8; k++) {
205  G4Transform3D transformM(*rotM, posM);
206  new G4PVPlacement(transformM, "BARREL_MUON_PV",
207  barrelMuonLV, expHall, FALSE, k);
208  rotM->rotateZ(dangle);
209  posM.rotateZ(dangle);
210  }
211 
212  G4ThreeVector posMuon(0.,0.,8.*m);
213  // G4PVPlacement* endcapMuon1=
214  new G4PVPlacement(0, posMuon, "ENDCAP_MUON_PV",
215  endcapMuonLV, expHall, FALSE, 0);
216 
217  // G4PVPlacement* endcapMuon2=
218  new G4PVPlacement(0, -posMuon, "ENDCAP_MUON_PV",
219  endcapMuonLV, expHall, FALSE, 1);
220 
221 
222  // sensitive Detectors
224 
225  G4String muonSDname= "/mydet/muon";
226  H02MuonSD* muonSD= new H02MuonSD(muonSDname);
227  SDman-> AddNewDetector(muonSD);
228  barrelMuonLV-> SetSensitiveDetector(muonSD);
229  endcapMuonLV-> SetSensitiveDetector(muonSD);
230 
231  // magnetic field
232  H02Field* myfield = new H02Field;
233  G4FieldManager* fieldMgr=
235  fieldMgr-> SetDetectorField(myfield);
236  fieldMgr-> CreateChordFinder(myfield);
237 
238  return expHall;
239 }
G4String symbol
Definition: TRTMaterials.hh:40
G4Material * Air
Definition: TRTMaterials.hh:57
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
G4double z
Definition: TRTMaterials.hh:39
Definition: G4Box.hh:63
Definition: G4Tubs.hh:84
G4Element * elC
Definition: TRTMaterials.hh:48
const XML_Char * name
int G4int
Definition: G4Types.hh:78
G4Element * elN
Definition: TRTMaterials.hh:44
G4Element * elH
Definition: TRTMaterials.hh:50
G4double density
Definition: TRTMaterials.hh:39
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
G4Element * elO
Definition: TRTMaterials.hh:46
G4double iz
Definition: TRTMaterials.hh:39
#define FALSE
Definition: globals.hh:52
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
static G4TransportationManager * GetTransportationManager()
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
double G4double
Definition: G4Types.hh:76
Air AddElement(elN,.7)
G4int nel
Definition: TRTMaterials.hh:41

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