G4fissionEvent.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 //
00027 // This software was developed by Lawrence Livermore National Laboratory.
00028 //
00029 // Redistribution and use in source and binary forms, with or without
00030 // modification, are permitted provided that the following conditions are met:
00031 //
00032 // 1. Redistributions of source code must retain the above copyright notice,
00033 //   this list of conditions and the following disclaimer.
00034 // 2. Redistributions in binary form must reproduce the above copyright notice,
00035 //   this list of conditions and the following disclaimer in the documentation
00036 //   and/or other materials provided with the distribution.
00037 // 3. The name of the author may not be used to endorse or promote products
00038 //   derived from this software without specific prior written permission.
00039 //
00040 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
00041 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00042 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
00043 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00044 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00045 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00046 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00047 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00048 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00049 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00050 //
00051 // Copyright (c) 2006 The Regents of the University of California.
00052 // All rights reserved.
00053 // UCRL-CODE-224807
00054 //
00055 // $Id: G4fissionEvent.cc 69860 2013-05-16 14:39:02Z gcosmo $
00056 //
00057 
00058 #include "G4fissionEvent.hh"
00059 
00060 G4int G4fissionEvent::delayoption=0;
00061 G4int G4fissionEvent::correlationoption=0;
00062 G4int G4fissionEvent::nudistoption=3;
00063 G4int G4fissionEvent::Cf252ndistoption=0;
00064 G4int G4fissionEvent::Cf252nengoption=0;
00065 
00066 G4fissionEvent::G4fissionEvent(G4int isotope, G4double time,
00067                                G4double nubar, G4double eng)
00068  :neutronNu(0), neutronEnergies(0), neutronVelocities(0), neutronDircosu(0),
00069   neutronDircosv(), neutronDircosw(), neutronAges(0),
00070   photonNu(0), photonEnergies(0), photonVelocities(0), photonDircosu(0),
00071   photonDircosv(0), photonDircosw(0), photonAges(0)
00072 {
00073    /*
00074     * Constructs a fission event with neutronNu neutrons and photonNu
00075     * photons.
00076     */
00077    G4int i;
00078 
00079    if (nubar == -1.) {
00080       /* spontaneous fission */
00081       neutronNu = G4SmpSpNuDistData(isotope, Cf252ndistoption);
00082       photonNu = G4SmpSpNugDistData(isotope);
00083    } else {
00084       /* induced fission */
00085       if (nudistoption == 0 || nudistoption == 1) {
00086          switch (isotope) {
00087             case 92235:
00088                neutronNu = G4SmpNuDistDataU235(eng,nudistoption);
00089                break;
00090             case 92238:
00091                neutronNu = G4SmpNuDistDataU238(eng);
00092                break;
00093             case 94239:
00094                neutronNu = G4SmpNuDistDataPu239(eng);
00095                break;
00096             default:
00097                neutronNu = (G4int) G4SmpTerrell(nubar);
00098                break;
00099          } 
00100       } else if (nudistoption == 2) {
00101          switch (isotope) {
00102             case 92232:
00103             case 92234:
00104             case 92236:
00105             case 92238:
00106                neutronNu = G4SmpNuDistDataU232_234_236_238(nubar);
00107                break;
00108             case 92233:
00109             case 92235:
00110                neutronNu = (G4int) G4SmpNuDistDataU233_235(nubar);
00111                break;
00112             case 94239:
00113             case 94241:
00114                neutronNu = G4SmpNuDistDataPu239_241(nubar);
00115                break;
00116             default:
00117                neutronNu = (G4int) G4SmpTerrell(nubar);
00118                break;
00119          }
00120       } else if (nudistoption == 3) {
00121          switch (isotope) {
00122             case 92232:
00123             case 92234:
00124             case 92236:
00125             case 92238:
00126                neutronNu = G4SmpNuDistDataU232_234_236_238_MC(nubar);
00127                break;
00128             case 92233:
00129             case 92235:
00130                neutronNu = (G4int) G4SmpNuDistDataU233_235_MC(nubar);
00131                break;
00132             case 94239:
00133             case 94241:
00134                neutronNu = G4SmpNuDistDataPu239_241_MC(nubar);
00135                break;
00136             default:
00137                neutronNu = (G4int) G4SmpTerrell(nubar);
00138                break;
00139          } 
00140       }
00141       photonNu = G4SmpNugDist(isotope, nubar);
00142    }
00143    if (neutronNu > 0) {
00144       neutronEnergies = new G4double[ neutronNu ];
00145       neutronVelocities = new G4double[ neutronNu ];
00146       neutronDircosu = new G4double[ neutronNu ];
00147       neutronDircosv = new G4double[ neutronNu ];
00148       neutronDircosw = new G4double[ neutronNu ];
00149       neutronAges = new G4double[neutronNu];
00150       for (i=0; i<neutronNu; i++) {
00151          if (isotope == 98252) neutronEnergies[i] = G4SmpNEngCf252(Cf252nengoption);
00152          else neutronEnergies[i] = G4SmpWatt(eng, isotope);
00153          neutronVelocities[i] = G4SmpNVel(
00154                  neutronEnergies[i],
00155                  &(neutronDircosu[i]),
00156                  &(neutronDircosv[i]),
00157                  &(neutronDircosw[i])
00158                 );
00159          neutronAges[i] = time;
00160       }
00161    }
00162    if (photonNu > 0) {
00163       photonEnergies = new G4double[photonNu];
00164       photonVelocities = new G4double[photonNu];
00165       photonDircosu = new G4double[photonNu];
00166       photonDircosv = new G4double[photonNu];
00167       photonDircosw = new G4double[photonNu];
00168       photonAges = new G4double[photonNu];
00169       for (i=0; i<photonNu; i++) {
00170          photonEnergies[i] = G4SmpGEng();
00171          photonVelocities[i] = G4SmpPVel(
00172                  photonEnergies[i],
00173                  &(photonDircosu[i]),
00174                  &(photonDircosv[i]),
00175                  &(photonDircosw[i])
00176                 );
00177          photonAges[i] = time;
00178       }
00179    }
00180 }
00181 
00182 G4fissionEvent::~G4fissionEvent() {
00183    if (neutronNu > 0) {
00184       delete [] neutronEnergies;
00185       delete [] neutronVelocities;
00186       delete [] neutronDircosu;
00187       delete [] neutronDircosv;
00188       delete [] neutronDircosw;
00189       delete [] neutronAges;
00190    }
00191 
00192    if (photonNu > 0) {
00193       delete [] photonEnergies;
00194       delete [] photonVelocities;
00195       delete [] photonDircosu;
00196       delete [] photonDircosv;
00197       delete [] photonDircosw;
00198       delete [] photonAges;
00199    }
00200 }

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