G4VTransitionRadiation.hh

Go to the documentation of this file.
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 // G4VTransitionRadiation  -- header file
00030 //
00031 // Generic process of transition radiation
00032 //
00033 // History:
00034 // 29.02.04, V.Ivanchenko created
00035 // 28.07.05, P.Gumplinger add G4ProcessType to constructor
00036 
00037 #ifndef G4VTransitionRadiation_h
00038 #define G4VTransitionRadiation_h
00039 
00040 
00041 #include "G4VDiscreteProcess.hh"
00042 #include "G4Track.hh"
00043 #include "G4ForceCondition.hh"
00044 #include "globals.hh"
00045 #include <vector>
00046 
00047 class G4Material;
00048 class G4Region;
00049 class G4VTRModel;
00050 class G4particleDefinition;
00051 
00052 class G4VTransitionRadiation : public   G4VDiscreteProcess
00053 {
00054 public:
00055 
00056 // Constructors
00057   G4VTransitionRadiation( const G4String& processName = "TR",
00058                                 G4ProcessType type = fElectromagnetic);
00059 
00060 
00061 // Destructor
00062   virtual ~G4VTransitionRadiation() ;
00063 
00064   virtual G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
00065 
00066   virtual G4double GetMeanFreePath(const G4Track& track, G4double,
00067                                          G4ForceCondition* condition);
00068 
00069   virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
00070                                           const G4Step& step);
00071 
00072   virtual void PrintInfoDefinition();
00073   // Print out of the class parameters
00074 
00075   void SetRegion(const G4Region* reg);
00076 
00077   void SetModel(G4VTRModel* m);
00078 
00079 // private :
00080 
00081   void Clear();
00082 
00083   // hide assignment operator
00084   G4VTransitionRadiation & operator=(const G4VTransitionRadiation &right);
00085   G4VTransitionRadiation(const G4VTransitionRadiation&);
00086 
00087   std::vector<const G4Material*>  materials;
00088   std::vector<G4double>           steps;
00089   std::vector<G4ThreeVector>      normals;
00090 
00091   G4ThreeVector     startingPosition;
00092   G4ThreeVector     startingDirection;
00093   const G4Region*   region;
00094   G4VTRModel*       model;
00095 
00096   G4int             nSteps;
00097 
00098   G4double          gammaMin;
00099   G4double          cosDThetaMax;
00100 
00101 };
00102 
00103 inline G4double G4VTransitionRadiation::GetMeanFreePath(
00104                                 const G4Track& track, G4double,
00105                                       G4ForceCondition* condition)
00106 {
00107   if(nSteps > 0) {
00108     *condition = StronglyForced;
00109   } else {
00110     *condition = NotForced;
00111     if(track.GetKineticEnergy()/track.GetDefinition()->GetPDGMass() + 1.0 > gammaMin &&
00112        track.GetVolume()->GetLogicalVolume()->GetRegion() == region) {
00113          *condition = StronglyForced;
00114     }
00115   }
00116   return DBL_MAX;      // so TR doesn't limit mean free path
00117 }
00118 
00119 
00120 #endif   // G4VTransitionRadiation_h

Generated on Mon May 27 17:50:23 2013 for Geant4 by  doxygen 1.4.7