Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:21

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 #ifndef DETECTORCONSTRUCTION_HH
0027 #define DETECTORCONSTRUCTION_HH
0028 
0029 #include "G4VUserDetectorConstruction.hh"
0030 #include "G4Types.hh"
0031 
0032 #include <utility>
0033 #include <vector>
0034 
0035 class G4VPhysicalVolume;
0036 class G4LogicalVolume;
0037 class G4GenericMessenger;
0038 class HGCalTBMaterials;
0039 
0040 /**
0041  * @brief Detector construction.
0042  *
0043  * Creates a detector with a configuration set by UI commands. By default a test
0044  * module is build (few elements including a silicon sensor).
0045  * Sensitive detectors are attached to silicon sensors.
0046  *
0047  */
0048 
0049 class DetectorConstruction : public G4VUserDetectorConstruction {
0050 public:
0051   DetectorConstruction();
0052   virtual ~DetectorConstruction();
0053 
0054   virtual G4VPhysicalVolume *Construct();
0055   virtual void ConstructSDandField();
0056 
0057 private:
0058   /// Define UI commands: configuration of detector (geometry setup), and
0059   /// maximal step size in silicon
0060   void DefineCommands();
0061   /// Set detector setup configuration based on ID
0062   /// @param[in] aValue ID of detector configuration
0063   void SelectConfiguration(G4int aValue);
0064   /// Set maximal size of step within silicon sensor
0065   /// Can be changed by the UI command /HGCalTestbeam/setup/stepSilicon
0066   /// @param[in] aValue Max step size
0067   void SetStepSizeSilicon(G4double aValue);
0068   /// Helper method placing the logical volumes from map of elements
0069   void ConstructHGCal();
0070 
0071   /// Pointer to the logical volume of the world
0072   G4LogicalVolume *fLogicWorld = nullptr;
0073   /// Pointer to the messenger for UI commands
0074   G4GenericMessenger *fMessenger = nullptr;
0075   /// Pointer to the class that defines materials and logical volumes of all
0076   /// possible elements, to be placed according to the configuration setup
0077   HGCalTBMaterials *fMaterials = nullptr;
0078   /// Map of elements to be placed along z axis: name and distance to the
0079   /// previous element is specified
0080   std::vector<std::pair<G4String, G4double>> fElementsMap;
0081   /// Viewpoint for the visualisation
0082   G4double fVisViewpoint = 0;
0083   /// Configuration of the detector setup
0084   /// Can be changed by the UI command /HGCalTestbeam/setup/configuration
0085   G4int fConfiguration = 0;
0086 };
0087 
0088 #endif /* DETECTORCONSTRUCTION_HH */