Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4tgrSolidMultiUnion.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 // G4tgrSolidMultiUnion
0027 //
0028 // Class description:
0029 //
0030 // A G4tgrSolidMultiUnion is a G4tgrSolid object with a solid made by
0031 // union of more than two(nSolid) solids with respective rotations
0032 // (theRotMat) and positions(thePosition).
0033 //
0034 // Author: P.Heidary, AEOI - November 2021
0035 // --------------------------------------------------------------------
0036 #ifndef G4tgrSolidMultiUnion_hh
0037 #define G4tgrSolidMultiUnion_hh 1
0038 
0039 #include <vector>
0040 
0041 #include "globals.hh"
0042 #include "G4tgrSolid.hh"
0043 #include "G4RotationMatrix.hh"
0044 #include "G4Transform3D.hh"
0045 
0046 class G4tgrSolidMultiUnion : public G4tgrSolid
0047 {
0048   public:
0049 
0050     G4tgrSolidMultiUnion(const std::vector<G4String>& wl);
0051     ~G4tgrSolidMultiUnion();
0052 
0053     friend std::ostream& operator<<(std::ostream&, const G4tgrSolidMultiUnion&);
0054 
0055     // Accessors
0056     inline const G4tgrSolid* GetSolid(G4int ii) const;
0057     inline const G4Transform3D GetTransformation(G4int ii) const;
0058     inline G4int GetNSolid() const { return nSolid; };
0059 
0060   private:
0061 
0062     // Placement and rotation of current solid
0063     G4String          theRotMatName;
0064     G4ThreeVector     thePosition;
0065     G4RotationMatrix* theRotMat;
0066     G4Transform3D     tr1;
0067     G4int             nSolid;
0068 
0069     // Vectors of parameters.
0070     std::vector<std::vector<G4double>*> theSolidParams;
0071 
0072     // Array to store Solids and Transformations.
0073     std::vector<G4Transform3D>     theTransformations;
0074     std::vector<const G4tgrSolid*> theSolids;
0075 };
0076 
0077 inline const G4tgrSolid* G4tgrSolidMultiUnion::GetSolid(G4int ii) const
0078 {
0079   if(ii > nSolid)
0080   {
0081     std::ostringstream message;
0082     message << "Only " << nSolid + 1 << " G4tgrSolids are available! " << 
0083     " Asking for... " << ii + 1;
0084     G4Exception("G4tgrSolidMultiUnion::GetSolid()", "InvalidInput", FatalException,
0085                 message);
0086   }
0087   return theSolids[ii];
0088 }
0089 
0090 inline const G4Transform3D G4tgrSolidMultiUnion::GetTransformation(G4int ii) const
0091 {
0092   if(ii > nSolid)
0093   {
0094     std::ostringstream message;
0095     message << "Only " << nSolid + 1 << " G4tgrSolids are available! " << 
0096     " Asking for... " << ii + 1;
0097     G4Exception("G4tgrSolidMultiUnion::GetSolid()", "InvalidInput", FatalException,
0098                 message);
0099   }
0100   return theTransformations[ii];
0101 }
0102 
0103 #endif