Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
ExUCNDetectorConstruction.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: ExUCNDetectorConstruction.cc 75572 2013-11-04 11:46:08Z gcosmo $
27 //
30 //
31 
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 
36 
37 #include "G4Material.hh"
38 #include "G4NistManager.hh"
40 
41 #include "G4Box.hh"
42 #include "G4Tubs.hh"
43 #include "G4VPhysicalVolume.hh"
44 #include "G4LogicalVolume.hh"
45 #include "G4PVPlacement.hh"
46 
47 #include "G4GeometryManager.hh"
48 #include "G4PhysicalVolumeStore.hh"
49 #include "G4LogicalVolumeStore.hh"
50 #include "G4SolidStore.hh"
51 
52 #include "G4VisAttributes.hh"
53 #include "G4Colour.hh"
54 
55 #include "G4UserLimits.hh"
56 #include "G4SystemOfUnits.hh"
57 #include "G4PhysicalConstants.hh"
58 
59 #include "G4UniformGravityField.hh"
60 
61 #include "G4FieldManager.hh"
63 
64 #include "G4RepleteEofM.hh"
65 //#include "G4EqGravityField.hh"
66 
67 #include "G4ClassicalRK4.hh"
69 #include "G4ChordFinder.hh"
70 #include "G4PropagatorInField.hh"
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
75  : fVacuum(0), fGuideMaterial(0)
76 {
77  // materials
79 }
80 
81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82 
84 {
85  if (fField) delete fField;
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
91 {
93 
94  fVacuum = nistMan->FindOrBuildMaterial("G4_Galactic");
95  fGuideMaterial = nistMan->FindOrBuildMaterial("G4_Ni");
96 
97  // --- Ni diffuse 10%
98 
100 
101  // MPT->AddConstProperty("REFLECTIVITY",1.);
102  // Commented out above line as REFLECTIVITY=1 by default in
103  // G4OpBoundaryProcess. Also use AddProperty to set REFLECTIVITY if needed
104  MPT->AddConstProperty("DIFFUSION",0.1);
105  MPT->AddConstProperty("FERMIPOT",252.0); // Gollub, Table 2.1 in neV
106  MPT->AddConstProperty("SPINFLIP",0.);
107  MPT->AddConstProperty("LOSS", 12.5e-5); // Gollub, Table 2.1
108  MPT->AddConstProperty("LOSSCS",0.);
109  MPT->AddConstProperty("ABSCS",4.49); // 1/v loss cross-section at room temp.
110  MPT->AddConstProperty("SCATCS",18.5); // (incoherent) "elastic" scattering cs
111 
112  G4double neV = 1.e-9*eV;
113 
114  MPT->SetMicroRoughnessParameters(30*nm, 1*nm,
115  180, 1000,
116  0*degree, 90*degree,
117  1*neV, 1000*neV,
118  15, 15,
119  0.01*degree);
120 
122 
124 }
125 
126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
127 
129 {
130  //
131  // World
132  //
133 
134  G4double worldSizeX = 1.*m;
135  G4double worldSizeY = 1.*m;
136  G4double worldSizeZ = 100.*m;
137 
138  G4Box* solidWorld = new G4Box("World",
139  worldSizeX/2.,worldSizeY/2.,worldSizeZ/2.);
140 
141  G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld,
142  fVacuum,
143  "World");
144 
145  G4VPhysicalVolume* physiWorld = new G4PVPlacement(0,
146  G4ThreeVector(),
147  "World",
148  logicWorld,
149  0,
150  false,
151  0);
152 
153 // --------------------------------- Guide -------------------------------------
154 
155  G4double GuideR = 35.*mm;
156  G4double GuideW = 2.*mm;
157  G4double GuideL = 6.*m;
158 
159  G4Tubs* solidGuide = new G4Tubs("SolidGuide",
160  GuideR,GuideR+GuideW,GuideL/2.,0.,twopi);
161 
162  G4LogicalVolume* logicGuide = new G4LogicalVolume(solidGuide,
164  "Guide");
165 
166  new G4PVPlacement(0,G4ThreeVector(),"Guide",logicGuide,physiWorld,false,0);
167 
168 // ------------------------------ End Plate -----------------------------------
169 
170  G4Tubs* solidEndPlate = new G4Tubs("EndPlate",0.,GuideR,GuideW/2.,0.,twopi);
171 
172  G4LogicalVolume* logicEndPlate = new G4LogicalVolume(solidEndPlate,
173  fVacuum,
174  "EndPlate");
175 
176  G4ThreeVector endPlatePos = G4ThreeVector(0.,0.,GuideL/2.+GuideW/2.);
177 
178  new G4PVPlacement(0,endPlatePos,"EndPlate",logicEndPlate,physiWorld,false,0);
179 
180  G4double maxStep = 1.0*mm;
181  G4double maxTime = 100.*s;
182 
183  G4UserLimits* stepLimit = new G4UserLimits(maxStep,DBL_MAX,maxTime);
184 
185  logicWorld->SetUserLimits(stepLimit);
186 
187  //
188  // Visualization attributes
189  //
190 
191  G4VisAttributes* guideColor = new G4VisAttributes(G4Colour(0.0,0.0,1.0));
192  guideColor->SetVisibility(true);
193  guideColor->SetForceWireframe(true);
194 
195  G4VisAttributes* endPlateColor = new G4VisAttributes(G4Colour(1.0,0.0,0.0));
196  endPlateColor->SetVisibility(true);
197  endPlateColor->SetForceSolid(true);
198 
200  logicGuide->SetVisAttributes(guideColor);
201  logicEndPlate->SetVisAttributes(endPlateColor);
202 
203  //
204  //always return the physical World
205  //
206  return physiWorld;
207 }
208 
209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
210 
212 
214 {
215  if (!fField) {
216 
218 
219  G4RepleteEofM* equation = new G4RepleteEofM(fField);
220 // G4RepleteEofM* equation = new G4RepleteEofM(fField,12);
221 // G4EqGravityField* equation = new G4EqGravityField(fField);
222 
223  G4FieldManager* fieldManager
225  fieldManager->SetDetectorField(fField);
226 
227  G4MagIntegratorStepper* stepper = new G4ClassicalRK4(equation,8);
228 // G4MagIntegratorStepper* stepper = new G4ClassicalRK4(equation,12);
229 
230  G4double minStep = 0.01*mm;
231 
232  G4ChordFinder* chordFinder =
233  new G4ChordFinder((G4MagneticField*)fField,minStep,stepper);
234 
235  // Set accuracy parameters
236  G4double deltaChord = 3.0*mm;
237  chordFinder->SetDeltaChord( deltaChord );
238 
239  G4double deltaOneStep = 0.01*mm;
240  fieldManager->SetAccuraciesWithDeltaOneStep(deltaOneStep);
241 
242  G4double deltaIntersection = 0.1*mm;
243  fieldManager->SetDeltaIntersection(deltaIntersection);
244 
245  G4TransportationManager* transportManager =
247 
248  G4PropagatorInField* fieldPropagator =
249  transportManager->GetPropagatorInField();
250 
251  G4double epsMin = 2.5e-7*mm;
252  G4double epsMax = 0.05*mm;
253 
254  fieldPropagator->SetMinimumEpsilonStep(epsMin);
255  fieldPropagator->SetMaximumEpsilonStep(epsMax);
256 
257  fieldManager->SetChordFinder(chordFinder);
258  }
259 }
260 
261 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetMicroRoughnessParameters(G4double, G4double, G4int, G4int, G4double, G4double, G4double, G4double, G4int, G4int, G4double)
CLHEP::Hep3Vector G4ThreeVector
void SetDeltaChord(G4double newval)
void SetMaximumEpsilonStep(G4double newEpsMax)
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:593
static constexpr double nm
Definition: G4SIunits.hh:112
static constexpr double mm
Definition: G4SIunits.hh:115
Definition: G4Tubs.hh:85
#define G4endl
Definition: G4ios.hh:61
void AddConstProperty(const char *key, G4double PropertyValue)
virtual G4VPhysicalVolume * Construct()
static G4ThreadLocal G4UniformGravityField * fField
#define G4ThreadLocal
Definition: tls.hh:69
void SetAccuraciesWithDeltaOneStep(G4double valDeltaOneStep)
static const G4VisAttributes & GetInvisible()
G4bool SetDetectorField(G4Field *detectorField, int failMode=0)
static constexpr double m
Definition: G4SIunits.hh:129
const XML_Char * s
Definition: expat.h:262
double G4double
Definition: G4Types.hh:76
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
Definition: G4Material.cc:730
G4FieldManager * GetFieldManager() const
Definition: G4Box.hh:64
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static constexpr double twopi
Definition: G4SIunits.hh:76
static constexpr double eV
Definition: G4SIunits.hh:215
void SetVisAttributes(const G4VisAttributes *pVA)
void SetUserLimits(G4UserLimits *pULimits)
static G4TransportationManager * GetTransportationManager()
void SetForceSolid(G4bool=true)
void SetMinimumEpsilonStep(G4double newEpsMin)
void SetVisibility(G4bool=true)
void SetChordFinder(G4ChordFinder *aChordFinder)
Definition of the ExUCNDetectorConstruction class.
void SetDeltaIntersection(G4double valueDintersection)
static constexpr double degree
Definition: G4SIunits.hh:144
G4GLOB_DLL std::ostream G4cout
void SetForceWireframe(G4bool=true)
G4PropagatorInField * GetPropagatorInField() const
#define DBL_MAX
Definition: templates.hh:83
static G4NistManager * Instance()