Back to home page

EIC code displayed by LXR

 
 

    


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

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 // G4EnclosingCylinder
0027 //
0028 // Class description:
0029 //
0030 //   Definition of a utility class for quickly deciding if a point
0031 //   is clearly outside a polyhedra or polycone or deciding if
0032 //   a trajectory is clearly going to miss those shapes.
0033 
0034 // Author: David C. Williams (davidw@scipp.ucsc.edu)
0035 // --------------------------------------------------------------------
0036 #ifndef G4ENCLOSINGCYLINDER_HH
0037 #define G4ENCLOSINGCYLINDER_HH
0038 
0039 #include "G4Types.hh"
0040 #include "geomdefs.hh"
0041 #include "G4ThreeVector.hh"
0042 
0043 class G4ReduciblePolygon;
0044 
0045 class G4EnclosingCylinder
0046 {
0047   public:
0048 
0049     G4EnclosingCylinder( const G4ReduciblePolygon* rz,
0050                                G4bool phiIsOpen, 
0051                                G4double startPhi, G4double totalPhi );
0052     ~G4EnclosingCylinder() = default;
0053   
0054     G4bool MustBeOutside( const G4ThreeVector& p ) const;
0055       // Decide very rapidly if the point is outside the cylinder.
0056       // If one is not certain, return false.
0057 
0058     G4bool ShouldMiss( const G4ThreeVector& p, const G4ThreeVector& v ) const;
0059       // Decide very rapidly if the trajectory is going to miss the cylinder.
0060       // If one is not sure, return false.
0061 
0062     G4EnclosingCylinder(__void__&);
0063       // Fake default constructor for usage restricted to direct object
0064       // persistency for clients requiring preallocation of memory for
0065       // persistifiable objects.
0066 
0067   protected:
0068 
0069     G4double radius;    // radius of our cylinder
0070     G4double zLo, zHi;  // z extent
0071   
0072     G4bool    phiIsOpen; // true if there is a phi segment
0073     G4double  startPhi,  // for isPhiOpen==true, starting of phi segment
0074               totalPhi;  // for isPhiOpen==true, size of phi segment
0075 
0076     G4double rx1=0.0, ry1=0.0,
0077              dx1=0.0, dy1=0.0;
0078     G4double rx2=0.0, ry2=0.0,
0079              dx2=0.0, dy2=0.0;
0080      
0081     G4bool   concave;  // true, if x/y cross section is concave
0082 };
0083 
0084 #endif