G4ElectroNuclearBuilder.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:   G4ElectroNuclearBuilder
00031 //
00032 // Author: 2002 H.P. Wellisch
00033 //
00034 // Modified: 
00035 // 25.04.2006 V.Ivanchenko fix destructor 
00036 //
00037 //----------------------------------------------------------------------------
00038 //
00039 
00040 #include "G4ElectroNuclearBuilder.hh"
00041 
00042 #include "globals.hh"
00043 #include "G4ios.hh"
00044 #include "G4SystemOfUnits.hh"
00045 
00046 #include "G4ParticleDefinition.hh"
00047 #include "G4ParticleTable.hh"
00048 #include "G4Gamma.hh"
00049 #include "G4Electron.hh"
00050 #include "G4Positron.hh"
00051 #include "G4ProcessManager.hh"
00052 
00053 G4ElectroNuclearBuilder::G4ElectroNuclearBuilder() : 
00054     thePhotoNuclearProcess(0), theElectronNuclearProcess(0), 
00055     thePositronNuclearProcess(0), theElectroReaction(0), 
00056     theGammaReaction(0), theModel(0), theCascade(0), 
00057     theStringModel(0), theFragmentation(0), theStringDecay(0), 
00058    wasActivated(false)
00059 {
00060 }
00061 
00062 G4ElectroNuclearBuilder::~G4ElectroNuclearBuilder() 
00063 {
00064   if(wasActivated) {
00065     delete theFragmentation;
00066     delete theStringDecay;
00067     delete theStringModel;
00068     delete thePhotoNuclearProcess; 
00069     delete theElectronNuclearProcess;
00070     delete thePositronNuclearProcess;
00071     delete theElectroReaction;
00072     delete theGammaReaction;
00073     delete theModel;
00074     delete theCascade; 
00075   }
00076 }
00077 
00078 void G4ElectroNuclearBuilder::Build()
00079 {
00080   if(wasActivated) return;
00081   wasActivated=true;
00082   
00083   thePhotoNuclearProcess = new G4PhotoNuclearProcess;
00084   theElectronNuclearProcess = new G4ElectronNuclearProcess;
00085   thePositronNuclearProcess = new G4PositronNuclearProcess;
00086   theElectroReaction = new G4ElectroNuclearReaction;
00087   theGammaReaction = new G4GammaNuclearReaction;
00088 
00089   theModel = new G4TheoFSGenerator;
00090 
00091   theStringModel = new G4QGSModel< G4GammaParticipants >;
00092   theStringDecay = new G4ExcitedStringDecay(theFragmentation=new G4QGSMFragmentation);
00093   theStringModel->SetFragmentationModel(theStringDecay);
00094 
00095   theCascade = new G4GeneratorPrecompoundInterface;
00096 
00097   theModel->SetTransport(theCascade);
00098   theModel->SetHighEnergyGenerator(theStringModel);
00099 
00100   G4ProcessManager * aProcMan = 0;
00101   
00102   aProcMan = G4Gamma::Gamma()->GetProcessManager();
00103   theGammaReaction->SetMaxEnergy(3.5*GeV);
00104   thePhotoNuclearProcess->RegisterMe(theGammaReaction);
00105   theModel->SetMinEnergy(3.*GeV);
00106   theModel->SetMaxEnergy(100*TeV);
00107   thePhotoNuclearProcess->RegisterMe(theModel);
00108   aProcMan->AddDiscreteProcess(thePhotoNuclearProcess);
00109   
00110   aProcMan = G4Electron::Electron()->GetProcessManager();
00111   theElectronNuclearProcess->RegisterMe(theElectroReaction);
00112   aProcMan->AddDiscreteProcess(theElectronNuclearProcess);
00113   
00114   aProcMan = G4Positron::Positron()->GetProcessManager();
00115   thePositronNuclearProcess->RegisterMe(theElectroReaction);
00116   aProcMan->AddDiscreteProcess(thePositronNuclearProcess);
00117 }
00118 

Generated on Mon May 27 17:48:07 2013 for Geant4 by  doxygen 1.4.7