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 // $Id: G4Scatterer.hh,v 1.5 2006-06-29 20:35:58 gunter Exp $ // 00027 // 00028 // 00029 // removing a auther spec that was part of a template. 00030 00031 #ifndef G4SCATTERER_HH 00032 #define G4SCATTERER_HH 00033 00034 #include "globals.hh" 00035 #include <vector> 00036 #include "G4VScatterer.hh" 00037 #include "G4VCollision.hh" 00038 #include "G4KineticTrackVector.hh" 00039 #include "G4CollisionVector.hh" 00040 #include "G4BCAction.hh" 00041 00042 class G4KineticTrack; 00043 00044 class G4Scatterer : public G4VScatterer, public G4BCAction 00045 { 00046 public: 00047 00048 G4Scatterer(); 00049 00050 virtual ~G4Scatterer(); 00051 00052 virtual G4double GetTimeToInteraction(const G4KineticTrack& trk1, 00053 const G4KineticTrack& trk2); 00054 00055 G4double GetCrossSection(const G4KineticTrack& trk1, 00056 const G4KineticTrack& trk2); 00057 00058 virtual G4KineticTrackVector* Scatter(const G4KineticTrack& trk1, 00059 const G4KineticTrack& trk2); 00060 00061 virtual const std::vector<G4CollisionInitialState *> & 00062 GetCollisions(G4KineticTrack * aProjectile, 00063 std::vector<G4KineticTrack *> & someCandidates, 00064 G4double aCurrentTime); 00065 00066 virtual G4KineticTrackVector * 00067 GetFinalState(G4KineticTrack * aProjectile, 00068 std::vector<G4KineticTrack *> & theTargets); 00069 00070 private: 00071 00072 G4VCollision* FindCollision(const G4KineticTrack& trk1, 00073 const G4KineticTrack& trk2); 00074 00075 struct Register 00076 { 00077 template<class T> void operator()(T*, G4CollisionVector * aC) 00078 { 00079 G4VCollision* aT = new T; 00080 aC->push_back(aT); 00081 } 00082 }; 00083 00084 G4CollisionVector collisions; 00085 std::vector<G4CollisionInitialState *> theCollisions; 00086 00087 }; 00088 #endif 00089 00090