Geant4 Cross Reference |
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 // 27 /// \file field/field04/include/F04DetectorConstruction.hh 28 /// \brief Definition of the F04DetectorConstruction class 29 // 30 31 #ifndef F04DetectorConstruction_h 32 #define F04DetectorConstruction_h 1 33 34 #include "CLHEP/Units/SystemOfUnits.h" 35 36 #include "G4Cache.hh" 37 #include "G4LogicalVolume.hh" 38 #include "G4RotationMatrix.hh" 39 #include "globals.hh" 40 41 class G4Tubs; 42 43 class G4VPhysicalVolume; 44 45 class F04Materials; 46 class G4Material; 47 48 class F04GlobalField; 49 50 class F04DetectorMessenger; 51 52 #include "G4VUserDetectorConstruction.hh" 53 54 class F04DetectorConstruction : public G4VUserDetectorConstruction 55 { 56 public: 57 F04DetectorConstruction(); 58 ~F04DetectorConstruction() override; 59 60 G4VPhysicalVolume* Construct() override; 61 G4VPhysicalVolume* ConstructDetector(); 62 63 void ConstructSDandField() override; 64 65 // StringToRotationMatrix() converts a string "X90,Y45" into a 66 // G4RotationMatrix. 67 // This is an active rotation, in that the object is first rotated 68 // around the parent's X axis by 90 degrees, then the object is 69 // further rotated around the parent's Y axis by 45 degrees. 70 // The return value points to a G4RotationMatrix on the heap, so 71 // it is persistent. Angles are in degrees, can have decimals, 72 // and can be negative. Axes are X, Y, Z. 73 74 static G4RotationMatrix StringToRotationMatrix(G4String rotation); 75 76 public: 77 void SetWorldMaterial(G4String); 78 void SetWorldSizeZ(G4double); 79 void SetWorldSizeR(G4double); 80 81 void SetCaptureMgntRadius(G4double); 82 void SetCaptureMgntLength(G4double); 83 void SetCaptureMgntB1(G4double); 84 void SetCaptureMgntB2(G4double); 85 86 void SetTransferMgntRadius(G4double); 87 void SetTransferMgntLength(G4double); 88 void SetTransferMgntB(G4double); 89 void SetTransferMgntPos(G4double); 90 91 void SetTargetMaterial(G4String); 92 void SetTargetThickness(G4double); 93 void SetTargetRadius(G4double); 94 void SetTargetPos(G4double); 95 void SetTargetAngle(G4int); 96 97 void SetDegraderMaterial(G4String); 98 void SetDegraderThickness(G4double); 99 void SetDegraderRadius(G4double); 100 void SetDegraderPos(G4double); 101 102 public: 103 G4Material* GetWorldMaterial() { return fWorldMaterial; } 104 G4double GetWorldSizeZ() { return fWorldSizeZ; } 105 G4double GetWorldSizeR() { return fWorldSizeR; } 106 107 G4LogicalVolume* GetCaptureMgnt() { return fLogicCaptureMgnt; } 108 G4double GetCaptureMgntRadius() { return fCaptureMgntRadius; } 109 G4double GetCaptureMgntLength() { return fCaptureMgntLength; } 110 G4double GetCaptureMgntB1() { return fCaptureMgntB1; } 111 G4double GetCaptureMgntB2() { return fCaptureMgntB2; } 112 G4ThreeVector GetCaptureMgntCenter() { return fCaptureMgntCenter; } 113 114 G4LogicalVolume* GetTransferMgnt() { return fLogicTransferMgnt; } 115 G4double GetTransferMgntRadius() { return fTransferMgntRadius; } 116 G4double GetTransferMgntLength() { return fTransferMgntLength; } 117 G4double GetTransferMgntB() { return fTransferMgntB; } 118 G4double GetTransferMgntPos() { return fTransferMgntPos; } 119 G4ThreeVector GetTransferMgntCenter() { return fTransferMgntCenter; } 120 121 G4Material* GetTargetMaterial() { return fTargetMaterial; } 122 G4double GetTargetRadius() { return fTargetRadius; } 123 G4double GetTargetThickness() { return fTargetThickness; } 124 G4double GetTargetPos() { return fTargetPos; } 125 G4int GetTargetAngle() { return fTargetAngle; } 126 127 G4Material* GetDegraderMaterial() { return fDegraderMaterial; } 128 G4double GetDegraderRadius() { return fDegraderRadius; } 129 G4double GetDegraderThickness() { return fDegraderThickness; } 130 G4double GetDegraderPos() { return fDegraderPos; } 131 132 private: 133 F04DetectorMessenger* fDetectorMessenger = nullptr; // pointer to the Messenger 134 G4Cache<F04GlobalField*> fFieldSetUp = nullptr; 135 136 F04Materials* fMaterials = nullptr; 137 138 G4Material* fVacuum = nullptr; 139 140 G4Tubs* fSolidWorld = nullptr; 141 G4LogicalVolume* fLogicWorld = nullptr; 142 G4VPhysicalVolume* fPhysiWorld = nullptr; 143 144 G4Tubs* fSolidTarget = nullptr; 145 G4LogicalVolume* fLogicTarget = nullptr; 146 G4VPhysicalVolume* fPhysiTarget = nullptr; 147 148 G4Tubs* fSolidDegrader = nullptr; 149 G4LogicalVolume* fLogicDegrader = nullptr; 150 G4VPhysicalVolume* fPhysiDegrader = nullptr; 151 152 G4Tubs* fSolidCaptureMgnt = nullptr; 153 G4LogicalVolume* fLogicCaptureMgnt = nullptr; 154 G4VPhysicalVolume* fPhysiCaptureMgnt = nullptr; 155 156 G4Tubs* fSolidTransferMgnt = nullptr; 157 G4LogicalVolume* fLogicTransferMgnt = nullptr; 158 G4VPhysicalVolume* fPhysiTransferMgnt = nullptr; 159 160 G4Material* fWorldMaterial = nullptr; 161 G4double fWorldSizeR = 5. * CLHEP::m; 162 G4double fWorldSizeZ = 50. * CLHEP::m; 163 164 G4double fCaptureMgntLength = 4.0 * CLHEP::m; 165 G4double fCaptureMgntRadius = 0.6 * CLHEP::m; 166 G4double fCaptureMgntB1 = 0.; 167 G4double fCaptureMgntB2 = 0.; 168 169 G4double fTransferMgntLength = 15.0 * CLHEP::m; 170 G4double fTransferMgntRadius = 0.3 * CLHEP::m; 171 G4double fTransferMgntB = 0.; 172 G4double fTransferMgntPos = 0.; 173 174 G4Material* fTargetMaterial = nullptr; 175 G4double fTargetThickness = 16.0 * CLHEP::cm; 176 G4double fTargetRadius = 0.4 * CLHEP::cm; 177 G4double fTargetPos = 0.; 178 G4int fTargetAngle = 0.; 179 180 G4Material* fDegraderMaterial = nullptr; 181 G4double fDegraderThickness = 0.1 * CLHEP::cm; 182 G4double fDegraderRadius = 30.0 * CLHEP::cm; 183 G4double fDegraderPos = 0.; 184 185 G4ThreeVector fCaptureMgntCenter, fTransferMgntCenter; 186 187 private: 188 void DefineMaterials(); 189 }; 190 191 #endif 192