source: trunk/source/physics_lists/builders/src/G4QCaptureAtRestPhysics.cc

Last change on this file was 1337, checked in by garnier, 15 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 3.8 KB
RevLine 
[1203]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//
[1315]26// $Id: G4QCaptureAtRestPhysics.cc,v 1.2 2010/06/03 15:03:53 gunter Exp $
[1337]27// GEANT4 tag $Name: geant4-09-04-beta-01 $
[1203]28//
29//---------------------------------------------------------------------------
30//
31// ClassName: G4QCaptureAtRestPhysics
32//
33// Author: 16 Nov 2009 M. Kosov
34//
35// Modified:
36//
37//----------------------------------------------------------------------------
38//
39
40#include "G4QCaptureAtRestPhysics.hh"
41
[1315]42G4QCaptureAtRestPhysics::G4QCaptureAtRestPhysics(G4int ver)
43 : G4VPhysicsConstructor("CHIPS nuclear_capture")
44 , verbose(ver), wasActivated(false)
45{
46 if(verbose > 1) G4cout << "###> G4QCaptureAtRestPhysics is initialized" << G4endl;
47}
48
[1203]49G4QCaptureAtRestPhysics::G4QCaptureAtRestPhysics(const G4String& name, G4int ver)
50 : G4VPhysicsConstructor(name), verbose(ver), wasActivated(false)
51{
52 if(verbose > 1) G4cout << "###> G4QCaptureAtRestPhysics is initialized" << G4endl;
53}
54
55G4QCaptureAtRestPhysics::~G4QCaptureAtRestPhysics()
56{
57 if(wasActivated) delete captureProcess;
58}
59
60void G4QCaptureAtRestPhysics::ConstructParticle()
61{
62// G4cout << "G4QCaptureAtRestPhysics::ConstructParticle" << G4endl;
63 G4LeptonConstructor pLeptonConstructor;
64 pLeptonConstructor.ConstructParticle();
65
66 G4MesonConstructor pMesonConstructor;
67 pMesonConstructor.ConstructParticle();
68
69 G4BaryonConstructor pBaryonConstructor;
70 pBaryonConstructor.ConstructParticle();
71
72}
73
74void G4QCaptureAtRestPhysics::ConstructProcess()
75{
76 if(verbose>1) G4cout<<"###> G4QCaptureAtRestPhysics::ConstructProcess: "<<wasActivated
77 <<G4endl;
78 if(wasActivated) return;
79 wasActivated = true;
80 captureProcess = new G4QCaptureAtRest();
81
82 // Add Stopping Process
83 G4ParticleDefinition* particle=0;
84 G4ProcessManager* pmanager=0;
85
86 theParticleIterator->reset();
87 while( (*theParticleIterator)() )
88 {
89 particle = theParticleIterator->value();
90 pmanager = particle->GetProcessManager();
91 if(particle->GetPDGCharge() < 0. && particle != G4Electron::Electron() &&
92 !(particle->IsShortLived()) && captureProcess->IsApplicable(*particle) )
93 {
94 pmanager->AddRestProcess(captureProcess);
95 if(verbose > 1) G4cout << "###> G4QCaptureAtRestPhysics is added for "
96 <<particle->GetParticleName() << G4endl;
97 }
98 }
99}
100
101
Note: See TracBrowser for help on using the repository browser.