Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-03 09:08:46

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 // G4GeometryCellStep
0027 //
0028 // Class description:
0029 //
0030 // This class serves to address the "cell" a track previously touched
0031 // and a "cell" a track is currently in. It is used for scoring and
0032 // importance sampling in the "mass" geometry as well as in a "parallel"
0033 // geometry. 
0034 // The "cell" information is available with the GetPreGeometryCell() and 
0035 // the GetPostGeometryCell() functions.
0036 // The GetCrossBoundary() function returns true in case the step
0037 // crosses a boundary in the geometry this G4GeometryCellStep 
0038 // refers to.
0039 
0040 // Author: Michael Dressel (CERN), 2002
0041 // ----------------------------------------------------------------------
0042 #ifndef G4GEOMETRYCELLSTEP_HH
0043 #define G4GEOMETRYCELLSTEP_HH
0044 
0045 #include "G4GeometryCell.hh"
0046 
0047 /**
0048  * @brief G4GeometryCellStep serves to address the "cell" a track previously
0049  * touched and a "cell" a track is currently in. It is used for scoring and
0050  * importance sampling in the "mass" geometry as well as in a "parallel"
0051  * geometry.
0052  */
0053 
0054 class G4GeometryCellStep
0055 {
0056   public:
0057 
0058     /**
0059      * Constructor. Initialises pre and post G4GeometryCell.
0060      *  @param[in] preCell The previous cell.
0061      *  @param[in] postCell The next cell.
0062      */
0063     G4GeometryCellStep(const G4GeometryCell& preCell, 
0064                        const G4GeometryCell& postCell);
0065 
0066     /**
0067      * Default Destructor.
0068      */
0069     ~G4GeometryCellStep() = default;
0070 
0071     /**
0072      * Returns the "cell" the track previously touched.
0073      */
0074     inline const G4GeometryCell& GetPreGeometryCell() const; 
0075 
0076     /**
0077      * Returns the current "cell".
0078      */
0079     inline const G4GeometryCell& GetPostGeometryCell() const; 
0080 
0081     /**
0082      * Returns true if the step crosses boundary of the geometry it refers to.
0083      */
0084     inline G4bool GetCrossBoundary() const; 
0085 
0086     /**
0087      * Functions used by the scoring and importance system to set the cell
0088      * information.
0089      */
0090     inline void SetPreGeometryCell(const G4GeometryCell& preCell); 
0091     inline void SetPostGeometryCell(const G4GeometryCell& postCell);
0092     inline void SetCrossBoundary(G4bool b);
0093 
0094   private:
0095 
0096     G4GeometryCell fPreGeometryCell;
0097     G4GeometryCell fPostGeometryCell;  
0098     G4bool fCrossBoundary = false;
0099 };
0100 
0101 // Inline methods
0102 
0103 inline void
0104 G4GeometryCellStep::SetPreGeometryCell(const G4GeometryCell& preCell) 
0105 {
0106   fPreGeometryCell = preCell;
0107 }
0108 
0109 inline void
0110 G4GeometryCellStep::SetPostGeometryCell(const G4GeometryCell& postCell)  
0111 {
0112   fPostGeometryCell = postCell;
0113 }
0114   
0115 inline void
0116 G4GeometryCellStep::SetCrossBoundary(G4bool b) 
0117 {
0118   fCrossBoundary = b;
0119 }
0120 
0121 inline const G4GeometryCell&
0122 G4GeometryCellStep::GetPreGeometryCell() const 
0123 {
0124   return fPreGeometryCell;
0125 }
0126 
0127 inline const G4GeometryCell&
0128 G4GeometryCellStep::GetPostGeometryCell() const 
0129 {
0130   return fPostGeometryCell;
0131 }
0132   
0133 inline G4bool
0134 G4GeometryCellStep::GetCrossBoundary() const 
0135 {
0136   return fCrossBoundary;
0137 }
0138 
0139 #endif