Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
H02DetectorConstruction Class Reference

#include <H02DetectorConstruction.hh>

Inheritance diagram for H02DetectorConstruction:
Collaboration diagram for H02DetectorConstruction:

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.

85 {
86  // ==============================================================
87  // Materials
88  // ==============================================================
89 
90  G4double a, iz, z, density;
91  G4String name, symbol;
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,
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;
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 }
const XML_Char * name
Definition: expat.h:151
static const G4double DZ_ENDCAP_CAL
CLHEP::Hep3Vector G4ThreeVector
static const G4double RIN_BARREL_CAL
CLHEP::HepRotation G4RotationMatrix
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
Definition: G4Box.hh:64
Definition: G4Tubs.hh:85
static const G4double ROUT_ENDCAP_CAL
int G4int
Definition: G4Types.hh:78
static const G4double RIN_ENDCAP_CAL
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
static const G4double R_EXPHALL
static const G4double DX_BARREL_MUON
static constexpr double m
Definition: G4SIunits.hh:129
#define FALSE
Definition: globals.hh:52
static G4double dangle[DIM]
static const G4double DZ_BARREL_CAL
static const G4double RIN_ENDCAP_MUON
static constexpr double cm3
Definition: G4SIunits.hh:121
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
static G4TransportationManager * GetTransportationManager()
static const G4double DZ_EXPHALL
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
tuple z
Definition: test.py:28
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
double G4double
Definition: G4Types.hh:76
static constexpr double deg
Definition: G4SIunits.hh:152
static const G4double DY_BARREL_MUON
static const G4double ROUT_BARREL_CAL
static const G4double DZ_BARREL_MUON
static const G4double RIN_BARREL_MUON
static constexpr double mole
Definition: G4SIunits.hh:286
static const G4double DZ_ENDCAP_MUON
static const G4double ROUT_ENDCAP_MUON

Here is the call graph for this function:


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