G4QCaptureAtRestPhysics.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:   G4QCaptureAtRestPhysics
00031 //
00032 // Author: 16 Nov 2009 M. Kosov
00033 //
00034 // Modified:
00035 //
00036 //----------------------------------------------------------------------------
00037 //
00038 
00039 #include "G4QCaptureAtRestPhysics.hh"
00040 
00041 G4QCaptureAtRestPhysics::G4QCaptureAtRestPhysics(G4int ver)
00042   :  G4VPhysicsConstructor("CHIPS nuclear_capture"), captureProcess(0)
00043    , verbose(ver), wasActivated(false)
00044 {
00045   if(verbose > 1) G4cout << "###> G4QCaptureAtRestPhysics is initialized" << G4endl;
00046 }
00047 
00048 G4QCaptureAtRestPhysics::G4QCaptureAtRestPhysics(const G4String& name, G4int ver)
00049   :  G4VPhysicsConstructor(name), captureProcess(0), verbose(ver), wasActivated(false)
00050 {
00051   if(verbose > 1) G4cout << "###> G4QCaptureAtRestPhysics is initialized" << G4endl;
00052 }
00053 
00054 G4QCaptureAtRestPhysics::~G4QCaptureAtRestPhysics()
00055 {
00056   if(wasActivated) delete captureProcess;
00057 }
00058 
00059 void G4QCaptureAtRestPhysics::ConstructParticle()
00060 {
00061 // G4cout << "G4QCaptureAtRestPhysics::ConstructParticle" << G4endl;
00062   G4LeptonConstructor pLeptonConstructor;
00063   pLeptonConstructor.ConstructParticle();
00064 
00065   G4MesonConstructor pMesonConstructor;
00066   pMesonConstructor.ConstructParticle();
00067 
00068   G4BaryonConstructor pBaryonConstructor;
00069   pBaryonConstructor.ConstructParticle();
00070 
00071 }
00072 
00073 void G4QCaptureAtRestPhysics::ConstructProcess()
00074 {
00075   if(verbose>1) G4cout<<"###> G4QCaptureAtRestPhysics::ConstructProcess: "<<wasActivated
00076                       <<G4endl;
00077   if(wasActivated) return;
00078   wasActivated = true;
00079   captureProcess = new G4QCaptureAtRest();
00080 
00081   // Add Stopping Process
00082   G4ParticleDefinition* particle=0;
00083   G4ProcessManager* pmanager=0;
00084 
00085   theParticleIterator->reset();
00086   while( (*theParticleIterator)() )
00087   {
00088     particle = theParticleIterator->value();
00089     pmanager = particle->GetProcessManager();
00090     if(particle->GetPDGCharge() < 0. && particle != G4Electron::Electron() &&
00091        !(particle->IsShortLived()) && captureProcess->IsApplicable(*particle) ) 
00092     { 
00093       pmanager->AddRestProcess(captureProcess);
00094       if(verbose > 1) G4cout << "###> G4QCaptureAtRestPhysics is added for " 
00095                              <<particle->GetParticleName() << G4endl;
00096     }
00097   }
00098 }
00099 
00100 

Generated on Mon May 27 17:49:31 2013 for Geant4 by  doxygen 1.4.7