Back to home page

EIC code displayed by LXR

 
 

    


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

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 1
0044 
0045 #include "G4GeometryCell.hh"
0046 
0047 class G4GeometryCellStep
0048 {
0049   public: // with description
0050 
0051     G4GeometryCellStep(const G4GeometryCell& preCell, 
0052                        const G4GeometryCell& postCell);
0053       // initialise pre and post G4GeometryCell 
0054 
0055    ~G4GeometryCellStep();
0056 
0057     inline const G4GeometryCell& GetPreGeometryCell() const; 
0058       // addressing the  "cell" the track previously touched 
0059 
0060     inline const G4GeometryCell& GetPostGeometryCell() const; 
0061       // addressing the current "cell"  
0062 
0063     inline G4bool GetCrossBoundary() const; 
0064       // returns true if step crosses boundary of the geometry it refers to
0065 
0066     // the following functions are used by the scoring and importance
0067     // system to set the cell information.
0068     //
0069     inline void SetPreGeometryCell(const G4GeometryCell& preCell); 
0070     inline void SetPostGeometryCell(const G4GeometryCell& postCell);
0071     inline void SetCrossBoundary(G4bool b);
0072 
0073   private:
0074 
0075     G4GeometryCell fPreGeometryCell;
0076     G4GeometryCell fPostGeometryCell;  
0077     G4bool fCrossBoundary = false;
0078 };
0079 
0080 // Inline methods
0081 
0082 inline void
0083 G4GeometryCellStep::SetPreGeometryCell(const G4GeometryCell& preCell) 
0084 {
0085   fPreGeometryCell = preCell;
0086 }
0087 
0088 inline void
0089 G4GeometryCellStep::SetPostGeometryCell(const G4GeometryCell& postCell)  
0090 {
0091   fPostGeometryCell = postCell;
0092 }
0093   
0094 inline void
0095 G4GeometryCellStep::SetCrossBoundary(G4bool b) 
0096 {
0097   fCrossBoundary = b;
0098 }
0099 
0100 inline const G4GeometryCell&
0101 G4GeometryCellStep::GetPreGeometryCell() const 
0102 {
0103   return fPreGeometryCell;
0104 }
0105 
0106 inline const G4GeometryCell&
0107 G4GeometryCellStep::GetPostGeometryCell() const 
0108 {
0109   return fPostGeometryCell;
0110 }
0111   
0112 inline G4bool
0113 G4GeometryCellStep::GetCrossBoundary() const 
0114 {
0115   return fCrossBoundary;
0116 }
0117 
0118 #endif