Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 #ifndef DETECTORCONSTRUCTION_HH 26 #ifndef DETECTORCONSTRUCTION_HH 27 #define DETECTORCONSTRUCTION_HH 27 #define DETECTORCONSTRUCTION_HH 28 28 29 #include "G4VUserDetectorConstruction.hh" 29 #include "G4VUserDetectorConstruction.hh" 30 #include "G4Types.hh" 30 #include "G4Types.hh" 31 31 32 #include <utility> 32 #include <utility> 33 #include <vector> 33 #include <vector> 34 34 35 class G4VPhysicalVolume; 35 class G4VPhysicalVolume; 36 class G4LogicalVolume; 36 class G4LogicalVolume; 37 class G4GenericMessenger; 37 class G4GenericMessenger; 38 class HGCalTBMaterials; 38 class HGCalTBMaterials; 39 39 40 /** 40 /** 41 * @brief Detector construction. 41 * @brief Detector construction. 42 * 42 * 43 * Creates a detector with a configuration set 43 * Creates a detector with a configuration set by UI commands. By default a test 44 * module is build (few elements including a s 44 * module is build (few elements including a silicon sensor). 45 * Sensitive detectors are attached to silicon 45 * Sensitive detectors are attached to silicon sensors. 46 * 46 * 47 */ 47 */ 48 48 49 class DetectorConstruction : public G4VUserDet 49 class DetectorConstruction : public G4VUserDetectorConstruction { 50 public: 50 public: 51 DetectorConstruction(); 51 DetectorConstruction(); 52 virtual ~DetectorConstruction(); 52 virtual ~DetectorConstruction(); 53 53 54 virtual G4VPhysicalVolume *Construct(); 54 virtual G4VPhysicalVolume *Construct(); 55 virtual void ConstructSDandField(); 55 virtual void ConstructSDandField(); 56 56 57 private: 57 private: 58 /// Define UI commands: configuration of det 58 /// Define UI commands: configuration of detector (geometry setup), and 59 /// maximal step size in silicon 59 /// maximal step size in silicon 60 void DefineCommands(); 60 void DefineCommands(); 61 /// Set detector setup configuration based o 61 /// Set detector setup configuration based on ID 62 /// @param[in] aValue ID of detector configu 62 /// @param[in] aValue ID of detector configuration 63 void SelectConfiguration(G4int aValue); 63 void SelectConfiguration(G4int aValue); 64 /// Set maximal size of step within silicon 64 /// Set maximal size of step within silicon sensor 65 /// Can be changed by the UI command /HGCalT 65 /// Can be changed by the UI command /HGCalTestbeam/setup/stepSilicon 66 /// @param[in] aValue Max step size 66 /// @param[in] aValue Max step size 67 void SetStepSizeSilicon(G4double aValue); 67 void SetStepSizeSilicon(G4double aValue); 68 /// Helper method placing the logical volume 68 /// Helper method placing the logical volumes from map of elements 69 void ConstructHGCal(); 69 void ConstructHGCal(); 70 70 71 /// Pointer to the logical volume of the wor 71 /// Pointer to the logical volume of the world 72 G4LogicalVolume *fLogicWorld = nullptr; 72 G4LogicalVolume *fLogicWorld = nullptr; 73 /// Pointer to the messenger for UI commands 73 /// Pointer to the messenger for UI commands 74 G4GenericMessenger *fMessenger = nullptr; 74 G4GenericMessenger *fMessenger = nullptr; 75 /// Pointer to the class that defines materi 75 /// Pointer to the class that defines materials and logical volumes of all 76 /// possible elements, to be placed accordin 76 /// possible elements, to be placed according to the configuration setup 77 HGCalTBMaterials *fMaterials = nullptr; 77 HGCalTBMaterials *fMaterials = nullptr; 78 /// Map of elements to be placed along z axi 78 /// Map of elements to be placed along z axis: name and distance to the 79 /// previous element is specified 79 /// previous element is specified 80 std::vector<std::pair<G4String, G4double>> f 80 std::vector<std::pair<G4String, G4double>> fElementsMap; 81 /// Viewpoint for the visualisation 81 /// Viewpoint for the visualisation 82 G4double fVisViewpoint = 0; 82 G4double fVisViewpoint = 0; 83 /// Configuration of the detector setup 83 /// Configuration of the detector setup 84 /// Can be changed by the UI command /HGCalT 84 /// Can be changed by the UI command /HGCalTestbeam/setup/configuration 85 G4int fConfiguration = 0; 85 G4int fConfiguration = 0; 86 }; 86 }; 87 87 88 #endif /* DETECTORCONSTRUCTION_HH */ 88 #endif /* DETECTORCONSTRUCTION_HH */ 89 89