Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 /// \file B2/B2a/include/DetectorConstruction. 28 /// \brief Definition of the B2a::DetectorCons 29 30 #ifndef B2aDetectorConstruction_h 31 #define B2aDetectorConstruction_h 1 32 33 #include "G4VUserDetectorConstruction.hh" 34 #include "G4Threading.hh" 35 #include "globals.hh" 36 37 class G4VPhysicalVolume; 38 class G4LogicalVolume; 39 class G4Material; 40 class G4UserLimits; 41 class G4GlobalMagFieldMessenger; 42 43 namespace B2a 44 { 45 46 class DetectorMessenger; 47 48 /// Detector construction class to define mate 49 /// and global uniform magnetic field. 50 51 class DetectorConstruction : public G4VUserDet 52 { 53 public: 54 DetectorConstruction(); 55 ~DetectorConstruction() override; 56 57 public: 58 G4VPhysicalVolume* Construct() override; 59 void ConstructSDandField() override; 60 61 // Set methods 62 void SetTargetMaterial(G4String); 63 void SetChamberMaterial(G4String); 64 void SetMaxStep(G4double); 65 void SetCheckOverlaps(G4bool); 66 67 private: 68 // methods 69 void DefineMaterials(); 70 G4VPhysicalVolume* DefineVolumes(); 71 72 // static data members 73 static G4ThreadLocal G4GlobalMagFieldMesse 74 // magnetic field messenger 75 // data members 76 G4int fNbOfChambers = 0; 77 78 G4LogicalVolume* fLogicTarget = nullptr; 79 G4LogicalVolume** fLogicChamber = nullptr; 80 81 G4Material* fTargetMaterial = nullptr; // 82 G4Material* fChamberMaterial = nullptr; / 83 84 G4UserLimits* fStepLimit = nullptr; // po 85 86 DetectorMessenger* fMessenger = nullptr; 87 88 G4bool fCheckOverlaps = true; // option t 89 }; 90 91 } // namespace B2a 92 93 #endif 94