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

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

nvx fichiers dans CVS

File size: 5.3 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: excitationFunctionTest.cc,v 1.4 2007/06/21 15:04:30 gunter Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30// Test program for G4 Bertini Evaporation.
31
32#define G4VERBOSE 1
33
34#include "G4LayeredNucleus.hh"
35#include "G4BertiniEvaporation.hh"
36
37int main(int argc, char *argv[])
38{
39  G4LayeredNucleus nucl;
40  G4BertiniEvaporation bert;
41  G4VParticleChange * pc;
42  G4int A, Z;
43  G4double E;
44
45  G4int rounds;
46
47  if ( argc == 4 )
48    {
49      sscanf( argv[1], "%d", &A);
50      sscanf( argv[2], "%d", &Z);
51      sscanf( argv[3], "%d", &rounds);
52      G4cout << " % excitation function for " << A << " " << Z << " " << rounds << endl;
53    }
54 
55  else 
56    {
57      G4cout << "***************************" << endl
58             << "* Exc Fs for : n p pn 2n 2p p2n * " << endl
59             << "*  Parameters: A Z rounds  * " << endl
60             << "*  use 68 32 5000, takes  * " << endl
61             << "*  copper 63 (70%) -> zn 64,30 * " << endl
62             << "*  copper 65 (30%) -> zn 66,30 * " << endl
63             << "***************************" << endl << endl;
64      return 0 ;
65    } 
66
67  G4cout << "% n p pn 2n 2p p2n alfan * " << endl;
68
69  bert.setVerboseLevel(0);
70
71  G4int ntemp=0, ptemp=0, dtemp=0, ttemp=0, h3temp=0, h4temp=0, gtemp=0;
72 
73  for ( G4double energy = 1 ; energy < 100 ; energy += 0.5 )
74    {
75      G4int n=0, p=0, d=0, t=0, h3=0, h4=0, g=0, pn=0, _2n=0, _2p=0, p2n=0, alfan=0;
76      nucl.SetParameters( A, Z );
77      nucl.AddExcitationEnergy( energy - nucl.GetEnergyDeposit() );
78      n=p=d=t=h3=h4=g=0;
79
80      for ( G4int j = 0 ; j < rounds ; j++)
81        {
82          ntemp=ptemp=dtemp=ttemp=h3temp=h4temp=gtemp=0;
83          pc = bert.BreakItUp( nucl );
84         
85          for ( G4int i = 0 ; i < pc->GetNumberOfSecondaries() ;  i++ )
86            {
87              const char * name = pc->GetSecondary( i )->GetDefinition()->GetParticleName() ;
88              if ( strcmp ( name , "neutron" ) == 0 ) ntemp++;
89              else if ( strcmp ( name , "proton" ) == 0 ) ptemp++;
90              else if ( strcmp ( name , "deuteron" ) == 0 ) dtemp++;
91              else if ( strcmp ( name , "triton" ) == 0 ) ttemp++;
92              else if ( strcmp ( name , "He3" ) == 0 ) h3temp++;
93              else if ( strcmp ( name , "alpha" ) == 0 ) h4temp++;
94              else if ( strcmp ( name , "gamma" ) == 0 ) gtemp++;
95             
96              delete pc->GetSecondary( i );
97            } // loop over particle change vector
98
99//        G4cout << "a"
100//               << ntemp << " "
101//               << ptemp << " "
102//               << dtemp << " "
103//               << ttemp << " "
104//               << h3temp << " "
105//               << h4temp << " "
106//               << gtemp << " "
107//               << pc->GetNumberOfSecondaries() << endl;
108         
109//        if ( pc->GetNumberOfSecondaries() - g == 1 ) m1++;
110//        else if ( pc->GetNumberOfSecondaries() - g == 2 ) m2++;
111//        else if ( pc->GetNumberOfSecondaries() - g == 3 ) m3++;
112         
113          if ( ntemp == 1 && pc->GetNumberOfSecondaries() - gtemp == 1 ) n++;
114          if ( ptemp == 1 && pc->GetNumberOfSecondaries() - gtemp == 1 ) p++;
115          if ( ( ntemp == 1 && ptemp == 1 && pc->GetNumberOfSecondaries() - gtemp == 2 ) ||
116               ( dtemp == 1 && pc->GetNumberOfSecondaries() - gtemp == 1 ) ) pn++;
117          if ( ntemp == 2 && pc->GetNumberOfSecondaries() - gtemp == 2 ) _2n++;
118          if ( ptemp == 2 && pc->GetNumberOfSecondaries() - gtemp == 2 ) _2p++;
119          if ( ( ntemp == 2 && ptemp == 1 && pc->GetNumberOfSecondaries() - gtemp == 3 ) ||
120               ( dtemp == 1 && ntemp == 1 && pc->GetNumberOfSecondaries() - gtemp == 2 ) ) p2n++;
121          if ( ntemp == 1 && h4temp == 1 && pc->GetNumberOfSecondaries() - gtemp == 2 ) alfan++;
122          //x  G4cout << "% n p pn 2n 2p p2n * " << en
123          pc->Clear();
124          delete pc;
125     
126        }
127
128      G4cout << energy << "\t"
129             << n << " "
130             << p << " "
131             << pn << " "
132             << _2n << " "
133             << _2p << " "
134             << p2n << " "
135             << alfan << endl;
136          //         << g << endl;
137
138    } // energy loop
139 
140  return 0;
141}
Note: See TracBrowser for help on using the repository browser.