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

#include <ExN04DetectorConstruction.hh>

Inheritance diagram for ExN04DetectorConstruction:
Collaboration diagram for ExN04DetectorConstruction:

Public Member Functions

 ExN04DetectorConstruction ()
 
 ~ExN04DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
 ExN04DetectorConstruction ()
 
 ~ExN04DetectorConstruction ()
 
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 41 of file ExN04DetectorConstruction.hh.

Constructor & Destructor Documentation

ExN04DetectorConstruction::ExN04DetectorConstruction ( )
ExN04DetectorConstruction::~ExN04DetectorConstruction ( )

Definition at line 68 of file ExN04DetectorConstruction.cc.

69 {
70 }
ExN04DetectorConstruction::ExN04DetectorConstruction ( )
ExN04DetectorConstruction::~ExN04DetectorConstruction ( )

Member Function Documentation

G4VPhysicalVolume * ExN04DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 104 of file ExN04DetectorConstruction.cc.

105 {
106  //-------------------------------------------------------------------------
107  // Magnetic field
108  //-------------------------------------------------------------------------
109 
110  static G4bool fieldIsInitialized = false;
111  if ( !fieldIsInitialized ) {
112  ExN04Field* myField = new ExN04Field;
113  G4FieldManager* fieldMgr
115  GetFieldManager();
116  fieldMgr-> SetDetectorField(myField);
117  fieldMgr-> CreateChordFinder(myField);
118  fieldIsInitialized = true;
119  }
120 
121  //-------------------------------------------------------------------------
122  // Detector geometry
123  //-------------------------------------------------------------------------
124 
125  //------------------------------ experimental hall
126  G4Box* experimentalHall_box =
127  new G4Box("expHall_b", fexpHall_x, fexpHall_y, fexpHall_z);
128  G4LogicalVolume* experimentalHall_log =
129  new G4LogicalVolume(experimentalHall_box, fAir,"expHall_L", 0,0,0);
130  G4VPhysicalVolume * experimentalHall_phys =
131  new G4PVPlacement(0, G4ThreeVector(), experimentalHall_log,
132  "expHall_P", 0, false,0);
133  G4VisAttributes* experimentalHallVisAtt =
134  new G4VisAttributes(G4Colour(1.,1.,1.));
135  experimentalHallVisAtt-> SetForceWireframe(true);
136  experimentalHall_log-> SetVisAttributes(experimentalHallVisAtt);
137 
138  //------------------------------ tracker
139  G4VSolid* tracker_tubs
140  = new G4Tubs("trkTubs_tubs", ftrkTubs_rmin, ftrkTubs_rmax, ftrkTubs_dz,
142  G4LogicalVolume* tracker_log
143  = new G4LogicalVolume(tracker_tubs, fAr,"trackerT_L",0,0,0);
144  // G4VPhysicalVolume * tracker_phys =
145  new G4PVPlacement(0,G4ThreeVector(), tracker_log, "tracker_phys",
146  experimentalHall_log, false, 0);
147  G4VisAttributes* tracker_logVisAtt
148  = new G4VisAttributes(G4Colour(1.0,0.0,1.0));
149  tracker_logVisAtt->SetForceWireframe(true);
150  tracker_log->SetVisAttributes(tracker_logVisAtt);
151 
152  //------------------------------ tracker layers
153  // As an example for Parameterised volume
154  // dummy values for G4Tubs -- modified by parameterised volume
155  G4VSolid* trackerLayer_tubs
156  = new G4Tubs("trackerLayer_tubs", ftrkTubs_rmin, ftrkTubs_rmax, ftrkTubs_dz,
158  G4LogicalVolume* trackerLayer_log
159  = new G4LogicalVolume(trackerLayer_tubs, fSilicon,"trackerB_L",0,0,0);
160  G4VPVParameterisation* trackerParam
162  // dummy value : kXAxis -- modified by parameterised volume
163  // G4VPhysicalVolume *trackerLayer_phys =
164  new G4PVParameterised("trackerLayer_phys", trackerLayer_log, tracker_log,
165  kXAxis, fnotrkLayers, trackerParam);
166  G4VisAttributes* trackerLayer_logVisAtt
167  = new G4VisAttributes(G4Colour(0.5,0.0,1.0));
168  trackerLayer_logVisAtt->SetForceWireframe(true);
169  trackerLayer_log->SetVisAttributes(trackerLayer_logVisAtt);
170 
171  //------------------------------ calorimeter
172  G4VSolid* calorimeter_tubs
173  = new G4Tubs("calorimeter_tubs", fcaloTubs_rmin, fcaloTubs_rmax,
175  G4LogicalVolume* calorimeter_log
176  = new G4LogicalVolume(calorimeter_tubs, fScinti, "caloT_L",0,0,0);
177  // G4VPhysicalVolume * calorimeter_phys =
178  new G4PVPlacement(0,G4ThreeVector(), calorimeter_log, "caloM_P",
179  experimentalHall_log, false,0);
180  G4VisAttributes* calorimeter_logVisATT
181  = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
182  calorimeter_logVisATT->SetForceWireframe(true);
183  calorimeter_log->SetVisAttributes(calorimeter_logVisATT);
184 
185  //------------------------------- Lead layers
186  // As an example for Parameterised volume
187  // dummy values for G4Tubs -- modified by parameterised volume
188  G4VSolid* caloLayer_tubs
189  = new G4Tubs("caloLayer_tubs", fcaloRing_rmin, fcaloRing_rmax,
191  G4LogicalVolume* caloLayer_log
192  = new G4LogicalVolume(caloLayer_tubs, fLead, "caloR_L",0,0,0);
193  G4VPVParameterisation* calorimeterParam
195  // dummy value : kXAxis -- modified by parameterised volume
196  // G4VPhysicalVolume * caloLayer_phys =
197  new G4PVParameterised("caloLayer_phys",caloLayer_log,calorimeter_log,
198  kXAxis, fnocaloLayers, calorimeterParam);
199  G4VisAttributes* caloLayer_logVisAtt
200  = new G4VisAttributes(G4Colour(0.7,1.0,0.0));
201  caloLayer_logVisAtt->SetForceWireframe(true);
202  caloLayer_log->SetVisAttributes(caloLayer_logVisAtt);
203 
204  //------------------------------ muon counters
205  // As an example of CSG volumes with rotation
206  G4VSolid* muoncounter_box
207  = new G4Box("muoncounter_box", fmuBox_width, fmuBox_thick, fmuBox_length);
208  G4LogicalVolume* muoncounter_log
209  = new G4LogicalVolume(muoncounter_box, fScinti, "mucounter_L",0,0,0);
210  G4VPhysicalVolume* muoncounter_phys;
211  for( G4int i = 0; i < fnomucounter; i++ ) {
212  G4double phi, x, y, z;
213  phi = 360.*deg/fnomucounter*i;
214  x = fmuBox_radius*std::sin(phi);
215  y = fmuBox_radius*std::cos(phi);
216  z = 0.*cm;
217  G4RotationMatrix rm;
218  rm.rotateZ(phi);
219  muoncounter_phys
220  = new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(x,y,z)),
221  muoncounter_log, "muoncounter_P",
222  experimentalHall_log,false,i);
223  }
224  G4VisAttributes* muoncounter_logVisAtt
225  = new G4VisAttributes(G4Colour(0.0,1.0,1.0));
226  muoncounter_logVisAtt->SetForceWireframe(true);
227  muoncounter_log->SetVisAttributes(muoncounter_logVisAtt);
228 
229  //------------------------------------------------------------------
230  // Sensitive Detector
231  //------------------------------------------------------------------
232 
234 
235  G4String trackerSDname = "/mydet/tracker";
236  ExN04TrackerSD * trackerSD = new ExN04TrackerSD(trackerSDname);
237  SDman->AddNewDetector(trackerSD);
238  trackerLayer_log->SetSensitiveDetector(trackerSD);
239 
240  G4String calorimeterSDname = "/mydet/calorimeter";
241  ExN04CalorimeterSD* calorimeterSD = new ExN04CalorimeterSD(calorimeterSDname);
242  G4String ROgeometryName = "CalorimeterROGeom";
243  G4VReadOutGeometry* calRO = new ExN04CalorimeterROGeometry(ROgeometryName);
244  calRO->BuildROGeometry();
245  calorimeterSD->SetROgeometry(calRO);
246  SDman->AddNewDetector(calorimeterSD);
247  calorimeter_log->SetSensitiveDetector(calorimeterSD);
248 
249  G4String muonSDname = "/mydet/muon";
250  ExN04MuonSD* muonSD = new ExN04MuonSD(muonSDname);
251  SDman->AddNewDetector(muonSD);
252  muoncounter_log->SetSensitiveDetector(muonSD);
253 
254  //------------------------------------------------------------------
255  // Digitizer modules
256  //------------------------------------------------------------------
257 
258  return experimentalHall_phys;
259 }
G4double fcaloRing_dz
G4double ftrkTubs_dz
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:64
G4int fnomucounter
G4double fmuBox_length
Definition: G4Tubs.hh:85
G4double fcaloTubs_sphi
G4double fmuBox_width
G4double fcaloTubs_dphi
tuple x
Definition: test.py:50
G4double fcaloTubs_dz
G4double fcaloRing_rmax
G4double fcaloTubs_rmin
G4double fexpHall_y
int G4int
Definition: G4Types.hh:78
G4double fcaloRing_dphi
G4double fexpHall_z
G4double fcaloRing_rmin
bool G4bool
Definition: G4Types.hh:79
static constexpr double cm
Definition: G4SIunits.hh:119
G4double fmuBox_thick
G4int fnocaloLayers
void SetROgeometry(G4VReadOutGeometry *value)
HepGeom::Transform3D G4Transform3D
G4double fmuBox_radius
static G4TransportationManager * GetTransportationManager()
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
G4double fcaloTubs_rmax
G4double ftrkTubs_rmax
G4double ftrkTubs_rmin
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4double ftrkTubs_dphi
G4int fnotrkLayers
tuple z
Definition: test.py:28
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
G4double fexpHall_x
G4double fcaloRing_sphi
double G4double
Definition: G4Types.hh:76
static constexpr double deg
Definition: G4SIunits.hh:152
G4double ftrkTubs_sphi
void SetForceWireframe(G4bool=true)
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)

Here is the call graph for this function:

G4VPhysicalVolume* ExN04DetectorConstruction::Construct ( )
virtual

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