Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:19

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 // G4GDMLParameterisation
0027 //
0028 // Class description:
0029 //
0030 // GDML class for interpretation of parameterisations.
0031 
0032 // Author: Zoltan Torzsok, November 2007
0033 // --------------------------------------------------------------------
0034 #ifndef G4GDMLPARAMETERISATION_HH
0035 #define G4GDMLPARAMETERISATION_HH 1
0036 
0037 #include "G4VPVParameterisation.hh"
0038 #include "G4VPhysicalVolume.hh"
0039 #include "G4ThreeVector.hh"
0040 #include "G4Box.hh"
0041 #include "G4Trd.hh"
0042 #include "G4Trap.hh"
0043 #include "G4Cons.hh"
0044 #include "G4Sphere.hh"
0045 #include "G4Orb.hh"
0046 #include "G4Ellipsoid.hh"
0047 #include "G4Polycone.hh"
0048 #include "G4Polyhedra.hh"
0049 #include "G4Torus.hh"
0050 #include "G4Para.hh"
0051 #include "G4Hype.hh"
0052 #include "G4Tubs.hh"
0053 #include "G4Polycone.hh"
0054 #include "G4Polyhedra.hh"
0055 #include "G4RotationMatrix.hh"
0056 #include "G4ThreeVector.hh"
0057 
0058 #include <vector>
0059 
0060 class G4GDMLParameterisation : public G4VPVParameterisation
0061 {
0062   public:
0063 
0064     struct PARAMETER
0065     {
0066       G4RotationMatrix* pRot = nullptr;
0067       G4ThreeVector position;
0068       G4double dimension[16];
0069 
0070       PARAMETER()
0071       {
0072         memset(dimension, 0, sizeof(dimension));
0073       }
0074     };
0075 
0076     G4int GetSize() const;
0077     void AddParameter(const PARAMETER&);
0078 
0079   private:
0080 
0081     void ComputeTransformation(const G4int, G4VPhysicalVolume*) const;
0082     void ComputeDimensions(G4Box&, const G4int,
0083                            const G4VPhysicalVolume*) const;
0084     void ComputeDimensions(G4Trd&, const G4int,
0085                            const G4VPhysicalVolume*) const;
0086     void ComputeDimensions(G4Trap&, const G4int,
0087                            const G4VPhysicalVolume*) const;
0088     void ComputeDimensions(G4Cons&, const G4int,
0089                            const G4VPhysicalVolume*) const;
0090     void ComputeDimensions(G4Sphere&, const G4int,
0091                            const G4VPhysicalVolume*) const;
0092     void ComputeDimensions(G4Orb&, const G4int,
0093                            const G4VPhysicalVolume*) const;
0094     void ComputeDimensions(G4Ellipsoid&, const G4int,
0095                            const G4VPhysicalVolume*) const;
0096     void ComputeDimensions(G4Torus&, const G4int,
0097                            const G4VPhysicalVolume*) const;
0098     void ComputeDimensions(G4Para&, const G4int,
0099                            const G4VPhysicalVolume*) const;
0100     void ComputeDimensions(G4Hype&, const G4int,
0101                            const G4VPhysicalVolume*) const;
0102     void ComputeDimensions(G4Tubs&, const G4int,
0103                            const G4VPhysicalVolume*) const;
0104     void ComputeDimensions(G4Polycone&, const G4int,
0105                            const G4VPhysicalVolume*) const;
0106     void ComputeDimensions(G4Polyhedra&, const G4int,
0107                            const G4VPhysicalVolume*) const;
0108 
0109   private:
0110 
0111     std::vector<PARAMETER> parameterList;
0112 };
0113 
0114 #endif