G4Cerenkov.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 // 
00031 // Cerenkov Radiation Class Definition 
00033 //
00034 // File:        G4Cerenkov.hh  
00035 // Description: Discrete Process - Generation of Cerenkov Photons
00036 // Version:     2.0
00037 // Created:     1996-02-21
00038 // Author:      Juliet Armstrong
00039 // Updated:     2007-09-30 change inheritance to G4VDiscreteProcess
00040 //              2005-07-28 add G4ProcessType to constructor
00041 //              1999-10-29 add method and class descriptors
00042 //              1997-04-09 by Peter Gumplinger
00043 //              > G4MaterialPropertiesTable; new physics/tracking scheme
00044 // mail:        gum@triumf.ca
00045 //
00047 
00048 #ifndef G4Cerenkov_h
00049 #define G4Cerenkov_h 1
00050 
00052 // Includes
00054 
00055 #include <CLHEP/Units/SystemOfUnits.h>
00056 
00057 #include "globals.hh"
00058 #include "templates.hh"
00059 #include "Randomize.hh"
00060 #include "G4ThreeVector.hh"
00061 #include "G4ParticleMomentum.hh"
00062 #include "G4Step.hh"
00063 #include "G4VProcess.hh"
00064 #include "G4OpticalPhoton.hh"
00065 #include "G4DynamicParticle.hh"
00066 #include "G4Material.hh" 
00067 #include "G4PhysicsTable.hh"
00068 #include "G4MaterialPropertyVector.hh"
00069 #include "G4MaterialPropertiesTable.hh"
00070 #include "G4PhysicsOrderedFreeVector.hh"
00071 
00072 // Class Description:
00073 // Discrete Process -- Generation of Cerenkov Photons.
00074 // Class inherits publicly from G4VDiscreteProcess.
00075 // Class Description - End:
00076 
00078 // Class Definition
00080 
00081 class G4Cerenkov : public G4VProcess
00082 {
00083 
00084 public:
00085 
00087         // Constructors and Destructor
00089 
00090         G4Cerenkov(const G4String& processName = "Cerenkov", 
00091                             G4ProcessType type = fElectromagnetic);
00092         ~G4Cerenkov();
00093 
00094         G4Cerenkov(const G4Cerenkov &right);
00095 
00096 private:
00097 
00099         // Operators
00101 
00102         G4Cerenkov& operator=(const G4Cerenkov &right);
00103 
00104 public:
00105 
00107         // Methods
00109 
00110         G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
00111         // Returns true -> 'is applicable', for all charged particles
00112         // except short-lived particles.
00113 
00114         G4double GetMeanFreePath(const G4Track& aTrack,
00115                                  G4double ,
00116                                  G4ForceCondition* );
00117         // Returns the discrete step limit and sets the 'StronglyForced'
00118         // condition for the DoIt to be invoked at every step.
00119 
00120         G4double PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
00121                                                       G4double ,
00122                                                       G4ForceCondition* );
00123         // Returns the discrete step limit and sets the 'StronglyForced'
00124         // condition for the DoIt to be invoked at every step.
00125 
00126         G4VParticleChange* PostStepDoIt(const G4Track& aTrack, 
00127                                         const G4Step&  aStep);
00128         // This is the method implementing the Cerenkov process.
00129 
00130         //  no operation in  AtRestDoIt and  AlongStepDoIt
00131         virtual G4double AlongStepGetPhysicalInteractionLength(
00132                                const G4Track&,
00133                                G4double  ,
00134                                G4double  ,
00135                                G4double& ,
00136                                G4GPILSelection*
00137                               ) { return -1.0; };
00138 
00139         virtual G4double AtRestGetPhysicalInteractionLength(
00140                                const G4Track& ,
00141                                G4ForceCondition*
00142                               ) { return -1.0; };
00143 
00144         //  no operation in  AtRestDoIt and  AlongStepDoIt
00145         virtual G4VParticleChange* AtRestDoIt(
00146                                const G4Track& ,
00147                                const G4Step&
00148                               ) {return 0;};
00149 
00150         virtual G4VParticleChange* AlongStepDoIt(
00151                                const G4Track& ,
00152                                const G4Step&
00153                               ) {return 0;};
00154 
00155         void SetTrackSecondariesFirst(const G4bool state);
00156         // If set, the primary particle tracking is interrupted and any 
00157         // produced Cerenkov photons are tracked next. When all have 
00158         // been tracked, the tracking of the primary resumes. 
00159         
00160         void SetMaxBetaChangePerStep(const G4double d);
00161         // Set the maximum allowed change in beta = v/c in % (perCent)
00162         // per step.
00163 
00164         void SetMaxNumPhotonsPerStep(const G4int NumPhotons);
00165         // Set the maximum number of Cerenkov photons allowed to be 
00166         // generated during a tracking step. This is an average ONLY; 
00167         // the actual number will vary around this average. If invoked, 
00168         // the maximum photon stack will roughly be of the size set.
00169         // If not called, the step is not limited by the number of 
00170         // photons generated.
00171 
00172         G4PhysicsTable* GetPhysicsTable() const;
00173         // Returns the address of the physics table.
00174 
00175         void DumpPhysicsTable() const;
00176         // Prints the physics table.
00177 
00178 private:
00179 
00180         void BuildThePhysicsTable();
00181 
00183         // Helper Functions
00185 
00186         G4double GetAverageNumberOfPhotons(const G4double charge,
00187                                 const G4double beta,
00188                                 const G4Material *aMaterial,
00189                                 G4MaterialPropertyVector* Rindex) const;
00190 
00192         // Class Data Members
00194 
00195 protected:
00196 
00197         G4PhysicsTable* thePhysicsTable;
00198         //  A Physics Table can be either a cross-sections table or
00199         //  an energy table (or can be used for other specific
00200         //  purposes).
00201 
00202 private:
00203 
00204         G4bool fTrackSecondariesFirst;
00205         G4double fMaxBetaChange;
00206         G4int  fMaxPhotons;
00207 };
00208 
00210 // Inline methods
00212 
00213 inline 
00214 G4bool G4Cerenkov::IsApplicable(const G4ParticleDefinition& aParticleType)
00215 {
00216    if (aParticleType.GetParticleName() == "chargedgeantino") return false;
00217    if (aParticleType.IsShortLived()) return false;
00218 
00219    return (aParticleType.GetPDGCharge() != 0);
00220 }
00221 
00222 inline 
00223 void G4Cerenkov::SetTrackSecondariesFirst(const G4bool state) 
00224 { 
00225         fTrackSecondariesFirst = state;
00226 }
00227 
00228 inline
00229 void G4Cerenkov::SetMaxBetaChangePerStep(const G4double value)
00230 {
00231         fMaxBetaChange = value*CLHEP::perCent;
00232 }
00233 
00234 inline
00235 void G4Cerenkov::SetMaxNumPhotonsPerStep(const G4int NumPhotons) 
00236 { 
00237         fMaxPhotons = NumPhotons;
00238 }
00239 
00240 inline
00241 void G4Cerenkov::DumpPhysicsTable() const
00242 {
00243         G4int PhysicsTableSize = thePhysicsTable->entries();
00244         G4PhysicsOrderedFreeVector *v;
00245 
00246         for (G4int i = 0 ; i < PhysicsTableSize ; i++ )
00247         {
00248                 v = (G4PhysicsOrderedFreeVector*)(*thePhysicsTable)[i];
00249                 v->DumpValues();
00250         }
00251 }
00252 
00253 inline
00254 G4PhysicsTable* G4Cerenkov::GetPhysicsTable() const
00255 {
00256   return thePhysicsTable;
00257 }
00258 
00259 #endif /* G4Cerenkov_h */

Generated on Mon May 27 17:47:51 2013 for Geant4 by  doxygen 1.4.7