G4QStoppingPhysics.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:   G4QStoppingPhysics
00031 //
00032 // Author: 11 April 2006 V. Ivanchenko
00033 //
00034 // Modified:
00035 // 20120921  M. Kelsey -- Replace G4MuonMinusCaptureAtRest with new
00036 //              G4MuonMinusCapture.
00037 //----------------------------------------------------------------------------
00038 //
00039 
00040 #include "G4QStoppingPhysics.hh"
00041 
00042 #include "G4SystemOfUnits.hh"
00043 #include "G4QCaptureAtRest.hh"
00044 #include "G4MuonMinusCaptureAtRest.hh"
00045 
00046 #include "G4ParticleDefinition.hh"
00047 #include "G4ProcessManager.hh"
00048 
00049 #include "G4LeptonConstructor.hh"
00050 #include "G4MesonConstructor.hh"
00051 #include "G4BaryonConstructor.hh"
00052 #include "G4MuonMinus.hh"
00053 #include "G4HadronicDeprecate.hh"
00054 
00055 
00056 G4QStoppingPhysics::G4QStoppingPhysics(G4int ver)
00057   :  G4VPhysicsConstructor("stopping")
00058     , muProcess(0), hProcess(0)
00059 , verbose(ver), wasActivated(false) ,
00060      useMuonMinusCapture(true)
00061 {
00062   G4HadronicDeprecate("G4QStoppingPhysics");
00063   if(verbose > 1) G4cout << "### G4QStoppingPhysics" << G4endl;
00064 }
00065 
00066 G4QStoppingPhysics::G4QStoppingPhysics(const G4String& name, G4int ver,
00067                 G4bool UseMuonMinusCapture)
00068   :  G4VPhysicsConstructor(name)
00069     , muProcess(0), hProcess(0)
00070     , verbose(ver), wasActivated(false) ,
00071      useMuonMinusCapture(UseMuonMinusCapture)
00072 {
00073   G4HadronicDeprecate("G4QStoppingPhysics");
00074   if(verbose > 1) G4cout << "### G4QStoppingPhysics" << G4endl;
00075 }
00076 
00077 G4QStoppingPhysics::~G4QStoppingPhysics()
00078 {
00079   if(wasActivated) {
00080     if ( muProcess ) delete muProcess;
00081     delete hProcess;
00082   }
00083 }
00084 
00085 void G4QStoppingPhysics::ConstructParticle()
00086 {
00087 // G4cout << "G4QStoppingPhysics::ConstructParticle" << G4endl;
00088   G4LeptonConstructor pLeptonConstructor;
00089   pLeptonConstructor.ConstructParticle();
00090 
00091   G4MesonConstructor pMesonConstructor;
00092   pMesonConstructor.ConstructParticle();
00093 
00094   G4BaryonConstructor pBaryonConstructor;
00095   pBaryonConstructor.ConstructParticle();
00096 
00097 }
00098 
00099 void G4QStoppingPhysics::ConstructProcess()
00100 {
00101   if(verbose > 1) G4cout << "### G4QStoppingPhysics::ConstructProcess " 
00102                           << wasActivated << G4endl;
00103   if(wasActivated) return;
00104   wasActivated = true;
00105 
00106   if ( useMuonMinusCapture )
00107   {
00108      muProcess = new G4MuonMinusCaptureAtRest();
00109   } else {
00110      muProcess = 0;
00111   }   
00112   hProcess = new G4QCaptureAtRest();
00113 
00114   G4double mThreshold = 130.*MeV;
00115 
00116   // Add Stopping Process
00117   G4ParticleDefinition* particle=0;
00118   G4ProcessManager* pmanager=0;
00119 
00120   theParticleIterator->reset();
00121   while( (*theParticleIterator)() )
00122   {
00123     particle = theParticleIterator->value();
00124     pmanager = particle->GetProcessManager();
00125     if(particle == G4MuonMinus::MuonMinus()) {
00126       if ( useMuonMinusCapture ) 
00127       {
00128          pmanager->AddRestProcess(muProcess);
00129          if(verbose > 1)
00130           G4cout << "### QStoppingPhysics added G4MuonMinusCaptureAtRest for " 
00131                  << particle->GetParticleName() << G4endl;
00132       } else {
00133          pmanager->AddRestProcess(hProcess);
00134          if(verbose > 1)
00135           G4cout << "### QStoppingPhysics added G4QCaptureAtRest for " 
00136                  << particle->GetParticleName() << G4endl;
00137       }  
00138     }
00139     if(particle->GetPDGCharge() < 0.0 && 
00140        particle->GetPDGMass() > mThreshold &&
00141        !particle->IsShortLived() &&
00142        hProcess->IsApplicable(*particle) ) 
00143     { 
00144       pmanager->AddRestProcess(hProcess);
00145       if(verbose > 1)
00146         G4cout << "### QStoppingPhysics added for " 
00147                << particle->GetParticleName() << G4endl;
00148     }
00149   }
00150 }
00151 
00152 

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