Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:33

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 PAR03DETECTORCONSTRUCTION_H
0027 #define PAR03DETECTORCONSTRUCTION_H
0028 
0029 #include "G4Material.hh"
0030 #include "G4SystemOfUnits.hh"
0031 #include "G4VUserDetectorConstruction.hh"
0032 
0033 class Par03DetectorMessenger;
0034 class G4LogicalVolume;
0035 
0036 /**
0037  * @brief Detector construction.
0038  *
0039  * Creates a cylindrical detector, with cylinder axis along Z-axis. It is placed
0040  * in the world volume so that its bases are located at z=0 and z=Length.
0041  * Dimensions of the detector (Radius and Length) and material can be set using
0042  * the UI commands.
0043  * Readout geometry of the detector is created, and can be set by UI commands.
0044  * Cells are created along z-axis, azimuthal angle, and radius (cylindrical
0045  * segmentation).
0046  * Sensitive detector Par03SensitiveDetector is attached to the
0047  * cell volume.
0048  * Region for the detector is created as an envelope of the fast simulation.
0049  *
0050  */
0051 
0052 class Par03DetectorConstruction : public G4VUserDetectorConstruction
0053 {
0054   public:
0055     Par03DetectorConstruction();
0056     virtual ~Par03DetectorConstruction();
0057 
0058     virtual G4VPhysicalVolume* Construct() final;
0059     virtual void ConstructSDandField() final;
0060 
0061     // Set radius of the cylindrical detector
0062     void SetRadius(G4double aRadius);
0063     // Get radius of the cylindrical detector
0064     inline G4double GetRadius() const { return fDetectorRadius; };
0065     // Set length of the cylindrical detector (along z-axis)
0066     void SetLength(G4double aLength);
0067     // Get length of the cylindrical detector (along z-axis)
0068     inline G4double GetLength() const { return fDetectorLength; };
0069     // Set material of the detector (from NIST materials)
0070     void SetMaterial(const G4String& aMaterial);
0071     // Get name of the material of the detector
0072     inline G4String GetMaterial() const { return fDetectorMaterial->GetName(); };
0073 
0074     // Set number of readout cells along z-axis
0075     inline void SetNbOfLayers(G4int aNumber) { fNbOfLayers = aNumber; };
0076     // Get number of readout cells along z-axis
0077     inline G4int GetNbOfLayers() const { return fNbOfLayers; };
0078     // Set number of readout cells along radius of cylinder
0079     inline void SetNbOfRhoCells(G4int aNumber) { fNbOfRhoCells = aNumber; };
0080     // Get number of readout cells along radius of cylinder
0081     inline G4int GetNbOfRhoCells() const { return fNbOfRhoCells; };
0082     // Set number of readout cells in azimuthal angle
0083     inline void SetNbOfPhiCells(G4int aNumber) { fNbOfPhiCells = aNumber; };
0084     // Get number of readout cells in azimuthal angle
0085     inline G4int GetNbOfPhiCells() const { return fNbOfPhiCells; };
0086 
0087     // Print detector information
0088     void Print() const;
0089 
0090   private:
0091     /// Messenger that allows to modify geometry
0092     Par03DetectorMessenger* fDetectorMessenger;
0093     /// Logical volume of replicated cell
0094     G4LogicalVolume* fLogicCell = nullptr;
0095     /// World size (in each X, Y, Z dimension)
0096     G4double fWorldSize = 10 * m;
0097     /// Radius of the cylindrical detector
0098     G4double fDetectorRadius = 10 * cm;
0099     /// Length of the cylindrical detector (along z axis)
0100     G4double fDetectorLength = 30 * cm;
0101     /// Material of the detector
0102     G4Material* fDetectorMaterial = nullptr;
0103     /// Number of layers = slices along z axis
0104     G4int fNbOfLayers = 10;
0105     /// Number of cells along radius
0106     G4int fNbOfRhoCells = 10;
0107     /// Number of cells in azimuthal angle
0108     G4int fNbOfPhiCells = 10;
0109 };
0110 
0111 #endif /* PAR03DETECTORCONSTRUCTION_H */