00001 00002 /**********************************************************/ 00003 /* This header creates the Detector components and */ 00004 /* initializes the DetectorConstruction class. */ 00005 /**********************************************************/ 00006 00007 00008 #ifndef MollerDetectorConstruction_h 00009 #define MollerDetectorConstruction_h 1 00010 00011 #include "G4GDMLParser.hh" 00012 #include "G4VUserDetectorConstruction.hh" 00013 #include "MollerDetectorMessenger.hh" 00014 #include "MollerGlobalMagnetField.hh" 00015 #include <vector> 00016 00017 class G4Tubs; 00018 class G4LogicalVolume; 00019 class G4VPhysicalVolume; 00020 class G4VSensitiveDetector; 00021 class G4Material; 00022 class G4Element; 00023 class G4UniformMagField; 00024 class G4QuadrupoleMagField; 00025 class MollerDetectorMessenger; 00026 00027 class MollerDetectorConstruction : public G4VUserDetectorConstruction 00028 { 00029 public: 00030 00031 MollerDetectorConstruction(); 00032 virtual ~MollerDetectorConstruction(); 00033 00034 public: 00035 00036 G4VPhysicalVolume* Construct(); 00037 00038 void CreateGlobalMagneticField(); 00039 void ReadGlobalMagneticField(); 00040 00041 void ReadCollimatorGeometry(const char* filename); 00042 00043 //G4VPhysicalVolume* ReadGeometryFile(const G4String& filename); 00044 00045 void WriteGeometryFile(const G4String& filename); 00046 00047 void SetDetectorGeomFile(const G4String&); 00048 void SetReadGeo(G4bool value) {fReadGeoFile = value;}; 00049 void SetCollimGeomFile(const G4String&); 00050 void setTargetLength (G4double value) { fTargetLength = value; }; 00051 00052 void setNumColl(G4int value) { NUM_COLS = value; G4cout<<G4endl<<G4endl<<"NUM_COLS (detcons) = "<<NUM_COLS<<G4endl<<G4endl;}; 00053 00054 G4int getNumColl() {return NUM_COLS; }; 00055 00056 protected: 00057 00058 //void DefineDipoleFields(); 00059 void DefineQuadFields(); 00060 void DefineMaterials(); 00061 00062 private: 00063 00064 //Logical Volumes 00065 G4LogicalVolume* mother_logic; 00066 std::vector<G4LogicalVolume*> washer_logic; 00067 G4LogicalVolume* target_logic; 00068 std::vector<G4LogicalVolume*> trapeziod_logic; 00069 00070 00071 //Physical Volumes 00072 G4VPhysicalVolume* worldVolume; 00073 00074 G4VPhysicalVolume* mother_phys; 00075 std::vector<G4VPhysicalVolume*> washer_phys; 00076 G4VPhysicalVolume* target_phys; 00077 std::vector<G4VPhysicalVolume*> trapeziod_phys; 00078 00079 G4VPhysicalVolume* quartz_phys; 00080 00081 G4Tubs* target_solid; // pointer to the solid Target 00082 00083 00084 G4VPhysicalVolume* ConstructDetector(); 00085 00086 void DumpGeometricalTree(G4VPhysicalVolume* aVolume,G4int depth=0); 00087 G4GDMLParser fGDMLParser; 00088 00089 //Materials 00090 00091 G4Material* Vacuum; 00092 G4Material* Carbon; 00093 G4Material* Al; 00094 G4Material* Copper; 00095 G4Material* Pb; 00096 G4Material* Tungsten; 00097 G4Material* Iron; 00098 G4Element* H; 00099 G4Material* LH2; 00100 00101 //---------------------- 00102 // global magnet section 00103 //---------------------- 00104 // 00105 MollerGlobalMagnetField* pGlobalMagnetField; 00106 00107 G4FieldManager* fGlobalFieldManager; 00108 G4ChordFinder* fGlobalChordFinder; 00109 G4Mag_UsualEqRhs* fGlobalEquation; 00110 G4MagIntegratorStepper* fGlobalStepper; 00111 00112 G4double fMinStep; 00113 00114 00115 MollerDetectorMessenger* detectorMessenger; 00116 G4String detfileName; 00117 G4String collimfileName; 00118 G4double fTargetLength; // Full length of the target 00119 G4bool fReadGeoFile; 00120 00121 G4int NUM_COLS; 00122 00123 std::vector<G4double> collInnerRadius; 00124 std::vector<G4double> collOuterRadius; 00125 std::vector<G4double> collUpstreamZ; 00126 std::vector<G4double> collDownstreamZ; 00127 std::vector<G4String> collMaterial; 00128 00129 }; 00130 00131 #endif