File indexing completed on 2026-06-16 07:53:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef DetectorConstruction_h
0030 #define DetectorConstruction_h 1
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 #include "G4Material.hh"
0047 #include "G4VPhysicalVolume.hh"
0048 #include "G4VUserDetectorConstruction.hh"
0049
0050
0051
0052 class CheckVolumeSD;
0053 class PhantomSD;
0054 class TargetSD;
0055 class DetectorMessenger;
0056 class G4LogicalVolume;
0057
0058 class DetectorConstruction : public G4VUserDetectorConstruction
0059 {
0060 public:
0061 DetectorConstruction();
0062 virtual ~DetectorConstruction();
0063
0064 G4VPhysicalVolume* Construct();
0065
0066 void SetTarget1Material(const G4String& m);
0067 void SetTarget2Material(const G4String& m);
0068
0069 inline G4double GetGeneratorPosZ() const { return fGeneratorPosZ; };
0070
0071 inline void SetGap(G4double val) { fDelta = val; };
0072 inline void SetTarget1Z(G4double val) { fTarget1Z = val; };
0073 inline void SetTarget2Z(G4double val) { fTarget2Z = val; };
0074 inline void SetMylarZ(G4double val) { fMylarVolumeZ = val; }
0075 inline void SetCheckShiftZ(G4double val) { fCheckShiftZ = val; }
0076 inline void SetAbsorberZ(G4double val) { fAbsorberZ = val; }
0077 inline void SetAbsorberShiftZ(G4double val) { fAbsorberShiftZ = val; }
0078
0079 inline void SetNumberDivZ(G4int val) { fNumZ = val; };
0080 inline void SetNumberDivR(G4int val) { fNumR = val; };
0081
0082 const G4VPhysicalVolume* GetCheckVolume() const { return fCheckVolume; }
0083 const G4VPhysicalVolume* GetGasVolume() const { return fGasVolume; }
0084 const G4VPhysicalVolume* GetPhantom() const { return fPhantom; }
0085 const G4VPhysicalVolume* GetTarget1() const { return fTarget1; }
0086 const G4VPhysicalVolume* GetTarget2() const { return fTarget2; }
0087
0088 G4double GetAbsorberZ() const { return fPhantomZ; }
0089 G4double GetAbsorberR() const { return fAbsorberRadius; }
0090 G4double GetScoreZ() const { return fAbsorberShiftZ; }
0091
0092 G4int GetNumberDivZ() const { return fNumZ; }
0093 G4int GetNumberDivR() const { return fNumR; }
0094
0095 void SetMaxEnergy(G4double e) { fMaxEnergy = e; }
0096 inline G4double GetMaxEnergy() const { return fMaxEnergy; }
0097 G4int GetNumberDivE() const { return fNumE; }
0098 inline void SetNumberDivE(G4int val) { fNumE = val; };
0099
0100 void SetVerbose(G4bool v) { fVerbose = v; }
0101 inline G4bool GetVerbose() const { return fVerbose; }
0102
0103 void DumpGeometryParameters();
0104
0105 private:
0106 void InitialiseGeometryParameters();
0107
0108 DetectorConstruction& operator=(const DetectorConstruction& right);
0109 DetectorConstruction(const DetectorConstruction&);
0110 void ConstructSDandField();
0111
0112 G4bool fVerbose;
0113
0114 G4int fNumZ;
0115 G4int fNumR;
0116
0117 G4int fNumE;
0118 G4double fMaxEnergy;
0119
0120 G4LogicalVolume* fLogicCheckVolume;
0121 std::vector<G4LogicalVolume*> fLogicRing;
0122 G4LogicalVolume* fLogicPh;
0123 G4LogicalVolume* fLogicAbsorber;
0124
0125 G4double fWorldXY, fWorldZ;
0126 G4double fDelta;
0127 G4double fGeneratorPosZ;
0128
0129 G4double fTargetRadius, fTarget1Z, fTarget1PosZ;
0130 G4double fTarget2Z, fTarget2PosZ;
0131
0132 G4double fGasVolumeRadius, fGasVolumeZ, fGasVolumePosZ;
0133 G4double fAirZ, fMylarVolumeZ, fMylarPosZ;
0134 G4double fCheckVolumeRadius, fCheckVolumeZ, fCheckShiftZ, fCheckVolumePosZ;
0135 G4double fTargetVolumeZ, fTargetVolumePosZ;
0136 G4double fShiftZPh;
0137
0138 G4double fPhantomRadius, fPhantomZ, fPhantomPosZ;
0139 G4double fAbsorberRadius, fAbsorberZ, fAbsorberShiftZ, fAbsorberPosZ;
0140 G4double fDistanceVacuumTarget, fWindowZ, fWindowPosZ;
0141
0142 G4Material* fWorldMaterial;
0143
0144 G4Material* fTarget1Material;
0145 G4Material* fTarget2Material;
0146 G4Material* fMylar;
0147 G4Material* fWindowMaterial;
0148
0149 G4Material* fLightMaterial;
0150 G4Material* fAbsorberMaterial;
0151
0152 G4LogicalVolume* fLogicTarget1;
0153 G4LogicalVolume* fLogicTarget2;
0154
0155 G4VPhysicalVolume* fCheckVolume;
0156 G4VPhysicalVolume* fGasVolume;
0157 G4VPhysicalVolume* fPhantom;
0158 G4VPhysicalVolume* fTarget1;
0159 G4VPhysicalVolume* fTarget2;
0160
0161 DetectorMessenger* fMessenger;
0162 };
0163
0164
0165
0166 #endif