source: trunk/source/physics_lists/builders/src/G4DecayPhysics.cc @ 1347

Last change on this file since 1347 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 4.1 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// $Id: G4DecayPhysics.cc,v 1.2 2010/06/03 14:37:24 gunter Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-01 $
28//
29//---------------------------------------------------------------------------
30//
31// ClassName:   G4DecayPhysics
32//
33// Author: 2002 J.P. Wellisch
34//
35// Modified:
36// 10.11.2005 V.Ivanchenko edit to provide a standard
37// 05.12.2005 V.Ivanchenko add controlled verbosity
38// 25.04.2006 V.Ivanchenko fix problem of destructor
39//
40//----------------------------------------------------------------------------
41//
42
43#include "G4DecayPhysics.hh"
44
45#include "G4ParticleDefinition.hh"
46#include "G4ProcessManager.hh"
47
48#include "G4BosonConstructor.hh"
49#include "G4LeptonConstructor.hh"
50#include "G4MesonConstructor.hh"
51#include "G4BosonConstructor.hh"
52#include "G4BaryonConstructor.hh"
53#include "G4IonConstructor.hh"
54#include "G4ShortLivedConstructor.hh"
55
56
57G4DecayPhysics::G4DecayPhysics(G4int ver)
58  :  G4VPhysicsConstructor("Decay"), verbose(ver), wasActivated(false)
59{}
60
61G4DecayPhysics::G4DecayPhysics(const G4String& name, G4int ver)
62  :  G4VPhysicsConstructor(name), verbose(ver), wasActivated(false)
63{}
64
65G4DecayPhysics::~G4DecayPhysics()
66{
67  if(wasActivated) delete fDecayProcess;
68}
69
70void G4DecayPhysics::ConstructParticle()
71{
72
73// G4cout << "G4DecayPhysics::ConstructParticle" << G4endl;
74  G4BosonConstructor  pBosonConstructor;
75  pBosonConstructor.ConstructParticle();
76
77  G4LeptonConstructor pLeptonConstructor;
78  pLeptonConstructor.ConstructParticle();
79
80  G4MesonConstructor pMesonConstructor;
81  pMesonConstructor.ConstructParticle();
82
83  G4BaryonConstructor pBaryonConstructor;
84  pBaryonConstructor.ConstructParticle();
85
86  G4IonConstructor pIonConstructor;
87  pIonConstructor.ConstructParticle();
88
89  G4ShortLivedConstructor pShortLivedConstructor;
90  pShortLivedConstructor.ConstructParticle(); 
91}
92
93void G4DecayPhysics::ConstructProcess()
94{
95  if(wasActivated) return;
96  wasActivated = true;
97
98  // Add Decay Process
99  fDecayProcess = new G4Decay();
100  theParticleIterator->reset();
101  G4ParticleDefinition* particle=0;
102  G4ProcessManager* pmanager=0;
103
104  while( (*theParticleIterator)() )
105  {
106    particle = theParticleIterator->value();
107    pmanager = particle->GetProcessManager();
108    if( fDecayProcess->IsApplicable(*particle) ) 
109    { 
110      if(verbose > 1)
111        G4cout << "### Decays for " << particle->GetParticleName() << G4endl;
112      pmanager -> AddProcess(fDecayProcess);
113      pmanager -> SetProcessOrdering(fDecayProcess, idxPostStep);
114      pmanager -> SetProcessOrdering(fDecayProcess, idxAtRest);
115    }
116  }
117}
118
119
Note: See TracBrowser for help on using the repository browser.