G4NeutronTrackingCut.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:   G4NeutronTrackingCut
00031 //
00032 // Author: Nov 2006 G.Folger
00033 //
00034 //
00035 //----------------------------------------------------------------------------
00036 //
00037 
00038 #include "G4NeutronTrackingCut.hh"
00039 
00040 #include "G4SystemOfUnits.hh"
00041 #include "G4ParticleDefinition.hh"
00042 #include "G4ProcessManager.hh"
00043 
00044 #include "G4Neutron.hh"
00045 #include "G4NeutronKiller.hh"
00046 
00047 // factory
00048 #include "G4PhysicsConstructorFactory.hh"
00049 //
00050 G4_DECLARE_PHYSCONSTR_FACTORY(G4NeutronTrackingCut);
00051 //
00052 
00053 G4NeutronTrackingCut::G4NeutronTrackingCut(G4int ver)
00054   :  G4VPhysicsConstructor("neutronTrackingCut")
00055    , verbose(ver), wasActivated(false)
00056 {
00057   timeLimit          = 10.*microsecond;
00058   kineticEnergyLimit = 0.0;
00059   pNeutronKiller     = 0;
00060 }
00061 
00062 G4NeutronTrackingCut::G4NeutronTrackingCut(const G4String& name, G4int ver)
00063   :  G4VPhysicsConstructor(name), verbose(ver), wasActivated(false)
00064 {
00065   timeLimit          = 10.*microsecond;
00066   kineticEnergyLimit = 0.0;
00067   pNeutronKiller     = 0;
00068 }
00069 
00070 G4NeutronTrackingCut::~G4NeutronTrackingCut()
00071 {
00072   delete pNeutronKiller;
00073 }
00074 
00075 void G4NeutronTrackingCut::ConstructParticle()
00076 {
00077   G4Neutron::NeutronDefinition();
00078 }
00079 
00080 void G4NeutronTrackingCut::ConstructProcess()
00081 {
00082   if(wasActivated) return;
00083   wasActivated = true;
00084 
00085   // Add Process
00086 
00087   pNeutronKiller = new G4NeutronKiller();
00088   G4ParticleDefinition * particle = G4Neutron::Neutron();
00089   G4ProcessManager * pmanager = particle->GetProcessManager();
00090 
00091   if(verbose > 0) {
00092     G4cout << "### Adding tracking cuts for " << particle->GetParticleName() 
00093            << "  TimeCut(ns)= " << timeLimit/ns 
00094            << "  KinEnergyCut(MeV)= " <<  kineticEnergyLimit/MeV
00095            <<  G4endl;
00096   }
00097   pmanager -> AddDiscreteProcess(pNeutronKiller);
00098   pNeutronKiller->SetKinEnergyLimit(kineticEnergyLimit);
00099   pNeutronKiller->SetTimeLimit(timeLimit);
00100 }
00101 
00102 

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