QwGeant4
QweakSimDetectorConstruction.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 //
7 /**
8 
9  \file QweakSimDetectorConstruction.cc
10 
11  $Revision: 1.10 $
12  $Date: 2006/05/05 21:40:08 $
13 
14  \author Klaus Hans Grimm
15 
16 */
17 //=============================================================================
18 //
19 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
20 
21  // Geometries and positions for collimators are double-checked and updated.
22  // -Peiqing 2011 Nov. 11
23 
24 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
25 
27 
28 // geant4 includes
29 #include "G4SolidStore.hh"
30 #include "G4LogicalVolumeStore.hh"
31 #include "G4PhysicalVolumeStore.hh"
32 //
33 #include "G4RunManager.hh"
34 #include "G4FieldManager.hh"
35 #include "G4GeometryManager.hh"
36 #include "G4TransportationManager.hh"
37 //
38 #include "G4Mag_UsualEqRhs.hh"
39 #include "G4Mag_SpinEqRhs.hh"
40 #include "G4PropagatorInField.hh"
41 #include "G4ChordFinder.hh"
42 #include "G4SimpleRunge.hh"
43 #include "G4MagIntegratorDriver.hh"
44 
45 
46 // user includes
47 #include "QweakSimSolids.hh"
49 #include "QweakSimMaterial.hh"
50 #include "QweakSimGeometry.hh"
52 #include "QweakSimTarget.hh"
54 #include "QweakSimBeamLine.hh"
56 #include "QweakSimTungstenPlug.hh"
57 #include "QweakSimCollimator.hh"
59 #include "QweakSimShieldingWall.hh"
60 #include "QweakSimPionWall.hh"
61 #include "QweakSimWShutters.hh"
62 #include "QweakSimLeadGlass.hh"
63 #include "QweakSimPMTOnly.hh"
64 #include "QweakSimLumiDetector.hh"
65 #include "QweakSimMainMagnet.hh"
66 #include "QweakSimVDC.hh"
67 #include "QweakSimVDCRotator.hh"
68 #include "QweakSimHDC.hh"
69 //#include "QweakSimGEM.hh"
72 #include "QweakSimMagneticField.hh"
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76 
77 //===================================================================
78 // Qweak *Geant4* Geometry Conventions:
79 // The origin is at the center of the main toroidal magnet with
80 // the z-axis pointing along the beam direction, the y-axis
81 // pointing toward the ceiling, and the x-axis pointing toward
82 // beam-left so as to form a right-handed coordinate system.
83 // Octants are numbered from 1 to 8, clockwise with #1 at the
84 // 12 o-clock position.
85 //===================================================================
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88 
90 {
91  // initialize pointers and variables
95 
96  HallFloor_Solid = NULL;
97  HallFloor_Logical = NULL;
98  HallFloor_Physical = NULL;
99 
100  detectorMessenger = NULL;
101  pMaterial = NULL;
102  pGeometry = NULL;
103 
104  pMagneticField = NULL;
105 
106  pTriggerScintillator = NULL;
107  pCerenkovDetector = NULL;
108 
109  pTungstenPlug = NULL;
110  pCollimator1 = NULL;
111  pCollimator2 = NULL;
112  pCollimator3 = NULL;
113  pCollimatorSupport = NULL;
114 
115 
116  pShieldingWall = NULL;
117 
118  pPionWall = NULL;
119 
120  pWShutters1 = NULL;
121  pWShutters2 = NULL;
122 
123  pLeadGlass = NULL;
124 
125  pPMTOnly = NULL;
126 
127  pLumiDetector = NULL;
128 
129  // pGEM = NULL;
130  pHDC = NULL;
131  pVDC = NULL;
132  pVDCRotator = NULL;
133 
134  pTarget = NULL;
135  pBeamLine = NULL;
136  pMainMagnet = NULL;
137 
138  fWorldLengthInX = 0.0*cm;
139  fWorldLengthInY = 0.0*cm;
140  fWorldLengthInZ = 0.0*cm;
141 
142  fFloorLengthInX = 0.0*cm;
143  fFloorLengthInY = 0.0*cm;
144  fFloorLengthInZ = 0.0*cm;
145  fFloorPositionInY = 0.0*cm; // Top positon, not the center pos
146 
147  fGlobalEquation = NULL;
148  fGlobalStepper = NULL;
149  fGlobalChordFinder = NULL;
150 
151  HallFloor_VisAtt = NULL;
152  HallFloor_VisAtt = new G4VisAttributes();
153 
154  myUserInfo = userInfo;
155 
157 
159 }
160 
162 {
163  // I'm deleting the objects in the reverse order they were created (~FILO)
164 
165  if (pMagneticField) delete pMagneticField;
166 
167  if (pVDCRotator) delete pVDCRotator;
168  // if (pGEM) delete pGEM;
169  if (pHDC) delete pHDC;
170  if (pVDC) delete pVDC;
171 
174 
175  if (pTungstenPlug) delete pTungstenPlug;
176  if (pCollimator1) delete pCollimator1;
177  if (pCollimator2) delete pCollimator2;
178  if (pCollimator3) delete pCollimator3;
180 
181 
182  if (pShieldingWall) delete pShieldingWall;
183 
184  if (pPionWall) delete pPionWall;
185 
186  if (pWShutters1) delete pWShutters1;
187  if (pWShutters2) delete pWShutters2;
188 
189  if (pLeadGlass) delete pLeadGlass;
190 
191  if (pPMTOnly) delete pPMTOnly;
192 
193  if (pLumiDetector) delete pLumiDetector;
194 
195  if (pTarget) delete pTarget;
196  if (pBeamLine) delete pBeamLine;
197  if (pMainMagnet) delete pMainMagnet;
198 
200  if (pGeometry) delete pGeometry;
201 
202 }
203 
204 
206 {
207  return ConstructQweak();
208 }
209 
211 {
214 
220 
222 
223  pPionWall = new QweakSimPionWall();
224 
227 
229 
231 
233 
234  pMainMagnet = new QweakSimMainMagnet(); // QTOR Geometry (decoupled from field)
235 
236  //pGEM = new QweakSimGEM();
237  pHDC = new QweakSimHDC();
238  pVDC = new QweakSimVDC();
240 
242 
244 
245 
246  //--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
247 
248 // fWorldLengthInX = 10.0*m;
249 // fWorldLengthInY = 10.0*m;
250 // fWorldLengthInZ = 20.0*m;
251 
252 //Val's Changes so correct shielding hut lengths fit in the world 2013-05-03
253  fWorldLengthInX = 20.0*m; //Val's Changes so correct shielding hut lengths fit in the world
254  fWorldLengthInY = 20.0*m; //Val's Changes so correct shielding hut lengths fit in the world
255  fWorldLengthInZ = 40.0*m; //Val's Changes so correct shielding hut lengths fit in the world
256 
257 
258  // experimentalHall_Material = pMaterial->GetMaterial("HeGas");
259  // Note: experimentalHall_Material was HeGas all the time up to 12-28-2005 !!!
260 
262 
263  experimentalHall_Solid = new G4Box("ExpHall_Sol",
264  0.5* fWorldLengthInX ,
265  0.5* fWorldLengthInY ,
266  0.5* fWorldLengthInZ );
267 
268  experimentalHall_Logical = new G4LogicalVolume( experimentalHall_Solid,
270  "ExpHall_Logical",
271  0, 0, 0);
272 
273  // Must place the World Physical volume unrotated at (0,0,0).
274  //
275  experimentalHall_Physical = new G4PVPlacement(0, // no rotation
276  G4ThreeVector(), // at (0,0,0)
277  experimentalHall_Logical, // its logical volume
278  "ExpHall_Physical", // its name
279  0, // its mother volume
280  false, // no boolean operations
281  0, // no field specific to volume
282  pSurfChk); // check for overlaps
283 
284  // Get the geometry, which defines the world volume
285  //
286  pGeometry = new QweakSimGeometry();
288 
289  //==========================
290  // Defining the Hall Floor
291  //==========================
292 
293 // fFloorLengthInX = 12.0*m;
294 // fFloorLengthInY = 1.0*m;
295 // fFloorLengthInZ = 28.0*m;
296 
297 //Val's Changes so correct shielding hut lengths will be on the floor 2013-05-03
298  fFloorLengthInX = 16.0*m;
299  fFloorLengthInY = 1.0*m;
300  fFloorLengthInZ = 32.0*m;
301 
302  fFloorPositionInY = -396.25*cm; // Top positon, not the center pos
303 
304 
305  HallFloor_Material = pMaterial->GetMaterial("ShieldingConcrete");
306 
307  HallFloor_Solid = new G4Box("HallFloor_Sol",
308  0.5* fFloorLengthInX ,
309  0.5* fFloorLengthInY ,
310  0.5* fFloorLengthInZ );
311 
312  HallFloor_Logical = new G4LogicalVolume( HallFloor_Solid,
314  "HallFloor_Logical",
315  0, 0, 0);
316 
317  // Must place the World Physical volume unrotated at (0,0,0).
318  //
319  HallFloor_Physical = new G4PVPlacement(0, // no rotation
320  G4ThreeVector(0.,fFloorPositionInY -0.5* fFloorLengthInY,0.),
321  "HallFloor_Physical", // its name
322  HallFloor_Logical, // its logical volume
323  experimentalHall_Physical , // its physical mother volume
324  false, // no boolean operations
325  0, // no field specific to volume
326  pSurfChk); // check for overlaps
327 
328 
329  G4cout << G4endl << "###### QweakSimDetectorConstruction: Setting Attributes " << G4endl << G4endl;
330 
331  G4Colour grey ( 127/255., 127/255., 127/255.);
332 
333  HallFloor_VisAtt->SetColor(grey);
334  HallFloor_VisAtt->SetVisibility(true);
335  //HallFloor_VisAtt->SetVisibility(false);
336  //HallFloor_VisAtt->SetForceWireframe(true);
337  //HallFloor_VisAtt->SetForceSolid(true);
338  HallFloor_Logical->SetVisAttributes(HallFloor_VisAtt);
339 
340  //============================================
341  // create/place target body into MotherVolume
342  //============================================
343  //
344  if (pTarget) {
345  pTarget -> ConstructComponent(experimentalHall_Physical);
346  // pTarget -> SetTargetCenterPositionInZ(-650.0*cm);
347  pTarget -> SetTargetCenterPositionInZ(myUserInfo->TargetCenterPositionZ);
348  //
350  }
351 
352  //============================================
353  // create/place beamline body into MotherVolume
354  //============================================
355  //
356  if (pBeamLine) {
357  pBeamLine -> ConstructComponent(experimentalHall_Physical);
358  //pBeamLine -> SetBeamLineCenterPositionInZ(300.0*cm);
359  //pGeometry->AddModule(pBeamLine->getBeamLinePhysicalVolume());
360  }
361 
362  //================================================
363  // create/place MainMagnet body into MotherVolume
364  //================================================
365  //
366  if(pMainMagnet) {
367  pMainMagnet -> ConstructComponent(experimentalHall_Physical);
368  pMainMagnet -> SetCenterPositionInZ(0.0*cm);
369  pMainMagnet -> Construct_UpstreamSpider(experimentalHall_Physical);
370  pMainMagnet -> Construct_ClampPlates(experimentalHall_Physical);
371  pMainMagnet -> Construct_UpStreamMiniClampPlates(experimentalHall_Physical);
372  pMainMagnet -> Construct_CoilFrames(experimentalHall_Physical);
373  pMainMagnet -> Construct_RadialMountingBlocks(experimentalHall_Physical);
374  pMainMagnet -> Construct_SupportFrame(experimentalHall_Physical);
375  pMainMagnet -> Construct_DownstreamSpider(experimentalHall_Physical);
376  //
378  }
379 
380  //================================================
381  // create/place Tungsten plug body into MotherVolume
382  //================================================
383  //
384  if (pTungstenPlug) {
386  //
388  }
389 
390  //jpan@nuclear.uwinnipeg.ca: Fri Jun 5 12:24:18 CDT 2009
391  //update collimators' geometry parameters according to the drawings from //http://qweak.jlab.org/doc-private/ShowDocument?docid=745
392 
393  // Collimator 1 configuration
394  if (pCollimator1) {
395 
396  // TODO: the little high-theta corners of collimator 1 are not implemented
397  // TODO: the slanted region of collimator 1 is implemented with a single slope, not a double slope (see drawings)
402 
409 
411 
416  pCollimator1->SetOctantCutOutStartingPhiAngle((-16.61+90.0)*degree);
417  pCollimator1->SetOctantCutOutDeltaPhiAngle(2.0*16.61*degree);
419 
421 
422  pCollimator1->SetCollimatorHousing_CenterPositionInZ(-575.375*cm); //from ELOG Target/27
423  pCollimator1->SetCollimatorHousingMaterial("PBA"); //housing material - Lead with 5% Antimony
424  //
426  }
427 
428  // Collimator 2 configuration
429  if (pCollimator2) {
434 
437  pCollimator2->SetOctantCutOutFrontFullLength_X2(18.37*cm);//(upper edge)
441 
443 
444  // pCollimator2->SetOctantCutOutFrontInnerDiameter(57.12*cm);
445  // pCollimator2->SetOctantCutOutFrontOuterDiameter(71.62*cm);
446  // pCollimator2->SetOctantCutOutBackInnerDiameter(61.14*cm);
447  // pCollimator2->SetOctantCutOutBackOuterDiameter(74.14*cm);
448  // pCollimator2->SetOctantCutOutStartingPhiAngle((-14.38+90.0)*degree); // between 12.21 deg to 14.38 deg
449  // pCollimator2->SetOctantCutOutDeltaPhiAngle(2.0*14.38*degree); // take the average of 13.3 deg ? - Peiqing
450  // pCollimator2->SetOctantCutOutRadialOffset(0.0*cm);
451 
452  // redefine it here. -Peiqing, 2011 Nov 11
454  pCollimator2->SetOctantCutOutFrontOuterDiameter(2.0*(14.935+7.25)*cm);
457  pCollimator2->SetOctantCutOutStartingPhiAngle((-22.479+90.0)*degree);
458  pCollimator2->SetOctantCutOutDeltaPhiAngle(2.0*22.479*degree);
460 
462 
463  pCollimator2->SetCollimatorHousing_CenterPositionInZ(-377.99*cm); //from Target ELOG 27
465  //
467  }
468 
469  // Collimator 3 configuration
470  if (pCollimator3) {
472  pCollimator3->SetCollimatorHousing_FullLengthInX(240.0*cm);//should be updated to 238.76*cm
475 
482 
484 
485  // pCollimator3->SetOctantCutOutFrontInnerDiameter(2.0*39.0*cm);
486  // pCollimator3->SetOctantCutOutFrontOuterDiameter(2.0*51.0*cm);
487  // pCollimator3->SetOctantCutOutBackInnerDiameter(2.0*39.954*cm);
488  // pCollimator3->SetOctantCutOutBackOuterDiameter(2.0*51.0*cm);
489  // pCollimator3->SetOctantCutOutStartingPhiAngle((-16.390+90.0)*degree);
490  // pCollimator3->SetOctantCutOutDeltaPhiAngle(2.0*16.390*degree);
491  // pCollimator3->SetOctantCutOutRadialOffset(0.0*cm);
492 
493  // redefine it here -Peiqing 2011 Nov 11
494  pCollimator3->SetOctantCutOutFrontInnerDiameter(2.0*(39.0-16.2)*cm);
495  pCollimator3->SetOctantCutOutFrontOuterDiameter(2.0*(51.0-16.2)*cm);
496  pCollimator3->SetOctantCutOutBackInnerDiameter(2.0*(39.954-16.2)*cm);
497  pCollimator3->SetOctantCutOutBackOuterDiameter(2.0*(51.0-16.2)*cm);
498  pCollimator3->SetOctantCutOutStartingPhiAngle((-22.6+90.0)*degree);
499  pCollimator3->SetOctantCutOutDeltaPhiAngle(2.0*22.6*degree);
501 
503 
506  //
508  }
509 
510  //================================================
511  // create/place Collimator Support body into MotherVolume
512  //================================================
513  //
514  if (pCollimatorSupport) {
515  pCollimatorSupport -> ConstructSupport(experimentalHall_Physical);
516  }
517 
518  //===================================================
519  // create/place ShieldingWall body into MotherVolume
520  //===================================================
521  //
522  if (pShieldingWall) {
526 
527  // Peiqing: updated it according to as-designed geometry. 2011 Nov 12
531 
535 
539 
542 
543  pShieldingWall->SetCollimatorWallMaterial("ShieldingConcrete");
544 
551  //
553  }
554 
555  //===================================================
556  // create/place Pion Wall body into MotherVolume
557  //===================================================
558  //
559  if (pPionWall) {
561  }
562 
563  //===================================================
564  // create/place WShutters body into MotherVolume
565  //===================================================
566  //
567  if (pWShutters1) {
570  //pWShutters1->SetWShuttersNumber(1);
574  pWShutters1->SetWShutters_Material ("TungstenAlloy");
576  }
577  if (pWShutters2) {
580  //pWShutters2->SetWShuttersNumber(2);
584  pWShutters2->SetWShutters_Material ("TungstenAlloy");
586  }
587  //===================================================
588  // create/place LeadGlass into MotherVolume
589  //===================================================
590  //
591  if (pLeadGlass){
594  }
595 
596  //===================================================
597  // create/place PMTOnly into MotherVolume
598  //===================================================
599  //
600  if (pPMTOnly){
603  }
604 
605  //=========================================
606  // create/place Lumis into MotherVolume
607  //=========================================
608  //
609  if (pLumiDetector) {
611 
613  //pGeometry->AddModule(pLumiDetector->getDSLumiPhysicalVolume());
614  }
615 
616  //===============================================
617  // create/place Drift Chambers into MotherVolume
618  //===============================================
619  //
620  //if (pGEM) {
621  // pGEM->ConstructComponent(experimentalHall_Physical);
622  // pGeometry->AddModule(pGEM->getGEMFront_PhysicalVolume());
623  // pGeometry->AddModule(pGEM->getGEMBack_PhysicalVolume());
624  //}
625  //
626  if (pHDC) {
630  }
631  //===============================================
632  // create/place VDC Rotator into MotherVolume
633  //===============================================
634  //
635  if (pVDCRotator) {
642  pVDCRotator->SetRotationAngleInPhi( 90.0*degree);
643  }
644 
645 
646  //=====================================================
647  // create/place Trigger Scintillator into MotherVolume
648  //=====================================================
649  //
650  if (pTriggerScintillator) {
652  //
654  }
655 
656  //
657  if (pVDC) {
663  pVDC->SetVDC_RotationAngleInPhi(90.0*degree,0);
664  pVDC->SetVDC_RotationAngleInPhi(270.0*degree,1);
665  }
666 
667 
668  //=========================================
669  // create/place Cerenkov into MotherVolume
670  //=========================================
671  //
672  if (pCerenkovDetector) {
674  //
676  }
677 
678  //--------- Visualization attributes -------------------------------
679 
680  // Invisible Volume
681  experimentalHall_Logical->SetVisAttributes (G4VisAttributes::Invisible);
682 
683  //--------- Load magnetic field -------------------------------
684 
686 
687 
688  G4cout << G4endl << "###### Leaving QweakSimDetectorConstruction::Construct() " << G4endl << G4endl;
689 
690  // Construct() *MUST* return the pointer of the physical World !!!
692 }
693 
694 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
695 void QweakSimDetectorConstruction::DumpGeometry(G4bool surfchk, G4VPhysicalVolume* aVolume,G4int depth)
696 {
697  // Null volume
698  if (aVolume == 0) aVolume = experimentalHall_Physical;
699 
700  // Print spaces
701  for(int isp=0;isp<depth;isp++)
702  { G4cout << " "; }
703  // Print name
704  G4cout << aVolume->GetName() << "[" << aVolume->GetCopyNo() << "] "
705  << aVolume->GetLogicalVolume()->GetName() << " "
706  << aVolume->GetLogicalVolume()->GetNoDaughters() << " "
707  << aVolume->GetLogicalVolume()->GetMaterial()->GetName();
708  // Print sensitive detector
709  if(aVolume->GetLogicalVolume()->GetSensitiveDetector())
710  {
711  G4cout << " " << aVolume->GetLogicalVolume()->GetSensitiveDetector()
712  ->GetFullPathName();
713  }
714  G4cout << G4endl;
715 
716  // Check overlapping volumes
717  if (pSurfChk || surfchk) aVolume->CheckOverlaps();
718 
719  // Descend down the tree
720  for(int i=0;i<aVolume->GetLogicalVolume()->GetNoDaughters();i++)
721  { DumpGeometry(surfchk, aVolume->GetLogicalVolume()->GetDaughter(i),depth+1); }
722 }
723 
724 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
726 {
727  G4cout << G4endl << "###### Calling QweakDetectorConstruction::UpdateGeometry() " << G4endl << G4endl;
728 
729  // taken from LXe example
730  G4GeometryManager::GetInstance()->OpenGeometry();
731 
732  // clean up previous geometry
733  G4PhysicalVolumeStore ::GetInstance()->Clean();
734  G4LogicalVolumeStore ::GetInstance()->Clean();
735  G4SolidStore ::GetInstance()->Clean();
736  G4LogicalBorderSurface ::CleanSurfaceTable();
737 
738 
739  // define new geometry
740  G4RunManager::GetRunManager()->DefineWorldVolume(ConstructQweak());
741  G4RunManager::GetRunManager()->GeometryHasBeenModified();
742 
743 
744  G4cout << G4endl << "###### Leaving QweakDetectorConstruction::UpdateGeometry() " << G4endl << G4endl;
745 }
746 
747 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
749 {
750 
751  //--------- Magnetic Field -------------------------------
752 
753  //============================================
754  // Define the global magnet field Manager
755  //============================================
757 
758  // Get transportation, field, and propagator managers
759  fGlobalFieldManager = G4TransportationManager::GetTransportationManager()->GetFieldManager();
760 
761  // perform navigation/propagation in a general non-uni-form magnetic field
762  //G4PropagatorInField* pGlobalFieldPropagator = G4TransportationManager::GetTransportationManager()->GetPropagatorInField();
763 
764  // G4double minEps = 1.0e-5;
765  // G4double maxEps = 1.0e-4;
766 
767  //pGlobalFieldPropagator->SetMinimumEpsilonStep(minEps);
768  //pGlobalFieldPropagator->SetMaximumEpsilonStep(maxEps);
769 
770 
771  fGlobalFieldManager->SetDetectorField(pMagneticField);
772 
773 #define TRACK_ELECTRON_SPIN
774 #ifdef TRACK_ELECTRON_SPIN
775  fGlobalEquation = new G4Mag_SpinEqRhs(pMagneticField);
776  G4int numberOfVariables = 12;
777 #else
778  fGlobalEquation = new G4Mag_UsualEqRhs(pMagneticField);
779  G4int numberOfVariables = 6;
780 #endif
781 
782  // taken from one of the Geant4 presentation:
783  // - If the field is calculated from a field map, a lower order stepper
784  // is recommended: the less smooth the field is, the lower the order of the
785  // stepper that should be used. For very rough fields one should use 1st order
786  // stepper, for a somewhat smooth field one must choose between 1st and 2nd
787  // order stepper.
788 
789  //fGlobalStepper = new G4ClassicalRK4(fGlobalEquation, numberOfVariables); // classical 4th order stepper
790  //fGlobalStepper = new G4ExplicitEuler(fGlobalEquation, numberOfVariables); // 1st order stepper
791  //fGlobalStepper = new G4ImplicitEuler(fGlobalEquation, numberOfVariables); // 2nd order stepper
792  fGlobalStepper = new G4SimpleRunge(fGlobalEquation, numberOfVariables); // 2nd order stepper
793 
794 
795  // Provides a driver that talks to the Integrator Stepper, and insures that
796  // the error is within acceptable bounds.
797  G4MagInt_Driver* fGlobalIntgrDriver = new G4MagInt_Driver(0.1*mm, //1.0e-3*mm,
799  fGlobalStepper->GetNumberOfVariables());
800 
801  fGlobalChordFinder = new G4ChordFinder(fGlobalIntgrDriver);
802 
803 
804 
805  // G4bool fieldChangesEnergy = false;
806  // G4FieldManager* pFieldMgr = new G4FieldManager(myField,pChordFinder,FieldChangeEnergy);
807  // LocalLogicalVolume = new G4LogicalVolume(shape, material,"name",pFieldMgr,0,0);
808 
809  // // minimal step of 1 mm is default
810  // fMinStep = 0.01*mm ;
811  //
812  // fGlobalChordFinder = new G4ChordFinder (pGlobalMagnetField,
813  // fMinStep,
814  // fGlobalStepper);
815 
816  fGlobalFieldManager->SetChordFinder(fGlobalChordFinder);
817 
818 //=====================================================================================
819 // you can use this in DetectorConstruction class to make more smooth visulisation:
820 
821  G4TransportationManager* tmanager = G4TransportationManager::GetTransportationManager();
822  tmanager->GetPropagatorInField()->SetLargestAcceptableStep(1*mm);
823 //=====================================================================================
824 }
825 
826 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
828 {
829  G4cout << "###### Calling QweakSimDetectorConstruction::ShowHallFloor() " << G4endl << G4endl;
830 
831  HallFloor_VisAtt->SetVisibility(true);
832 
833  G4cout << "###### Leaving QweakSimDetectorConstruction::ShowHallFloor() " << G4endl << G4endl;
834 }
835 
836 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
838 {
839  G4cout << "###### Calling QweakSimDetectorConstruction::HideHallFloor() " << G4endl << G4endl;
840 
841  HallFloor_VisAtt->SetVisibility(false);
842 
843  G4cout << "###### Leaving QweakSimDetectorConstruction::HideHallFloor() " << G4endl << G4endl;
844 }
845 
846 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetOctantCutOut_Trap_FullLengthFront_Inner(G4double)
G4VPhysicalVolume * GetTriggerScintillator_PhysicalVolume()
void SetOctantCutOut_Trap_FullLengthFront_Outer(G4double)
void ConstructWShutters(G4VPhysicalVolume *)
void SetWShutters_CenterPositionInX(G4double xPos)
QweakSimCollimatorSupport * pCollimatorSupport
void SetOctantCutOutFrontFullLength_Y(G4double dim)
void SetWShutters_Material(G4String)
Definition of the Target.
void SetVDC_RotationAngleInPhi(G4double vdc_phiangle, G4int pkg)
void SetOctantCutOutStartingPhiAngle(G4double spa)
void ConstructTopWall(G4VPhysicalVolume *MotherVolume)
G4VPhysicalVolume * GetPMTOnly_PhysicalVolume()
static QweakSimMaterial * GetInstance()
G4VPhysicalVolume * getCollimatorHousingPhysicalVolume()
void SetCollimatorHousing_CenterPositionInZ(G4double zPos)
Defines the Shielding Wall with trapezoid cut outs (located after Main Magnet and before Region 3 VDC...
void SetOctantCutOutBackFullLength_X1(G4double dim)
void ConstructBackWall(G4VPhysicalVolume *MotherVolume)
void SetCollimatorHousingMaterial(G4String)
G4VPhysicalVolume * getShieldingWallHousingPhysicalVolume()
void SetCollimatorHousing_FullLengthInY(G4double dim)
void SetCollimatorHousing_FullLengthInZ(G4double dim)
void SetOctantCutOut_Trap_FullHeightBack(G4double)
G4VPhysicalVolume * getVDCBack_PhysicalVolume()
Definition: QweakSimVDC.hh:112
main class of QweakSim. All passive elements are are read from the GDML files.
Scans the input file for /QweakSim/xyz commands.
void ConstructComponent(G4VPhysicalVolume *MotherVolume)
G4VPhysicalVolume * getTargetPhysicalVolume()
void SetOctantCutOut_Trap_FullHeightFront(G4double)
void ConstructTungstenPlug(G4VPhysicalVolume *)
void SetCollimatorNumber(G4int n)
void ConstructFrontWall(G4VPhysicalVolume *MotherVolume)
QweakSimDetectorMessenger * detectorMessenger
void ConstructComponent(G4VPhysicalVolume *MotherVolume)
static const G4double inch
void ConstructPionWall(G4VPhysicalVolume *)
Definition of the Collimators.
void SetOctantCutOut_Trap_FullLengthBack_Inner(G4double)
void SetCollimatorWallMaterial(G4String)
G4VPhysicalVolume * getTungstenPlugPhysicalVolume()
void SetCollimatorWall_FullLengthInZ(G4double)
void SetRotationAngleInPhi(G4double vdc_phiangle)
QweakSimTriggerScintillator * pTriggerScintillator
G4VPhysicalVolume * getVDCFront_PhysicalVolume()
Definition: QweakSimVDC.hh:111
void SetCollimatorWall_CenterPositionInZ(G4double)
void DumpGeometry(G4bool surfchk=false, G4VPhysicalVolume *aVolume=0, G4int depth=0)
G4VPhysicalVolume * GetLeadGlass_PhysicalVolume()
void ConstructBeamRightSideWall(G4VPhysicalVolume *MotherVolume)
Region 3 Vertical Drift Chamber.
Definition: QweakSimVDC.hh:67
G4Material * GetMaterial(G4String material)
void ConstructComponent(G4VPhysicalVolume *)
Definition: QweakSimVDC.cc:218
void ConstructComponent(G4VPhysicalVolume *MotherVolume)
void ConstructShieldingWallHousing_UsingTrapezoids(G4VPhysicalVolume *)
void SetOctantCutOut_Trap_FullLengthBack_Outer(G4double)
void SetCollimatorWall_FullLengthInX(G4double)
void SetCollimatorHousing_FullLengthInX(G4double dim)
void SetOctantCutOutDeltaPhiAngle(G4double dpa)
void SetOctantCutOut_Trap_AzimuthalAngle(G4double)
G4VPhysicalVolume * GetCerenkovDetector_PhysicalVolume()
void SetOctantCutOutRadialOffset(G4double dpa)
void SetWorldVolume(G4VPhysicalVolume *worldvolume)
void SetOctantCutOutFrontOuterDiameter(G4double fod)
Definition of the Support/Shielding of the Collimators.
QweakSimDetectorConstruction(QweakSimUserInformation *)
void SetMotherVolume(G4VPhysicalVolume *mv)
void ConstructComponent(G4VPhysicalVolume *MotherVolume)
void SetWShutters_CenterPositionInY(G4double yPos)
Definition of the Support/Shielding of the Collimators.
void ConstructBeamLeftSideWall(G4VPhysicalVolume *MotherVolume)
void SetWShuttersNumber(G4int n)
void SetOctantCutOutBackInnerDiameter(G4double bid)
void SetOctantCutOutFrontInnerDiameter(G4double fid)
void ConstructComponent(G4VPhysicalVolume *)
Definition: QweakSimHDC.cc:187
Region 2 Horizontal Drift Chamber.
Definition: QweakSimHDC.hh:65
void SetOctantCutOut_Trap_RadialDistance(G4double)
Main Magnet solids like coils and support, no field.
void SetBeamlineCutoutDiameter(G4double dia)
QweakSimCerenkovDetector * pCerenkovDetector
void SetOctantCutOutFrontFullLength_X2(G4double dim)
G4VPhysicalVolume * getHDCBack_PhysicalVolume()
Definition: QweakSimHDC.hh:102
void AddModule(G4VPhysicalVolume *physvol)
void ConstructCollimator(G4VPhysicalVolume *)
static const G4bool pSurfChk
void SetOctantCutOutBackFullLength_X2(G4double dim)
void ConstructComponent(G4VPhysicalVolume *)
Definition of the BeamLine.
void SetOctantCutOutBackFullLength_Y(G4double dim)
void SetOctantCutOutFrontFullLength_X1(G4double dim)
G4VPhysicalVolume * getHDCFront_PhysicalVolume()
Definition: QweakSimHDC.hh:101
void SetOctantCutOutBackOuterDiameter(G4double bod)
G4VPhysicalVolume * getMainMagnetPhysicalVolume()
void SetWShutters_CenterPositionInZ(G4double zPos)
Definition of the Trigger Scintillator detector.
void SetTriggerScintillator(QweakSimTriggerScintillator *theTriggerScintillator)
Definition: QweakSimVDC.hh:141
G4VPhysicalVolume * getUSLumiPhysicalVolume()
void SetOctantCutOut_Trap_PolarAngle(G4double)
void SetVDCRotator(QweakSimVDCRotator *theRotator)
Definition: QweakSimVDC.hh:138
void SetCollimatorWall_FullLengthInY(G4double)