source: trunk/source/processes/hadronic/models/cascade/evaporation/test/generalTest.cc @ 1334

Last change on this file since 1334 was 1199, checked in by garnier, 15 years ago

nvx fichiers dans CVS

File size: 3.4 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: generalTest.cc,v 1.4 2007/06/21 15:04:32 gunter Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30// Test program for G4 Bertini Evaporation.
31
32#include "G4LayeredNucleus.hh"
33#include "G4BertiniEvaporation.hh"
34
35int main(int argc, char *argv[])
36{
37  G4LayeredNucleus nucl;
38  G4BertiniEvaporation bert;
39  G4VParticleChange * pc;
40  G4int A, Z;
41  G4double E;
42
43
44  G4cout << "Parameters " << argc-1 << endl;
45
46  if ( argc == 4 )
47    {
48      sscanf( argv[1], "%d", &A);
49      sscanf( argv[2], "%d", &Z);
50      sscanf( argv[3], "%lf", &E);
51      G4cout << A << " " << Z << " " << E << endl;
52      nucl.SetParameters( A, Z);
53      nucl.AddExcitationEnergy( E );
54    }
55
56  bert.setVerboseLevel(0);
57 
58  for ( G4double energy = 1 ; energy < 150 ; energy += 0.5 )
59    {
60      G4int n=0, p=0, d=0, t=0, h3=0, h4=0, g=0;
61
62      nucl.SetParameters( A, Z);
63      nucl.AddExcitationEnergy( E - nucl.GetEnergyDeposit() );
64
65      pc = bert.BreakItUp( nucl );
66
67      for ( G4int i = 0 ; i < pc->GetNumberOfSecondaries() ;  i++ )
68        {
69          char * name = pc->GetSecondary( i )->GetDefinition()->GetParticleName() ;
70          if ( strcmp ( name , "proton" ) == 0 ) p++;
71          if ( strcmp ( name , "neutron" ) == 0 ) n++;
72          if ( strcmp ( name , "deuteron" ) == 0 ) d++;
73          if ( strcmp ( name , "triton" ) == 0 ) t++;
74          if ( strcmp ( name , "He3" ) == 0 ) h3++;
75          if ( strcmp ( name , "alpha" ) == 0 ) h4++;
76          if ( strcmp ( name , "gamma" ) == 0 ) g++;
77        } // loop over particle change vector
78
79      G4cout << energy << "\t"
80             << n << " "
81             << p << " "
82             << d << " "
83             << t << " "
84             << h3 << " "
85             << h4 << " "
86             << g << endl;
87     
88    } // energy loop
89 
90  return 0;
91}
92
93
94
95//G4cout << energy << " " << pc->GetSecondary( i )->GetDefinition()->GetParticleName() << endl;
Note: See TracBrowser for help on using the repository browser.