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

#include <ExUCNDetectorConstruction.hh>

Inheritance diagram for ExUCNDetectorConstruction:
Collaboration diagram for ExUCNDetectorConstruction:

Public Member Functions

 ExUCNDetectorConstruction ()
 
virtual ~ExUCNDetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
virtual void ConstructSDandField ()
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
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 47 of file ExUCNDetectorConstruction.hh.

Constructor & Destructor Documentation

ExUCNDetectorConstruction::ExUCNDetectorConstruction ( )

Definition at line 74 of file ExUCNDetectorConstruction.cc.

75  : fVacuum(0), fGuideMaterial(0)
76 {
77  // materials
78  DefineMaterials();
79 }
ExUCNDetectorConstruction::~ExUCNDetectorConstruction ( )
virtual

Definition at line 83 of file ExUCNDetectorConstruction.cc.

84 {
85  if (fField) delete fField;
86 }

Member Function Documentation

G4VPhysicalVolume * ExUCNDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 126 of file ExUCNDetectorConstruction.cc.

127 {
128  //
129  // World
130  //
131 
132  G4double worldSizeX = 1.*m;
133  G4double worldSizeY = 1.*m;
134  G4double worldSizeZ = 100.*m;
135 
136  G4Box* solidWorld = new G4Box("World",
137  worldSizeX/2.,worldSizeY/2.,worldSizeZ/2.);
138 
139  G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld,
140  fVacuum,
141  "World");
142 
143  G4VPhysicalVolume* physiWorld = new G4PVPlacement(0,
144  G4ThreeVector(),
145  "World",
146  logicWorld,
147  0,
148  false,
149  0);
150 
151 // --------------------------------- Guide -------------------------------------
152 
153  G4double GuideR = 35.*mm;
154  G4double GuideW = 2.*mm;
155  G4double GuideL = 6.*m;
156 
157  G4Tubs* solidGuide = new G4Tubs("SolidGuide",
158  GuideR,GuideR+GuideW,GuideL/2.,0.,twopi);
159 
160  G4LogicalVolume* logicGuide = new G4LogicalVolume(solidGuide,
161  fGuideMaterial,
162  "Guide");
163 
164  new G4PVPlacement(0,G4ThreeVector(),"Guide",logicGuide,physiWorld,false,0);
165 
166 // ------------------------------ End Plate -----------------------------------
167 
168  G4Tubs* solidEndPlate = new G4Tubs("EndPlate",0.,GuideR,GuideW/2.,0.,twopi);
169 
170  G4LogicalVolume* logicEndPlate = new G4LogicalVolume(solidEndPlate,
171  fVacuum,
172  "EndPlate");
173 
174  G4ThreeVector endPlatePos = G4ThreeVector(0.,0.,GuideL/2.+GuideW/2.);
175 
176  new G4PVPlacement(0,endPlatePos,"EndPlate",logicEndPlate,physiWorld,false,0);
177 
178  G4double maxStep = 1.0*mm;
179  G4double maxTime = 100.*s;
180 
181  G4UserLimits* stepLimit = new G4UserLimits(maxStep,DBL_MAX,maxTime);
182 
183  logicWorld->SetUserLimits(stepLimit);
184 
185  //
186  // Visualization attributes
187  //
188 
189  G4VisAttributes* guideColor = new G4VisAttributes(G4Colour(0.0,0.0,1.0));
190  guideColor->SetVisibility(true);
191  guideColor->SetForceWireframe(true);
192 
193  G4VisAttributes* endPlateColor = new G4VisAttributes(G4Colour(1.0,0.0,0.0));
194  endPlateColor->SetVisibility(true);
195  endPlateColor->SetForceSolid(true);
196 
198  logicGuide->SetVisAttributes(guideColor);
199  logicEndPlate->SetVisAttributes(endPlateColor);
200 
201  //
202  //always return the physical World
203  //
204  return physiWorld;
205 }
static constexpr double mm
Definition: G4SIunits.hh:115
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:64
void SetUserLimits(G4UserLimits *pULimits)
Definition: G4Tubs.hh:85
void SetForceSolid(G4bool=true)
static constexpr double twopi
Definition: G4SIunits.hh:76
const XML_Char * s
Definition: expat.h:262
static constexpr double m
Definition: G4SIunits.hh:129
void SetVisibility(G4bool=true)
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
static const G4VisAttributes & GetInvisible()
void SetForceWireframe(G4bool=true)
void SetVisAttributes(const G4VisAttributes *pVA)

Here is the call graph for this function:

void ExUCNDetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 211 of file ExUCNDetectorConstruction.cc.

212 {
213  if (!fField) {
214 
215  fField = new G4UniformGravityField();
216 
217  G4RepleteEofM* equation = new G4RepleteEofM(fField);
218 // G4RepleteEofM* equation = new G4RepleteEofM(fField,12);
219 // G4EqGravityField* equation = new G4EqGravityField(fField);
220 
221  G4FieldManager* fieldManager
223  fieldManager->SetDetectorField(fField);
224 
225  G4MagIntegratorStepper* stepper = new G4ClassicalRK4(equation,8);
226 // G4MagIntegratorStepper* stepper = new G4ClassicalRK4(equation,12);
227 
228  G4double minStep = 0.01*mm;
229 
230  G4ChordFinder* chordFinder =
231  new G4ChordFinder((G4MagneticField*)fField,minStep,stepper);
232 
233  // Set accuracy parameters
234  G4double deltaChord = 3.0*mm;
235  chordFinder->SetDeltaChord( deltaChord );
236 
237  G4double deltaOneStep = 0.01*mm;
238  fieldManager->SetAccuraciesWithDeltaOneStep(deltaOneStep);
239 
240  G4double deltaIntersection = 0.1*mm;
241  fieldManager->SetDeltaIntersection(deltaIntersection);
242 
243  G4TransportationManager* transportManager =
245 
246  G4PropagatorInField* fieldPropagator =
247  transportManager->GetPropagatorInField();
248 
249  G4double epsMin = 2.5e-7*mm;
250  G4double epsMax = 0.05*mm;
251 
252  fieldPropagator->SetMinimumEpsilonStep(epsMin);
253  fieldPropagator->SetMaximumEpsilonStep(epsMax);
254 
255  fieldManager->SetChordFinder(chordFinder);
256  }
257 }
static constexpr double mm
Definition: G4SIunits.hh:115
G4bool SetDetectorField(G4Field *detectorField)
void SetChordFinder(G4ChordFinder *aChordFinder)
void SetAccuraciesWithDeltaOneStep(G4double valDeltaOneStep)
static G4TransportationManager * GetTransportationManager()
G4FieldManager * GetFieldManager() const
void SetDeltaIntersection(G4double valueDintersection)
void SetMinimumEpsilonStep(G4double newEpsMin)
double G4double
Definition: G4Types.hh:76
void SetMaximumEpsilonStep(G4double newEpsMax)
G4PropagatorInField * GetPropagatorInField() const
void SetDeltaChord(G4double newval)

Here is the call graph for this function:


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