00001 /* BDSIM code. Version 1.0 00002 Author: Grahame A. Blair, Royal Holloway, Univ. of London. 00003 Last modified 24.7.2002 00004 Copyright (c) 2002 by G.A.Blair. ALL RIGHTS RESERVED. 00005 */ 00006 #ifndef BDSLaserCompton_h 00007 #define BDSLaserCompton_h 1 00008 00009 #include "G4ios.hh" 00010 #include "globals.hh" 00011 #include "G4VDiscreteProcess.hh" 00012 #include "G4VPhysicsConstructor.hh" 00013 #include "G4Track.hh" 00014 #include "G4Step.hh" 00015 #include "G4Electron.hh" 00016 #include "G4Positron.hh" 00017 #include "BDSComptonEngine.hh" 00018 #include "BDSMaterials.hh" 00019 00020 00021 // flag initiated in BDSEventAction 00022 extern G4bool FireLaserCompton; 00023 00024 class BDSLaserCompton : public G4VDiscreteProcess 00025 { 00026 public: 00027 00028 BDSLaserCompton(const G4String& processName = "eLaser"); 00029 00030 ~BDSLaserCompton(); 00031 00032 G4bool IsApplicable(const G4ParticleDefinition&); 00033 00034 G4double GetMeanFreePath(const G4Track& track, 00035 G4double previousStepSize, 00036 G4ForceCondition* condition ); 00037 00038 G4VParticleChange *PostStepDoIt(const G4Track& track, 00039 const G4Step& step); 00040 00041 inline void SetLaserDirection(G4ThreeVector aDirection); 00042 inline G4ThreeVector GetLaserDirection(); 00043 00044 inline void SetLaserWavelength(G4double aWavelength); 00045 inline G4double GetLaserWavelength(); 00046 00047 protected: 00048 00049 G4double ComputeMeanFreePath( const G4ParticleDefinition* ParticleType, 00050 G4double KineticEnergy, 00051 const G4Material* aMaterial); 00052 00053 // virtual G4double SecondaryEnergyThreshold(size_t index); 00054 00055 private: 00056 00057 // assignment and copy constructor not implemented nor used 00058 BDSLaserCompton & operator=(const BDSLaserCompton &right); 00059 BDSLaserCompton(const BDSLaserCompton&); 00060 00061 // const std::vector<G4double>* secondaryEnergyCuts; 00062 00063 G4double itsLaserWavelength; 00064 G4ThreeVector itsLaserDirection; 00065 G4double itsLaserEnergy; 00066 BDSComptonEngine* itsComptonEngine; 00067 // G4Material* itsLastMaterial; 00068 00069 }; 00070 inline G4bool BDSLaserCompton::IsApplicable( 00071 const G4ParticleDefinition& particle) 00072 { 00073 return( (&particle == G4Electron::Electron()) 00074 ||(&particle == G4Positron::Positron()) ); 00075 } 00076 00077 inline G4double BDSLaserCompton::GetMeanFreePath(const G4Track& track, 00078 G4double /*PreviousStepSize*/, 00079 G4ForceCondition* ForceCondition) 00080 { 00081 if( track.GetMaterial()==BDSMaterials::Instance()->GetMaterial("LaserVac") && 00082 FireLaserCompton ) { 00083 *ForceCondition=Forced; 00084 } 00085 return DBL_MAX; 00086 } 00087 00088 00089 inline void BDSLaserCompton::SetLaserDirection(G4ThreeVector aDirection) 00090 {itsLaserDirection=aDirection;} 00091 00092 inline G4ThreeVector BDSLaserCompton::GetLaserDirection() 00093 {return itsLaserDirection;} 00094 00095 inline void BDSLaserCompton::SetLaserWavelength(G4double aWavelength) 00096 {itsLaserWavelength=aWavelength;} 00097 00098 inline G4double BDSLaserCompton::GetLaserWavelength() 00099 {return itsLaserWavelength;} 00100 00101 // inline G4double BDSLaserCompton::SecondaryEnergyThreshold(size_t index) 00102 // { 00103 // return (*secondaryEnergyCuts)[index]; 00104 // } 00105 00106 #endif