Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 09:11:00

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