Back to home page

EIC code displayed by LXR

 
 

    


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

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 // G4ParameterisationPolyhedra[Rho/Phi/Z]
0027 //
0028 // Class description:
0029 //
0030 // These classes represent the parameterised positioning equivalent to 
0031 // dividing a G4Polyhedra along one of each axis Rho, Phi, Z.
0032 
0033 // 09.05.01 - P.Arce, Initial version
0034 // 08.04.04 - I.Hrivnacova, Implemented reflection
0035 //---------------------------------------------------------------------
0036 #ifndef G4PARAMETERISATIONPOLYHEDRA_HH
0037 #define G4PARAMETERISATIONPOLYHEDRA_HH 1
0038 
0039 #include "G4VDivisionParameterisation.hh"
0040 #include "G4Polyhedra.hh"
0041 
0042 class G4VPhysicalVolume;
0043 
0044 // Dummy declarations to get rid of warnings ...
0045 //
0046 class G4Trd;
0047 class G4Trap;
0048 class G4Cons;
0049 class G4Sphere;
0050 class G4Orb;
0051 class G4Ellipsoid;
0052 class G4Torus;
0053 class G4Para;
0054 class G4Hype;
0055 class G4Tubs;
0056 class G4Polycone;
0057 
0058 class G4VParameterisationPolyhedra : public G4VDivisionParameterisation
0059 { 
0060   public:  // with description
0061   
0062     G4VParameterisationPolyhedra( EAxis axis, G4int nCopies,
0063                             G4double offset, G4double step,
0064                             G4VSolid* msolid, DivisionType divType );
0065   
0066     ~G4VParameterisationPolyhedra() override;
0067 
0068   private:
0069 
0070     G4double ConvertRadiusFactor(const G4Polyhedra& phedra) const;
0071       // Converts radius of the sides to radius of the corners:
0072       // r_corners = r_sides/factor
0073 };
0074 
0075 //---------------------------------------------------------------------
0076 // Class G4ParameterisationPolyhedraRho
0077 //---------------------------------------------------------------------
0078 
0079 class G4ParameterisationPolyhedraRho : public G4VParameterisationPolyhedra
0080 { 
0081   public:  // with description
0082 
0083     G4ParameterisationPolyhedraRho( EAxis axis, G4int nCopies,
0084                                     G4double offset, G4double step,
0085                                     G4VSolid* motherSolid,
0086                                     DivisionType divType );
0087    ~G4ParameterisationPolyhedraRho() override;
0088 
0089     void CheckParametersValidity() override;
0090 
0091     G4double GetMaxParameter() const override;
0092 
0093     void ComputeTransformation( const G4int copyNo,
0094                                       G4VPhysicalVolume* physVol ) const override;
0095     void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo,
0096                             const G4VPhysicalVolume* physVol ) const override;
0097 
0098   private:  // Dummy declarations to get rid of warnings ...
0099 
0100     void ComputeDimensions (G4Trd&,const G4int,
0101                             const G4VPhysicalVolume*) const override {}
0102     void ComputeDimensions (G4Trap&,const G4int,
0103                             const G4VPhysicalVolume*) const override {}
0104     void ComputeDimensions (G4Box&,const G4int,
0105                             const G4VPhysicalVolume*) const override {}
0106     void ComputeDimensions (G4Sphere&,const G4int,
0107                             const G4VPhysicalVolume*) const override {}
0108     void ComputeDimensions (G4Orb&,const G4int,
0109                             const G4VPhysicalVolume*) const override {}
0110     void ComputeDimensions (G4Ellipsoid&,const G4int,
0111                             const G4VPhysicalVolume*) const override {}
0112     void ComputeDimensions (G4Torus&,const G4int,
0113                             const G4VPhysicalVolume*) const override {}
0114     void ComputeDimensions (G4Para&,const G4int,
0115                             const G4VPhysicalVolume*) const override {}
0116     void ComputeDimensions (G4Hype&,const G4int,
0117                             const G4VPhysicalVolume*) const override {}
0118     void ComputeDimensions (G4Tubs&,const G4int,
0119                             const G4VPhysicalVolume*) const override {}
0120     void ComputeDimensions (G4Cons&,const G4int,
0121                             const G4VPhysicalVolume*) const override {}
0122     void ComputeDimensions (G4Polycone&,const G4int,
0123                             const G4VPhysicalVolume*) const override {}
0124 };
0125 
0126 //---------------------------------------------------------------------
0127 // Class G4ParameterisationPolyhedraPhi
0128 //---------------------------------------------------------------------
0129 
0130 class G4ParameterisationPolyhedraPhi : public G4VParameterisationPolyhedra
0131 { 
0132   public:  // with description
0133 
0134     G4ParameterisationPolyhedraPhi( EAxis axis, G4int nCopies,
0135                                    G4double offset, G4double step,
0136                                    G4VSolid* motherSolid,
0137                                    DivisionType divType );
0138    ~G4ParameterisationPolyhedraPhi() override;
0139 
0140     void CheckParametersValidity() override;
0141 
0142     G4double GetMaxParameter() const override;
0143 
0144     void ComputeTransformation( const G4int copyNo,
0145                                       G4VPhysicalVolume* physVol ) const override;
0146     void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo,
0147                             const G4VPhysicalVolume* physVol ) const override;
0148 
0149   private:  // Dummy declarations to get rid of warnings ...
0150 
0151     void ComputeDimensions (G4Trd&,const G4int,
0152                             const G4VPhysicalVolume*) const override {}
0153     void ComputeDimensions (G4Trap&,const G4int,
0154                             const G4VPhysicalVolume*) const override {}
0155     void ComputeDimensions (G4Box&,const G4int,
0156                             const G4VPhysicalVolume*) const override {}
0157     void ComputeDimensions (G4Sphere&,const G4int,
0158                             const G4VPhysicalVolume*) const override {}
0159     void ComputeDimensions (G4Orb&,const G4int,
0160                             const G4VPhysicalVolume*) const override {}
0161     void ComputeDimensions (G4Ellipsoid&,const G4int,
0162                             const G4VPhysicalVolume*) const override {}
0163     void ComputeDimensions (G4Torus&,const G4int,
0164                             const G4VPhysicalVolume*) const override {}
0165     void ComputeDimensions (G4Para&,const G4int,
0166                             const G4VPhysicalVolume*) const override {}
0167     void ComputeDimensions (G4Hype&,const G4int,
0168                             const G4VPhysicalVolume*) const override {}
0169     void ComputeDimensions (G4Tubs&,const G4int,
0170                             const G4VPhysicalVolume*) const override {}
0171     void ComputeDimensions (G4Cons&,const G4int,
0172                             const G4VPhysicalVolume*) const override {}
0173     void ComputeDimensions (G4Polycone&,const G4int,
0174                             const G4VPhysicalVolume*) const override {}
0175 };
0176 
0177 //---------------------------------------------------------------------
0178 // Class G4ParameterisationPolyhedraZ
0179 //---------------------------------------------------------------------
0180 
0181 class G4ParameterisationPolyhedraZ : public G4VParameterisationPolyhedra
0182 { 
0183   public:  // with description
0184 
0185     G4ParameterisationPolyhedraZ( EAxis axis, G4int nCopies,
0186                                   G4double offset, G4double step,
0187                                   G4VSolid* motherSolid,
0188                                   DivisionType divType );
0189    ~G4ParameterisationPolyhedraZ() override;
0190 
0191     void CheckParametersValidity() override;
0192 
0193     G4double GetMaxParameter() const override;
0194 
0195     void ComputeTransformation( const G4int copyNo,
0196                                       G4VPhysicalVolume* physVol ) const override;
0197     void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo,
0198                             const G4VPhysicalVolume* physVol ) const override;
0199 
0200   private:
0201 
0202     G4double GetR(G4double z, G4double z1, G4double r1,
0203                   G4double z2, G4double r2) const;
0204     G4double GetRmin(G4double z, G4int nsegment) const;
0205     G4double GetRmax(G4double z, G4int nsegment) const;
0206 
0207     // Dummy declarations to get rid of warnings ...
0208     void ComputeDimensions (G4Trd&,const G4int,
0209                             const G4VPhysicalVolume*) const override {}
0210     void ComputeDimensions (G4Trap&,const G4int,
0211                             const G4VPhysicalVolume*) const override {}
0212     void ComputeDimensions (G4Box&,const G4int,
0213                             const G4VPhysicalVolume*) const override {}
0214     void ComputeDimensions (G4Sphere&,const G4int,
0215                             const G4VPhysicalVolume*) const override {}
0216     void ComputeDimensions (G4Orb&,const G4int,
0217                             const G4VPhysicalVolume*) const override {}
0218     void ComputeDimensions (G4Ellipsoid&,const G4int,
0219                             const G4VPhysicalVolume*) const override {}
0220     void ComputeDimensions (G4Torus&,const G4int,
0221                             const G4VPhysicalVolume*) const override {}
0222     void ComputeDimensions (G4Para&,const G4int,
0223                             const G4VPhysicalVolume*) const override {}
0224     void ComputeDimensions (G4Hype&,const G4int,
0225                             const G4VPhysicalVolume*) const override {}
0226     void ComputeDimensions (G4Tubs&,const G4int,
0227                             const G4VPhysicalVolume*) const override {}
0228     void ComputeDimensions (G4Cons&,const G4int,
0229                             const G4VPhysicalVolume*) const override {}
0230     void ComputeDimensions (G4Polycone&,const G4int,
0231                             const G4VPhysicalVolume*) const override {}
0232   private:
0233 
0234     G4int fNSegment = 0;
0235     G4PolyhedraHistorical* fOrigParamMother = nullptr;
0236 };
0237 
0238 #endif