source: trunk/source/processes/hadronic/models/de_excitation/fermi_breakup/test/G4FermiTest.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.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#include "G4FermiBreakUp.hh"
28
29#include "G4NucleiProperties.hh"
30
31
32
33
34int main()
35{
36  G4int A, Z;
37 
38  std::cout << "Please enter Z : ";
39  std::cin >> Z;
40  std::cout << "Please enter A : ";
41  std::cin >> A;
42 
43  G4double energy;
44
45  std::cout << "Please enter excitation energy (MeV) : ";
46  std::cin >> energy;
47 
48
49  energy *= MeV;
50 
51  G4int iterations;
52  std::cout << "Please enter number of interations : ";
53  std::cin >> iterations;
54 
55  G4double NuclearMass = G4NucleiProperties::GetNuclearMass(A,Z) + energy;
56
57 
58  G4LorentzVector p4(0.0,0.0,0.0,NuclearMass);
59  G4Fragment aFragment(A,Z,p4);
60 
61  G4FermiBreakUp model;
62
63  std::cout << "Excited Nucleus\n";
64  std::cout << aFragment << "\n\n";
65 
66  G4LorentzVector p4null(0.0,0.0,0.0,0.0);
67
68  //  std::ios::fmtflags old_floatfield = std::cout.flags();
69  std::cout.setf(std::ios::scientific,std::ios::floatfield);
70  for (G4int i = 0; i < iterations; ++i)
71    {
72      G4LorentzVector p4cons;
73      p4cons = p4null;
74      std::cout << "############ event " << i+1 << "###########################\n";
75      G4FragmentVector * theResult = model.BreakItUp(aFragment);
76      std::cout << "Number of fragments: " << theResult->size() << '\n';
77      std::cout << "-------------------------------------------\n";
78      for (G4FragmentVector::iterator i = theResult->begin(); i != theResult->end(); ++i)
79        {
80          std::cout << (*i);
81          std::cout << "\n-------------------------------------------\n";
82          p4cons += (*i)->GetMomentum();
83          delete (*i);
84        }
85      delete theResult;
86      std::cout << "        Initial momentum : " << p4/MeV << '\n';
87      std::cout << "Fragments total momentum : " << p4cons/MeV << '\n';
88      std::cout << "            Conservation : " << (p4-p4cons)/MeV << '\n';
89    }
90  return 0;
91}
92
93     
Note: See TracBrowser for help on using the repository browser.