G4DecayPhysics.cc

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 // $Id$
00027 //
00028 //---------------------------------------------------------------------------
00029 //
00030 // ClassName:   G4DecayPhysics
00031 //
00032 // Author: 2002 J.P. Wellisch
00033 //
00034 // Modified:
00035 // 10.11.2005 V.Ivanchenko edit to provide a standard
00036 // 05.12.2005 V.Ivanchenko add controlled verbosity
00037 // 25.04.2006 V.Ivanchenko fix problem of destructor 
00038 //
00039 //----------------------------------------------------------------------------
00040 //
00041 
00042 #include "G4DecayPhysics.hh"
00043 
00044 #include "G4ParticleDefinition.hh"
00045 #include "G4ProcessManager.hh"
00046 
00047 #include "G4BosonConstructor.hh"
00048 #include "G4LeptonConstructor.hh"
00049 #include "G4MesonConstructor.hh"
00050 #include "G4BosonConstructor.hh"
00051 #include "G4BaryonConstructor.hh"
00052 #include "G4IonConstructor.hh"
00053 #include "G4ShortLivedConstructor.hh"
00054 
00055 // factory
00056 #include "G4PhysicsConstructorFactory.hh"
00057 //
00058 G4_DECLARE_PHYSCONSTR_FACTORY(G4DecayPhysics);
00059 
00060 G4DecayPhysics::G4DecayPhysics(G4int ver)
00061   :  G4VPhysicsConstructor("Decay"), verbose(ver), wasActivated(false)
00062 {
00063   fDecayProcess = 0;
00064 }
00065 
00066 G4DecayPhysics::G4DecayPhysics(const G4String& name, G4int ver)
00067   :  G4VPhysicsConstructor(name), verbose(ver), wasActivated(false)
00068 {
00069   fDecayProcess = 0;
00070 }
00071 
00072 G4DecayPhysics::~G4DecayPhysics()
00073 {
00074   delete fDecayProcess;
00075 }
00076 
00077 void G4DecayPhysics::ConstructParticle()
00078 {
00079 
00080 // G4cout << "G4DecayPhysics::ConstructParticle" << G4endl;
00081   G4BosonConstructor  pBosonConstructor;
00082   pBosonConstructor.ConstructParticle();
00083 
00084   G4LeptonConstructor pLeptonConstructor;
00085   pLeptonConstructor.ConstructParticle();
00086 
00087   G4MesonConstructor pMesonConstructor;
00088   pMesonConstructor.ConstructParticle();
00089 
00090   G4BaryonConstructor pBaryonConstructor;
00091   pBaryonConstructor.ConstructParticle();
00092 
00093   G4IonConstructor pIonConstructor;
00094   pIonConstructor.ConstructParticle();
00095 
00096   G4ShortLivedConstructor pShortLivedConstructor;
00097   pShortLivedConstructor.ConstructParticle();  
00098 }
00099 
00100 void G4DecayPhysics::ConstructProcess()
00101 {
00102   if(wasActivated) { return; }
00103   wasActivated = true;
00104 
00105   G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
00106 
00107   // Add Decay Process
00108   fDecayProcess = new G4Decay();
00109   theParticleIterator->reset();
00110   G4ParticleDefinition* particle=0;
00111 
00112   while( (*theParticleIterator)() )
00113   {
00114     particle = theParticleIterator->value();
00115     if( fDecayProcess->IsApplicable(*particle) ) 
00116     { 
00117       if(verbose > 1) {
00118         G4cout << "### Decays for " << particle->GetParticleName() << G4endl;
00119       }
00120       ph->RegisterProcess(fDecayProcess, particle);
00121     }
00122   }
00123 }

Generated on Mon May 27 17:48:00 2013 for Geant4 by  doxygen 1.4.7