G4QInelasticCHIPS_HPBuilder.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 // GEANT4 tag $Name: not supported by cvs2svn $
00027 //
00028 //---------------------------------------------------------------------------
00029 //
00030 // ClassName:   G4QInelasticCHIPS_HPBuilder
00031 //
00032 // Author: 2009 M. Kosov
00033 //
00034 //----------------------------------------------------------------------------
00035 //
00036 // Short comment: This is a physics list of only one model G4QInelastic for
00037 // all hadron-nuclear interactions at all energies + G4QNGamma for LE neutrons.
00038 // There are process-mixings (G4QProcessMixer) w/ HP processes at low (< 20 MeV)
00039 // energies with the G4QInelastic & G4QNGammafor neutrons, as CHIPS in G4 does
00040 // not include yet all precise LE nA inelastic processes. In this particular
00041 // builder the G4QInelastic process is attached to all hadrons + G4NGamma +
00042 // HP_fission (fission && NNGamma CHIPS processes to be added).
00043 //
00044 // -----------------------------------------------------------------------------
00045 
00046 //#define debug
00047 
00048 #include "G4QInelasticCHIPS_HPBuilder.hh"
00049 #include "G4SystemOfUnits.hh"
00050 
00051 G4QInelasticCHIPS_HPBuilder::G4QInelasticCHIPS_HPBuilder(G4int ver):
00052     verbose(ver)
00053     , wasActivated(false)
00054     , inelastic(0)
00055     , theInProcessMixer(0)
00056     , theNgProcessMixer(0)
00057     , theFiProcessMixer(0) 
00058     , theNeutronInelastic(0)
00059     , theNeutronFission(0)
00060     , theNeutronCapture(0)
00061     , theCHIPSInelastic(0)
00062     , theCHIPSNGamma(0)
00063     , theHPNeutron(0)
00064 {
00065   // pointer to the particle table
00066   theParticleTable = G4ParticleTable::GetParticleTable();
00067   theParticleIterator = theParticleTable->GetIterator();
00068 }
00069 
00070 G4QInelasticCHIPS_HPBuilder::~G4QInelasticCHIPS_HPBuilder()
00071 {
00072   if(wasActivated)
00073   {
00074     delete inelastic;
00075     delete theCHIPSInelastic;
00076     delete theCHIPSNGamma;
00077     //delete theCHIPSFission;
00078     delete theNeutronInelastic;
00079     delete theNeutronCapture;
00080     delete theNeutronFission;
00081     delete theHPNeutron;
00082     delete theInProcessMixer;
00083     delete theNgProcessMixer;
00084     delete theFiProcessMixer;
00085   }
00086 }
00087 
00088 void G4QInelasticCHIPS_HPBuilder::Build()
00089 {
00090   if(wasActivated) return;
00091   wasActivated = true;
00092   theParticleIterator->reset();
00093   inelastic = new G4QInelastic();
00094   while( (*theParticleIterator)() )
00095   {
00096     G4ParticleDefinition* particle = theParticleIterator->value();
00097     G4String pname = particle->GetParticleName();
00098     if(pname == "kaon-" || pname == "kaon+" || pname == "kaon0S"  ||  pname == "kaon0L" ||
00099        //pname == "pi-" || pname == "pi+"   || pname == "neutron" ||  pname == "proton" ||
00100        pname == "pi-"   || pname == "pi+"   ||  pname == "proton" ||
00101        pname == "lambda"       || pname == "sigma+"       || pname == "sigma0"       ||
00102        pname == "sigma-"       || pname == "xi0" || pname == "xi-" || pname == "omega-" ||
00103        pname == "anti_proton"  || pname == "anti_neutron" || pname == "anti_lambda"  ||
00104        pname == "anti_sigma+"  || pname == "anti_sigma0"  || pname == "anti_sigma-"  ||
00105        pname == "anti_xi0"     || pname == "anti_xi-"     || pname == "anti_omega-"  )
00106     {
00107       if(verbose>1)
00108         G4cout<< "__G4QInelCHIPS_HPBuilder: "<< pname <<" is defined here"<<G4endl;
00109       G4ProcessManager* pmanager = particle->GetProcessManager();
00110       pmanager->AddDiscreteProcess(inelastic);
00111       if(verbose>1)G4cout<<"###>G4QInelasticCHIPS_HPBuilder: "<<inelastic->GetProcessName()
00112                          <<" is added for "<<pname<<G4endl;
00113     }
00114     else if(pname == "neutron")
00115     {
00116       if(verbose>1)
00117         G4cout<< "__G4QInelCHIPS_HPBuilder: "<< pname <<" is defined here"<<G4endl;
00118       G4ProcessManager* pmanager = particle->GetProcessManager();
00119       // The model definition for neutrons (needed for HP implementation)
00120 #ifdef debug
00121         G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before NeutronBuild"<<G4endl;
00122 #endif
00123       theCHIPSInelastic   = new G4QInelastic();
00124       theCHIPSNGamma      = new G4QNGamma();
00125       //theCHIPSFission   = new G4QFission();
00126       theNeutronInelastic = new G4NeutronInelasticProcess();
00127       theNeutronCapture   = new G4HadronCaptureProcess();
00128       theNeutronFission   = new G4HadronFissionProcess();
00129       theInProcessMixer   = new G4QDiscProcessMixer("Mixed NeutronInelastic", particle);
00130       theNgProcessMixer   = new G4QDiscProcessMixer("Mixed NGamma", particle);
00131       theFiProcessMixer   = new G4QDiscProcessMixer("Mixed NFission", particle);
00132 #ifdef debug
00133         G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before Build HP processes"<<G4endl;
00134 #endif
00135       theHPNeutron = new G4NeutronHPBuilder;
00136       theHPNeutron->Build(theNeutronInelastic);
00137       theHPNeutron->Build(theNeutronCapture);
00138       theHPNeutron->Build(theNeutronFission);
00139 #ifdef debug
00140         G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before QIn="<<theCHIPSInelastic<<G4endl;
00141 #endif
00142       theInProcessMixer->AddDiscreteProcess(theCHIPSInelastic, 1.E8*megaelectronvolt);
00143 #ifdef debug
00144         G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: befr HPI="<<theNeutronInelastic<<G4endl;
00145 #endif
00146       theInProcessMixer->AddDiscreteProcess(theNeutronInelastic, 19.9*megaelectronvolt);
00147       
00148 #ifdef debug
00149         G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before QNG="<<theCHIPSNGamma<<G4endl;
00150 #endif
00151       theNgProcessMixer->AddDiscreteProcess(theCHIPSNGamma, 1.E8*megaelectronvolt);
00152 #ifdef debug
00153         G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before HPC="<<theNeutronCapture<<G4endl;
00154 #endif
00155       theNgProcessMixer->AddDiscreteProcess(theNeutronCapture, 19.9*megaelectronvolt);
00156       
00157       //theFiProcessMixer->AddDiscreteProcess(theCHIPSFission, 1.E8*megaelectronvolt);
00158       //theFiProcessMixer->AddDiscreteProcess(theNeutronFission, 19.9*megaelectronvolt);
00159       
00160 #ifdef debug
00161         G4cout<<"G4QInelasticCHIPS_HPBuilder::Build: before ProcessAdd"<<G4endl;
00162 #endif
00163       pmanager->AddDiscreteProcess(theInProcessMixer); // Mix CHIPS+HP for neutronInelastic
00164       if(verbose>1)
00165         G4cout<<"###>G4QInelasticCHIPS_HPBuilder: "<<theCHIPSInelastic->GetProcessName()
00166               <<" is added for "<<pname<<G4endl;
00167       pmanager->AddDiscreteProcess(theNgProcessMixer);  // Mix CHIPS+HP for (n,gamma)
00168       if(verbose>1)
00169         G4cout<<"###>G4QInelasticCHIPS_HPBuilder: "<<theCHIPSNGamma->GetProcessName()
00170               <<" is added for "<<pname<<G4endl;
00171       pmanager->AddDiscreteProcess(theNeutronFission); // Only HP for fission
00172       //pmanager->AddDiscreteProcess(theFiProcessMixer); // Mix CHIPS+HP for fission
00173       if(verbose>1)
00174         G4cout<<"###>G4QInelasticCHIPS_HPBuilder: "<<theNeutronFission->GetProcessName()
00175               <<" is added for "<<pname<<G4endl;
00176     }
00177   }
00178 }
00179 
00180 // 2012 by M. Kosov

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