| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DsG4Cerenkov.h

Go to the documentation of this file.
00001 
00023 //
00024 // ********************************************************************
00025 // * License and Disclaimer                                           *
00026 // *                                                                  *
00027 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00028 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00029 // * conditions of the Geant4 Software License,  included in the file *
00030 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00031 // * include a list of copyright holders.                             *
00032 // *                                                                  *
00033 // * Neither the authors of this software system, nor their employing *
00034 // * institutes,nor the agencies providing financial support for this *
00035 // * work  make  any representation or  warranty, express or implied, *
00036 // * regarding  this  software system or assume any liability for its *
00037 // * use.  Please see the license in the file  LICENSE  and URL above *
00038 // * for the full disclaimer and the limitation of liability.         *
00039 // *                                                                  *
00040 // * This  code  implementation is the result of  the  scientific and *
00041 // * technical work of the GEANT4 collaboration.                      *
00042 // * By using,  copying,  modifying or  distributing the software (or *
00043 // * any work based  on the software)  you  agree  to acknowledge its *
00044 // * use  in  resulting  scientific  publications,  and indicate your *
00045 // * acceptance of all terms of the Geant4 Software license.          *
00046 // ********************************************************************
00047 //
00048 //
00049 // $Id: G4Cerenkov.hh,v 1.10 2008/10/22 01:17:36 gum Exp $
00050 // GEANT4 tag $Name: geant4-09-02 $
00051 //
00052 // 
00054 // Cerenkov Radiation Class Definition 
00056 //
00057 // File:        G4Cerenkov.hh  
00058 // Description: Discrete Process - Generation of Cerenkov Photons
00059 // Version:     2.0
00060 // Created:     1996-02-21
00061 // Author:      Juliet Armstrong
00062 // Updated:     2007-09-30 change inheritance to G4VDiscreteProcess
00063 //              2005-07-28 add G4ProcessType to constructor
00064 //              1999-10-29 add method and class descriptors
00065 //              1997-04-09 by Peter Gumplinger
00066 //              > G4MaterialPropertiesTable; new physics/tracking scheme
00067 // mail:        gum@triumf.ca
00068 //
00070 
00071 #ifndef DsG4Cerenkov_h
00072 #define DsG4Cerenkov_h 1
00073 
00075 // Includes
00077 
00078 #include "globals.hh"
00079 #include "templates.hh"
00080 #include "Randomize.hh"
00081 #include "G4ThreeVector.hh"
00082 #include "G4ParticleMomentum.hh"
00083 #include "G4Step.hh"
00084 #include "G4VProcess.hh"
00085 #include "G4OpticalPhoton.hh"
00086 #include "G4DynamicParticle.hh"
00087 #include "G4Material.hh" 
00088 #include "G4PhysicsTable.hh"
00089 #include "G4MaterialPropertiesTable.hh"
00090 #include "G4PhysicsOrderedFreeVector.hh"
00091 
00092 // Class Description:
00093 // Discrete Process -- Generation of Cerenkov Photons.
00094 // Class inherits publicly from G4VDiscreteProcess.
00095 // Class Description - End:
00096 
00098 // Class Definition
00100 
00101 class DsG4Cerenkov : public G4VProcess
00102 {
00103 
00104 private:
00105 
00107         // Operators
00109 
00110         // G4Cerenkov& operator=(const G4Cerenkov &right);
00111 
00112 public: // Without description
00113 
00115         // Constructors and Destructor
00117 
00118         DsG4Cerenkov(const G4String& processName = "Cerenkov", 
00119                             G4ProcessType type = fElectromagnetic);
00120 
00121         // G4Cerenkov(const G4Cerenkov &right);
00122 
00123         ~DsG4Cerenkov();        
00124 
00126         // Methods
00128 
00129 public: // With description
00130 
00131         G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
00132         // Returns true -> 'is applicable', for all charged particles.
00133 
00134         G4double GetMeanFreePath(const G4Track& aTrack,
00135                                  G4double ,
00136                                  G4ForceCondition* );
00137         // Returns the discrete step limit and sets the 'StronglyForced'
00138         // condition for the DoIt to be invoked at every step.
00139 
00140         G4double PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
00141                                                       G4double ,
00142                                                       G4ForceCondition* );
00143         // Returns the discrete step limit and sets the 'StronglyForced'
00144         // condition for the DoIt to be invoked at every step.
00145 
00146         G4VParticleChange* PostStepDoIt(const G4Track& aTrack, 
00147                                         const G4Step&  aStep);
00148         // This is the method implementing the Cerenkov process.
00149 
00150         //  no operation in  AtRestDoIt and  AlongStepDoIt
00151         virtual G4double AlongStepGetPhysicalInteractionLength(
00152                                const G4Track&,
00153                                G4double  ,
00154                                G4double  ,
00155                                G4double& ,
00156                                G4GPILSelection*
00157                               ) { return -1.0; };
00158 
00159         virtual G4double AtRestGetPhysicalInteractionLength(
00160                                const G4Track& ,
00161                                G4ForceCondition*
00162                               ) { return -1.0; };
00163 
00164         //  no operation in  AtRestDoIt and  AlongStepDoIt
00165         virtual G4VParticleChange* AtRestDoIt(
00166                                const G4Track& ,
00167                                const G4Step&
00168                               ) {return 0;};
00169 
00170         virtual G4VParticleChange* AlongStepDoIt(
00171                                const G4Track& ,
00172                                const G4Step&
00173                               ) {return 0;};
00174 
00175         void SetTrackSecondariesFirst(const G4bool state);
00176         // If set, the primary particle tracking is interrupted and any 
00177         // produced Cerenkov photons are tracked next. When all have 
00178         // been tracked, the tracking of the primary resumes. 
00179         
00180         void SetMaxBetaChangePerStep(const G4double d);
00181         // Set the maximum allowed change in beta = v/c in % (perCent)
00182         // per step.
00183 
00184         void SetMaxNumPhotonsPerStep(const G4int NumPhotons);
00185         // Set the maximum number of Cerenkov photons allowed to be 
00186         // generated during a tracking step. This is an average ONLY; 
00187         // the actual number will vary around this average. If invoked, 
00188         // the maximum photon stack will roughly be of the size set.
00189         // If not called, the step is not limited by the number of 
00190         // photons generated.
00191 
00192         G4PhysicsTable* GetPhysicsTable() const;
00193         // Returns the address of the physics table.
00194 
00195         void DumpPhysicsTable() const;
00196         // Prints the physics table.
00197 
00198         G4double GetPhotonWeight() const { return fPhotonWeight; }
00199         void SetPhotonWeight(G4double weight) { fPhotonWeight = weight; }
00200         
00201         G4bool GetApplyPreQE() const { return fApplyPreQE; }
00202         void SetApplyPreQE(G4bool a) { fApplyPreQE = a; }
00203 
00204         G4double GetPreQE() const { return fPreQE; }
00205         void SetPreQE(G4double a) { fPreQE = a; }
00206         
00207 private:
00208 
00209         void BuildThePhysicsTable();
00210 
00212         // Helper Functions
00214 
00215         G4double GetAverageNumberOfPhotons(const G4double charge,
00216                                            const G4double beta,
00217                                            const G4Material *aMaterial,
00218                                            const G4MaterialPropertyVector* Rindex) const;
00219 
00221         // Class Data Members
00223 
00224 protected:
00225 
00226         G4PhysicsTable* thePhysicsTable;
00227         //  A Physics Table can be either a cross-sections table or
00228         //  an energy table (or can be used for other specific
00229         //  purposes).
00230 
00231 private:
00232 
00233         G4bool fTrackSecondariesFirst;
00234         G4double fMaxBetaChange;
00235         G4int  fMaxPhotons;
00236     G4double fPhotonWeight;
00237     G4bool   fApplyPreQE;
00238     G4double fPreQE;
00239 };
00240 
00242 // Inline methods
00244 
00245 inline 
00246 G4bool DsG4Cerenkov::IsApplicable(const G4ParticleDefinition& aParticleType)
00247 {
00248    if (aParticleType.GetParticleName() != "chargedgeantino" ) {
00249       return (aParticleType.GetPDGCharge() != 0);
00250    } else {
00251       return false;
00252    }
00253 }
00254 
00255 inline 
00256 void DsG4Cerenkov::SetTrackSecondariesFirst(const G4bool state) 
00257 { 
00258         fTrackSecondariesFirst = state;
00259 }
00260 
00261 inline
00262 void DsG4Cerenkov::SetMaxBetaChangePerStep(const G4double value)
00263 {
00264         fMaxBetaChange = value*perCent;
00265 }
00266 
00267 inline
00268 void DsG4Cerenkov::SetMaxNumPhotonsPerStep(const G4int NumPhotons) 
00269 { 
00270         fMaxPhotons = NumPhotons;
00271 }
00272 
00273 inline
00274 void DsG4Cerenkov::DumpPhysicsTable() const
00275 {
00276         G4int PhysicsTableSize = thePhysicsTable->entries();
00277         G4PhysicsOrderedFreeVector *v;
00278 
00279         for (G4int i = 0 ; i < PhysicsTableSize ; i++ )
00280         {
00281                 v = (G4PhysicsOrderedFreeVector*)(*thePhysicsTable)[i];
00282                 v->DumpValues();
00283         }
00284 }
00285 
00286 inline
00287 G4PhysicsTable* DsG4Cerenkov::GetPhysicsTable() const
00288 {
00289   return thePhysicsTable;
00290 }
00291 
00292 #endif /* DsG4Cerenkov_h */
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:53:23 2011 for DetSim by doxygen 1.4.7