source: trunk/source/physics_lists/builders/src/G4QStoppingPhysics.cc @ 1315

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

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 4.7 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: G4QStoppingPhysics.cc,v 1.5 2010/06/03 16:28:39 gunter Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
28//
29//---------------------------------------------------------------------------
30//
31// ClassName:   G4QStoppingPhysics
32//
33// Author: 11 April 2006 V. Ivanchenko
34//
35// Modified:
36//
37//----------------------------------------------------------------------------
38//
39
40#include "G4QStoppingPhysics.hh"
41
42#include "G4QCaptureAtRest.hh"
43
44#include "G4ParticleDefinition.hh"
45#include "G4ProcessManager.hh"
46
47#include "G4LeptonConstructor.hh"
48#include "G4MesonConstructor.hh"
49#include "G4BaryonConstructor.hh"
50#include "G4MuonMinus.hh"
51
52G4QStoppingPhysics::G4QStoppingPhysics(G4int ver)
53  :  G4VPhysicsConstructor("stopping"), verbose(ver), wasActivated(false) ,
54     useMuonMinusCaptureAtRest(true)
55{
56  if(verbose > 1) G4cout << "### G4QStoppingPhysics" << G4endl;
57}
58
59G4QStoppingPhysics::G4QStoppingPhysics(const G4String& name, G4int ver,
60                G4bool UseMuonMinusCapture)
61  :  G4VPhysicsConstructor(name), verbose(ver), wasActivated(false) ,
62     useMuonMinusCaptureAtRest(UseMuonMinusCapture)
63{
64  if(verbose > 1) G4cout << "### G4QStoppingPhysics" << G4endl;
65}
66
67G4QStoppingPhysics::~G4QStoppingPhysics()
68{
69  if(wasActivated) {
70    if ( muProcess ) delete muProcess;
71    delete hProcess;
72  }
73}
74
75void G4QStoppingPhysics::ConstructParticle()
76{
77// G4cout << "G4QStoppingPhysics::ConstructParticle" << G4endl;
78  G4LeptonConstructor pLeptonConstructor;
79  pLeptonConstructor.ConstructParticle();
80
81  G4MesonConstructor pMesonConstructor;
82  pMesonConstructor.ConstructParticle();
83
84  G4BaryonConstructor pBaryonConstructor;
85  pBaryonConstructor.ConstructParticle();
86
87}
88
89void G4QStoppingPhysics::ConstructProcess()
90{
91  if(verbose > 1) G4cout << "### G4QStoppingPhysics::ConstructProcess " 
92                          << wasActivated << G4endl;
93  if(wasActivated) return;
94  wasActivated = true;
95
96  if ( useMuonMinusCaptureAtRest )
97  {
98     muProcess = new G4MuonMinusCaptureAtRest();
99  } else {
100     muProcess = 0;
101  }   
102  hProcess = new G4QCaptureAtRest();
103
104  G4double mThreshold = 130.*MeV;
105
106  // Add Stopping Process
107  G4ParticleDefinition* particle=0;
108  G4ProcessManager* pmanager=0;
109
110  theParticleIterator->reset();
111  while( (*theParticleIterator)() )
112  {
113    particle = theParticleIterator->value();
114    pmanager = particle->GetProcessManager();
115    if(particle == G4MuonMinus::MuonMinus()) {
116      if ( useMuonMinusCaptureAtRest ) 
117      {
118         pmanager->AddRestProcess(muProcess);
119         if(verbose > 1)
120          G4cout << "### QStoppingPhysics added G4MuonMinusCaptureAtRest for " 
121                 << particle->GetParticleName() << G4endl;
122      } else {
123         pmanager->AddRestProcess(hProcess);
124         if(verbose > 1)
125          G4cout << "### QStoppingPhysics added G4QCaptureAtRest for " 
126                 << particle->GetParticleName() << G4endl;
127      } 
128    }
129    if(particle->GetPDGCharge() < 0.0 && 
130       particle->GetPDGMass() > mThreshold &&
131       !particle->IsShortLived() &&
132       hProcess->IsApplicable(*particle) ) 
133    { 
134      pmanager->AddRestProcess(hProcess);
135      if(verbose > 1)
136        G4cout << "### QStoppingPhysics added for " 
137               << particle->GetParticleName() << G4endl;
138    }
139  }
140}
141
142
Note: See TracBrowser for help on using the repository browser.