00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // -------------------------------------------------------------------- 00030 // GEANT 4 class header file 00031 // 00032 // G4GeomTestErrorList 00033 // 00034 // Class description: 00035 // 00036 // A list of line segments that are found inside two 00037 // separate daughter volumes, indicating a geometry error. 00038 // 00039 // This class relies on the compiler generated copy constructor 00040 // and assignment operator. 00041 00042 // Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu) 00043 // -------------------------------------------------------------------- 00044 #ifndef G4GeomTestErrorList_hh 00045 #define G4GeomTestErrorList_hh 00046 00047 #include <vector> 00048 00049 #include "G4Types.hh" 00050 #include "G4ThreeVector.hh" 00051 #include "G4RotationMatrix.hh" 00052 00053 class G4VPhysicalVolume; 00054 00055 class G4GeomTestErrorList 00056 { 00057 public: // with description 00058 00059 G4GeomTestErrorList( const G4VPhysicalVolume *theMother ); 00060 virtual ~G4GeomTestErrorList(); 00061 // Constructor and virtual destructor 00062 00063 void AddError( const G4ThreeVector &s1, const G4ThreeVector &s2 ); 00064 // Declare a new instance of an error, by specifying 00065 // two points in the coordinate system of the mother 00066 00067 const G4VPhysicalVolume *GetMother() const; 00068 // Return pointers to mother volume 00069 00070 G4int NumError() const; 00071 // Return number of errors 00072 00073 void GetMotherPoints( G4int i, G4ThreeVector &s1, G4ThreeVector &s2 ) const; 00074 void GetGlobalPoints( G4int i, G4ThreeVector &s1, G4ThreeVector &s2 ) const; 00075 // Return start and end points in various 00076 // coordinate systems 00077 00078 void GetOneDaughtPoints( const G4VPhysicalVolume *daught, 00079 G4int i, G4ThreeVector &s1, G4ThreeVector &s2 ) const; 00080 // Return start and end points in the coordinate system of a 00081 // daughter volume 00082 00083 private: 00084 00085 void FindGlobalCoordinateSystem(); 00086 // Calculate the global coordinate system 00087 00088 class Segment 00089 { 00090 public: 00091 Segment( const G4ThreeVector &as1, const G4ThreeVector &as2 ) 00092 : s1(as1), s2(as2) {;} 00093 00094 const G4ThreeVector &GetS1() const { return s1; } 00095 const G4ThreeVector &GetS2() const { return s2; } 00096 00097 private: 00098 G4ThreeVector s1, s2; 00099 }; 00100 std::vector<Segment> segments; 00101 // List of error segments 00102 00103 const G4VPhysicalVolume *mother; 00104 // Mother volume 00105 00106 G4ThreeVector globalTranslation; 00107 G4RotationMatrix globalRotation; 00108 // Global coordinate system with respect to mother 00109 }; 00110 00111 #endif