source: trunk/source/processes/hadronic/models/binary_cascade/test/G4Fancy3DNucleusTestBis.cc @ 1199

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

nvx fichiers dans CVS

File size: 2.8 KB
Line 
1//
2// ********************************************************************
3// * DISCLAIMER                                                       *
4// *                                                                  *
5// * The following disclaimer summarizes all the specific disclaimers *
6// * of contributors to this software. The specific disclaimers,which *
7// * govern, are listed with their locations in:                      *
8// *   http://cern.ch/geant4/license                                  *
9// *                                                                  *
10// * Neither the authors of this software system, nor their employing *
11// * institutes,nor the agencies providing financial support for this *
12// * work  make  any representation or  warranty, express or implied, *
13// * regarding  this  software system or assume any liability for its *
14// * use.                                                             *
15// *                                                                  *
16// * This  code  implementation is the  intellectual property  of the *
17// * GEANT4 collaboration.                                            *
18// * By copying,  distributing  or modifying the Program (or any work *
19// * based  on  the Program)  you indicate  your  acceptance of  this *
20// * statement, and all its terms.                                    *
21// ********************************************************************
22//
23//#include "G4NuclearShellModelDensity.hh"
24//#include "G4NuclearFermiDensity.hh"
25//#include "G4FermiMomentum.hh"
26
27#include "G4NucleiProperties.hh"
28#include "G4ParticleTable.hh"
29#include "G4IonTable.hh"
30#include "globals.hh"
31#include "G4Fancy3DNucleus.hh"
32//#include "G4ThreeVector.hh"
33#include "G4LorentzVector.hh"
34
35int main(int argc, char ** argv)
36{
37  G4int A, Z, nEvents;
38
39  if(argc != 4)
40  {
41    cout << "Input A and Z: ";
42    cin >> A >> Z;
43    cout << "Input number of events: ";
44    cin >> nEvents;
45  }
46  else
47  {
48    A = atoi(argv[1]);
49    Z = atoi(argv[2]);
50    nEvents = atoi(argv[3]);
51  }
52
53  for(G4int i = 0; i < nEvents; ++i)
54  {
55// create the nucleus
56    G4V3DNucleus * the3DNucleus = new G4Fancy3DNucleus;
57    the3DNucleus->Init(A, Z);
58
59    if(!the3DNucleus->StartLoop())
60    {
61      cout << "G4Fancy3DNucleus::StartLoop() error." << endl;
62      return 1;
63    }
64    G4Nucleon * nucleon;
65    G4ThreeVector pos;
66    G4LorentzVector mom;
67    G4LorentzVector totalMom(0, 0, 0, 0);
68    while((nucleon = the3DNucleus->GetNextNucleon()) != NULL)
69    {
70      mom = nucleon->GetMomentum();
71      totalMom += mom;
72    }
73    cout << totalMom.x() << " " << totalMom.y() << " "
74         << totalMom.z() << " " << totalMom.t() << " "
75         << totalMom.vect().mag() << " " << totalMom.mag() << " "
76         << (1/MeV) * G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z, A)
77         << endl;
78  }
79  return 0;
80}
81
Note: See TracBrowser for help on using the repository browser.