Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:20

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 // G4VDivisionParameterisation
0027 //
0028 // Class description:
0029 //
0030 // Base class for parameterisations defining divisions of volumes
0031 // for different kind of CSG and specific solids.
0032 
0033 // 09.05.01 - P.Arce, Initial version
0034 // 08.04.04 - I.Hrivnacova, Implemented reflection
0035 // 21.04.10 - M.Asai, Added gaps
0036 //---------------------------------------------------------------------
0037 #ifndef G4VDIVISIONPARAMETERISATION_HH
0038 #define G4VDIVISIONPARAMETERISATION_HH 1
0039 
0040 #include "G4Types.hh"
0041 #include "geomdefs.hh"
0042 #include "G4VPVParameterisation.hh"
0043 #include "G4RotationMatrix.hh"
0044 
0045 enum DivisionType { DivNDIVandWIDTH, DivNDIV, DivWIDTH };
0046 
0047 class G4VPhysicalVolume;
0048 class G4VSolid;
0049 
0050 class G4VDivisionParameterisation : public G4VPVParameterisation
0051 { 
0052   public:  // with description
0053   
0054     G4VDivisionParameterisation( EAxis axis, G4int nDiv, G4double width,
0055                                  G4double offset, DivisionType divType,
0056                                  G4VSolid* motherSolid = nullptr);
0057     ~G4VDivisionParameterisation() override;
0058   
0059     G4VSolid* ComputeSolid(const G4int, G4VPhysicalVolume*) override;
0060 
0061     void ComputeTransformation(const G4int copyNo,
0062                                        G4VPhysicalVolume *physVol) const override = 0;
0063   
0064     inline const G4String& GetType() const;
0065     inline EAxis GetAxis() const;
0066     inline G4int GetNoDiv() const;
0067     inline G4double GetWidth() const;
0068     inline G4double GetOffset() const;
0069     inline G4VSolid* GetMotherSolid() const;
0070     inline void SetType(const G4String& type);
0071     inline G4int VolumeFirstCopyNo() const;
0072     inline void SetHalfGap(G4double hg);
0073     inline G4double GetHalfGap() const;
0074 
0075   protected:  // with description
0076 
0077     void ChangeRotMatrix( G4VPhysicalVolume* physVol,
0078                           G4double rotZ = 0.0 ) const;
0079   
0080     G4int CalculateNDiv( G4double motherDim, G4double width,
0081                          G4double offset ) const;
0082     G4double CalculateWidth( G4double motherDim, G4int nDiv,
0083                              G4double offset ) const;
0084   
0085     virtual void CheckParametersValidity();
0086     void CheckOffset( G4double maxPar );
0087     void CheckNDivAndWidth( G4double maxPar );
0088     virtual G4double GetMaxParameter() const = 0;
0089     G4double OffsetZ() const;
0090 
0091   protected:
0092   
0093     G4String ftype;
0094     EAxis faxis;
0095     G4int fnDiv = 0;
0096     G4double fwidth = 0.0;
0097     G4double foffset = 0.0;
0098     DivisionType fDivisionType;
0099     G4VSolid* fmotherSolid = nullptr;
0100     G4bool fReflectedSolid = false;
0101     G4bool fDeleteSolid = false;
0102 
0103     static G4ThreadLocal G4RotationMatrix* fRot;
0104 
0105     static const G4int verbose;
0106     G4int theVoluFirstCopyNo = 1;
0107 
0108     G4double kCarTolerance;
0109 
0110     G4double fhgap = 0.0;
0111 };
0112 
0113 #include "G4VDivisionParameterisation.icc"
0114 
0115 #endif