Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:11:41

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 // G4ParameterisationTrd[X/Y/Z]
0027 //
0028 // Class description:
0029 //
0030 // This class represents the parameterised positioning equivalent to 
0031 // dividing a trapezoid along one of each axis X, Y, Z.
0032 
0033 // Author: Pedro Arce (CIEMAT), 09.05.2001 - Initial version
0034 //         Ivana Hrivnacova (Orsay), 08.04.2004 - Implemented reflection
0035 // --------------------------------------------------------------------
0036 #ifndef G4PARAMETERISATIONTRD_HH
0037 #define G4PARAMETERISATIONTRD_HH 1
0038 
0039 #include <vector>
0040 
0041 #include "G4VDivisionParameterisation.hh"
0042 #include "G4VSolid.hh" 
0043 
0044 class G4VPhysicalVolume;
0045 
0046 // Dummy declarations to get rid of warnings ...
0047 //
0048 class G4Cons;
0049 class G4Box;
0050 class G4Sphere;
0051 class G4Orb;
0052 class G4Ellipsoid;
0053 class G4Torus;
0054 class G4Para;
0055 class G4Hype;
0056 class G4Tubs;
0057 class G4Polycone;
0058 class G4Polyhedra;
0059 
0060 /**
0061  * @brief G4VParameterisationTrd is the base class for the parameterised
0062  * positioning equivalent to dividing a trapezoid along one of each axis X, Y, Z.
0063  */
0064 
0065 class G4VParameterisationTrd : public G4VDivisionParameterisation
0066 { 
0067   public:
0068   
0069     /**
0070      * Initialises a parameterised Trd, given the axis of parameterisation
0071      * 'axis' and the number of divided copies 'nCopies'.
0072      *  @param[in] axis The axis along which apply the parameterisation.
0073      *  @param[in] nCopies The total number of divided copies.
0074      *  @param[in] offset Potential initial offset along the axis.
0075      *  @param[in] step The width of the divided entity.
0076      *  @param[in] pSolid Pointer to the original shape to parameterise.
0077      *  @param[in] divType String identifier for the kind of division.
0078      */
0079     G4VParameterisationTrd( EAxis axis, G4int nCopies,
0080                             G4double offset, G4double step,
0081                             G4VSolid* pSolid, DivisionType divType );
0082   
0083     /**
0084      * Default Destructor.
0085      */
0086     ~G4VParameterisationTrd() override;
0087 
0088   protected:
0089 
0090     G4bool bDivInTrap = false;
0091 };
0092 
0093 /**
0094  * @brief G4ParameterisationTrdX represents the parameterised positioning
0095  * equivalent to dividing a G4Trd along X axis.
0096  */
0097 
0098 class G4ParameterisationTrdX : public G4VParameterisationTrd
0099 { 
0100   public:
0101 
0102     /**
0103      * Initialises a parameterised Trd along X axis.
0104      *  @param[in] axis The axis along which apply the parameterisation.
0105      *  @param[in] nCopies The total number of divided copies.
0106      *  @param[in] offset Potential initial offset along the axis.
0107      *  @param[in] step The width of the divided entity.
0108      *  @param[in] pSolid Pointer to the original shape to parameterise.
0109      *  @param[in] divType String identifier for the kind of division.
0110      */
0111     G4ParameterisationTrdX( EAxis axis, G4int nCopies,
0112                             G4double width, G4double offset,
0113                             G4VSolid* pSolid, DivisionType divType );
0114 
0115     /**
0116      * Default Destructor.
0117      */
0118    ~G4ParameterisationTrdX() override;
0119 
0120     /**
0121      * Returns the max width along X.
0122      *  @returns The maximum width of the solid to divide along the X axis.
0123      */
0124     G4double GetMaxParameter() const override;
0125 
0126     /**
0127      * Concrete methods implementing the parameterisation.
0128      */
0129     void ComputeTransformation(const G4int copyNo,
0130                                      G4VPhysicalVolume* physVol) const override;
0131     void ComputeDimensions(G4Trd& trd, const G4int copyNo,
0132                            const G4VPhysicalVolume* pv) const override;
0133     void ComputeDimensions(G4Trap& trd, const G4int copyNo,
0134                const G4VPhysicalVolume* pv) const override;
0135   
0136   private:  // Dummy declarations to get rid of warnings ...
0137 
0138     void ComputeDimensions (G4Cons&,const G4int,
0139                             const G4VPhysicalVolume*) const override {}
0140     void ComputeDimensions (G4Box&,const G4int,
0141                             const G4VPhysicalVolume*) const override {}
0142     void ComputeDimensions (G4Sphere&,const G4int,
0143                             const G4VPhysicalVolume*) const override {}
0144     void ComputeDimensions (G4Orb&,const G4int,
0145                             const G4VPhysicalVolume*) const override {}
0146     void ComputeDimensions (G4Ellipsoid&,const G4int,
0147                             const G4VPhysicalVolume*) const override {}
0148     void ComputeDimensions (G4Torus&,const G4int,
0149                             const G4VPhysicalVolume*) const override {}
0150     void ComputeDimensions (G4Para&,const G4int,
0151                             const G4VPhysicalVolume*) const override {}
0152     void ComputeDimensions (G4Hype&,const G4int,
0153                             const G4VPhysicalVolume*) const override {}
0154     void ComputeDimensions (G4Tubs&,const G4int,
0155                             const G4VPhysicalVolume*) const override {}
0156     void ComputeDimensions (G4Polycone&,const G4int,
0157                             const G4VPhysicalVolume*) const override {}
0158     void ComputeDimensions (G4Polyhedra&,const G4int,
0159                             const G4VPhysicalVolume*) const override {}
0160 };
0161 
0162 /**
0163  * @brief G4ParameterisationTrdY represents the parameterised positioning
0164  * equivalent to dividing a G4Trd along Y axis.
0165  */
0166 
0167 class G4ParameterisationTrdY : public G4VParameterisationTrd
0168 { 
0169   public:
0170 
0171     /**
0172      * Initialises a parameterised Trd along Y axis.
0173      *  @param[in] axis The axis along which apply the parameterisation.
0174      *  @param[in] nCopies The total number of divided copies.
0175      *  @param[in] offset Potential initial offset along the axis.
0176      *  @param[in] step The width of the divided entity.
0177      *  @param[in] pSolid Pointer to the original shape to parameterise.
0178      *  @param[in] divType String identifier for the kind of division.
0179      */
0180     G4ParameterisationTrdY( EAxis axis, G4int nCopies,
0181                             G4double width, G4double offset,
0182                             G4VSolid* pSolid, DivisionType divType );
0183 
0184     /**
0185      * Default Destructor.
0186      */
0187    ~G4ParameterisationTrdY() override;
0188 
0189     /**
0190      * Returns the max width along Y.
0191      *  @returns The maximum width of the solid to divide along the Y axis.
0192      */
0193     G4double GetMaxParameter() const override;
0194 
0195     /**
0196      * Concrete methods implementing the parameterisation.
0197      */
0198     void ComputeTransformation(const G4int copyNo,
0199                                      G4VPhysicalVolume *physVol) const override;
0200     void ComputeDimensions(G4Trd& trd, const G4int copyNo,
0201                            const G4VPhysicalVolume* pv) const override;
0202     void ComputeDimensions (G4Trap&,const G4int,
0203                             const G4VPhysicalVolume*) const override;
0204 
0205   private:  // Dummy declarations to get rid of warnings ...
0206 
0207     void ComputeDimensions (G4Cons&,const G4int,
0208                             const G4VPhysicalVolume*) const override {}
0209     void ComputeDimensions (G4Box&,const G4int,
0210                             const G4VPhysicalVolume*) const override {}
0211     void ComputeDimensions (G4Sphere&,const G4int,
0212                             const G4VPhysicalVolume*) const override {}
0213     void ComputeDimensions (G4Orb&,const G4int,
0214                             const G4VPhysicalVolume*) const override {}
0215     void ComputeDimensions (G4Ellipsoid&,const G4int,
0216                             const G4VPhysicalVolume*) const override {}
0217     void ComputeDimensions (G4Torus&,const G4int,
0218                             const G4VPhysicalVolume*) const override {}
0219     void ComputeDimensions (G4Para&,const G4int,
0220                             const G4VPhysicalVolume*) const override {}
0221     void ComputeDimensions (G4Hype&,const G4int,
0222                             const G4VPhysicalVolume*) const override {}
0223     void ComputeDimensions (G4Tubs&,const G4int,
0224                             const G4VPhysicalVolume*) const override {}
0225     void ComputeDimensions (G4Polycone&,const G4int,
0226                             const G4VPhysicalVolume*) const override {}
0227     void ComputeDimensions (G4Polyhedra&,const G4int,
0228                             const G4VPhysicalVolume*) const override {}
0229 };
0230 
0231 /**
0232  * @brief G4ParameterisationTrdZ represents the parameterised positioning
0233  * equivalent to dividing a G4Trd along Z axis.
0234  */
0235 
0236 class G4ParameterisationTrdZ : public G4VParameterisationTrd
0237 { 
0238   public:
0239 
0240     /**
0241      * Initialises a parameterised Trd along Z axis.
0242      *  @param[in] axis The axis along which apply the parameterisation.
0243      *  @param[in] nCopies The total number of divided copies.
0244      *  @param[in] offset Potential initial offset along the axis.
0245      *  @param[in] step The width of the divided entity.
0246      *  @param[in] pSolid Pointer to the original shape to parameterise.
0247      *  @param[in] divType String identifier for the kind of division.
0248      */
0249     G4ParameterisationTrdZ( EAxis axis, G4int nCopies,
0250                             G4double width, G4double offset,
0251                             G4VSolid* pSolid, DivisionType divType );
0252 
0253     /**
0254      * Default Destructor.
0255      */
0256    ~G4ParameterisationTrdZ() override;
0257 
0258     /**
0259      * Returns the max width along Z.
0260      *  @returns The maximum width of the solid to divide along the Z axis.
0261      */
0262     G4double GetMaxParameter() const override;
0263 
0264     /**
0265      * Concrete methods implementing the parameterisation.
0266      */
0267     void ComputeTransformation(const G4int copyNo,
0268                                      G4VPhysicalVolume* physVol) const override;
0269     void ComputeDimensions(G4Trd& trd, const G4int copyNo,
0270                            const G4VPhysicalVolume* pv) const override;
0271 
0272   private:  // Dummy declarations to get rid of warnings ...
0273 
0274     void ComputeDimensions (G4Cons&,const G4int,
0275                             const G4VPhysicalVolume*) const override {}
0276     void ComputeDimensions (G4Box&,const G4int,
0277                             const G4VPhysicalVolume*) const override {}
0278     void ComputeDimensions (G4Sphere&,const G4int,
0279                             const G4VPhysicalVolume*) const override {}
0280     void ComputeDimensions (G4Orb&,const G4int,
0281                             const G4VPhysicalVolume*) const override {}
0282     void ComputeDimensions (G4Ellipsoid&,const G4int,
0283                             const G4VPhysicalVolume*) const override {}
0284     void ComputeDimensions (G4Torus&,const G4int,
0285                             const G4VPhysicalVolume*) const override {}
0286     void ComputeDimensions (G4Para&,const G4int,
0287                             const G4VPhysicalVolume*) const override {}
0288     void ComputeDimensions (G4Trap&,const G4int,
0289                             const G4VPhysicalVolume*) const override {}
0290     void ComputeDimensions (G4Hype&,const G4int,
0291                             const G4VPhysicalVolume*) const override {}
0292     void ComputeDimensions (G4Tubs&,const G4int,
0293                             const G4VPhysicalVolume*) const override {}
0294     void ComputeDimensions (G4Polycone&,const G4int,
0295                             const G4VPhysicalVolume*) const override {}
0296     void ComputeDimensions (G4Polyhedra&,const G4int,
0297                             const G4VPhysicalVolume*) const override {}
0298 };
0299 
0300 #endif