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 // G4tgrSolidBoolean
0027 //
0028 // Class description:
0029 //
0030 // A G4tgrSolidBoolean is an G4tgrSolid object with a solid made out of
0031 // the Boolean operation of two solids. The type of operation can be:
0032 // Union, Substraction, Intersection.
0033 
0034 // Author: P.Arce, CIEMAT (November 2007)
0035 // --------------------------------------------------------------------
0036 #ifndef G4tgrSolidBoolean_hh
0037 #define G4tgrSolidBoolean_hh 1
0038 
0039 #include <vector>
0040 
0041 #include "globals.hh"
0042 #include "G4tgrSolid.hh"
0043 
0044 class G4tgrSolidBoolean : public G4tgrSolid
0045 {
0046   public:
0047 
0048     G4tgrSolidBoolean(const std::vector<G4String>& wl);
0049     ~G4tgrSolidBoolean();
0050 
0051     friend std::ostream& operator<<(std::ostream&, const G4tgrSolidBoolean&);
0052 
0053     // Accessors
0054 
0055     inline const G4tgrSolid* GetSolid(G4int ii) const;
0056     const G4String& GetRelativeRotMatName() const;
0057     G4ThreeVector GetRelativePlace() const;
0058 
0059   private:
0060 
0061     // Solid types (Box, Tube, etc) of the solids composing the Boolean solid
0062 
0063     std::vector<std::vector<G4double>*> theSolidParams;
0064       // Vectors of parameters.
0065 
0066     G4String theRelativeRotMatName;
0067     G4ThreeVector theRelativePlace;
0068       // Relative placement and rotation of solid 2 w.r.t. solid 1
0069 
0070     std::vector<const G4tgrSolid*> theSolids;
0071       // The two G4tgrSolid's that combine to make this one
0072 };
0073 
0074 inline const G4tgrSolid* G4tgrSolidBoolean::GetSolid(G4int ii) const
0075 {
0076   if((ii != 0) && (ii != 1))
0077   {
0078     std::ostringstream message;
0079     message << "Only two G4tgrSolids (0,1) possible ! Asking for... " << ii;
0080     G4Exception("G4tgrSolidBoolean::GetSolid()", "InvalidInput", FatalException,
0081                 message);
0082   }
0083   return theSolids[ii];
0084 }
0085 
0086 #endif