Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:10

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 // G4tgbVolume
0027 //
0028 // Class description:
0029 //
0030 // Class to manage the geometry info of any detector unit. The detector units
0031 // created in this class are essentially transient copies of Geant4 physical
0032 // volumes. Thus, they are characterized by a name and the parameters of a
0033 // Geant4 physical volume.
0034 // They have associated several detector positions, that can be instances of
0035 // G4tgrPlace, G4tgrPlaceDivRep or G4tgrPlaceParameterisation.
0036 // Each detector positioning is done inside a parent. As there can be several
0037 // parents, we will write one parent for each detector position, even if that
0038 // means that parents are repeated.
0039 
0040 // Author: P.Arce, CIEMAT (November 2007)
0041 // --------------------------------------------------------------------
0042 #ifndef G4tgbVolume_hh
0043 #define G4tgbVolume_hh 1
0044 
0045 #include <map>
0046 
0047 #include "globals.hh"
0048 #include "G4tgrVolume.hh"
0049 #include "geomdefs.hh"
0050 
0051 class G4tgrPlace;
0052 class G4tgrSolid;
0053 class G4VSolid;
0054 class G4LogicalVolume;
0055 class G4VPhysicalVolume;
0056 class G4AssemblyVolume;
0057 
0058 class G4tgbVolume
0059 {
0060   public:
0061 
0062     G4tgbVolume();
0063     ~G4tgbVolume();
0064     G4tgbVolume(G4tgrVolume* vol);
0065 
0066     void ConstructG4Volumes(const G4tgrPlace* place,
0067                             const G4LogicalVolume* parentLV);
0068       // Construct the G4VSolid, G4LogicalVolume and the G4VPhysicalVolume
0069       // of copy 'copyNo'
0070 
0071     G4VSolid* FindOrConstructG4Solid(const G4tgrSolid* vol);
0072       // Construct the G4VSolid from the data of the corresponding G4tgrVolume.
0073       // Allow to use data from another G4tgrVolume, needed by Boolean solids
0074       // (that have to construct two solids and then do the Boolean operation)
0075 
0076     G4LogicalVolume* ConstructG4LogVol(const G4VSolid* solid);
0077       // Construct the G4LogicalVolume and then call the construction of
0078       // volumes that are positioned inside this LV
0079 
0080     G4VPhysicalVolume* ConstructG4PhysVol(const G4tgrPlace* place,
0081                                           const G4LogicalVolume* currentLV,
0082                                           const G4LogicalVolume* parentLV);
0083       // Construct the G4VPhysicalVolume placing 'curentLV' with position
0084       // given by the G4tgrPlace 'copyNo' inside 'parentLV'
0085 
0086     void SetCutsInRange(G4LogicalVolume* logvol,
0087                         std::map<G4String, G4double> cuts);
0088     void SetCutsInEnergy(G4LogicalVolume* logvol,
0089                          std::map<G4String, G4double> cuts);
0090 
0091     void CheckNoSolidParams(const G4String& solidType,
0092                             const unsigned int NoParamExpected,
0093                             const unsigned int NoParam);
0094       // Before building a solid of type 'solydType', check if the number
0095       // of paramenters is the expected one
0096 
0097     G4VSolid* BuildSolidForDivision(G4VSolid* parentSolid, EAxis axis);
0098 
0099     const G4String& GetName() const { return theTgrVolume->GetName(); }
0100     G4bool GetVisibility() const { return theTgrVolume->GetVisibility(); }
0101     const G4double* GetColour() const { return theTgrVolume->GetColour(); }
0102 
0103   private:
0104 
0105     G4tgrVolume* theTgrVolume = nullptr;
0106       // The G4tgrVolume to which it corresponds
0107 
0108     G4AssemblyVolume* theG4AssemblyVolume = nullptr;
0109 };
0110 
0111 #endif