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

#include <ExN04DetectorConstruction.hh>

Inheritance diagram for ExN04DetectorConstruction:
G4VUserDetectorConstruction G4VUserDetectorConstruction

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 eventgenerator/HepMC/HepMCEx01/include/ExN04DetectorConstruction.hh.

Constructor & Destructor Documentation

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

Member Function Documentation

G4VPhysicalVolume * ExN04DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 104 of file eventgenerator/HepMC/HepMCEx01/src/ExN04DetectorConstruction.cc.

References G4SDManager::AddNewDetector(), G4VReadOutGeometry::BuildROGeometry(), python.hepunit::cm, python.hepunit::deg, G4SDManager::GetSDMpointer(), G4TransportationManager::GetTransportationManager(), kXAxis, CLHEP::HepRotation::rotateZ(), G4VisAttributes::SetForceWireframe(), G4VSensitiveDetector::SetROgeometry(), G4LogicalVolume::SetSensitiveDetector(), G4LogicalVolume::SetVisAttributes(), test::x, and z.

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 }
void SetForceWireframe(G4bool)
CLHEP::Hep3Vector G4ThreeVector
G4double z
Definition: TRTMaterials.hh:39
Definition: G4Box.hh:63
Definition: G4Tubs.hh:84
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
void SetROgeometry(G4VReadOutGeometry *value)
HepGeom::Transform3D G4Transform3D
static G4TransportationManager * GetTransportationManager()
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:67
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
double G4double
Definition: G4Types.hh:76
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
G4VPhysicalVolume* ExN04DetectorConstruction::Construct ( )
virtual

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