source: trunk/source/processes/hadronic/models/cascade/evaporation/test/multiplicityTest.cc @ 1199

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

nvx fichiers dans CVS

File size: 3.5 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: multiplicityTest.cc,v 1.4 2007/06/21 15:04:34 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 << A << " " << Z << " " << rounds << endl;
53    }
54 
55  else 
56    {
57      G4cout << "***************************" << endl
58             << "*  Parameters: A Z rounds  * " << endl
59             << "*  use 68 32 5000, takes  * " << endl
60             << "***************************" << endl << endl;
61      return 0 ;
62    } 
63
64  bert.setVerboseLevel(0);
65 
66  for ( G4double energy = 1 ; energy < 150 ; energy += 0.5 )
67    {
68      G4int n=0, p=0, d=0, t=0, h3=0, h4=0, g=0;
69      G4int m1=0, m2=0, m3=0;
70
71      nucl.SetParameters( A, Z );
72      nucl.AddExcitationEnergy( energy - nucl.GetEnergyDeposit() );
73
74      for ( G4int j = 0 ; j < rounds ; j++)
75        {
76          n=p=d=t=h3=h4=g=0;
77          pc = bert.BreakItUp( nucl );
78         
79          for ( G4int i = 0 ; i < pc->GetNumberOfSecondaries() ;  i++ )
80            {
81              char * name = pc->GetSecondary( i )->GetDefinition()->GetParticleName() ;
82              if ( strcmp ( name , "gamma" ) == 0 ) g++;
83             
84              delete pc->GetSecondary( i );
85            } // loop over particle change vector
86         
87          if ( pc->GetNumberOfSecondaries() - g == 1 ) m1++;
88          else if ( pc->GetNumberOfSecondaries() - g == 2 ) m2++;
89          else if ( pc->GetNumberOfSecondaries() - g == 3 ) m3++;
90
91          pc->Clear();
92          delete pc;
93     
94        }
95
96
97      G4cout << energy << "\t"
98             << m1 << " "
99             << m2 << " "
100             << m3 << endl;
101
102    } // energy loop
103 
104  return 0;
105}
Note: See TracBrowser for help on using the repository browser.