KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVSimEvent.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Wed Jun 30 15:10:22 2010
2 //Author: bonnet
3 
4 #include "KVSimEvent.h"
5 
6 #include <KVSimNucleus.h>
7 using namespace std;
8 
10 
11 //___________________________
12 
13 
16 KVSimEvent::KVSimEvent(Int_t mult, const char* classname): KVEvent(mult, classname)
17 {
18  // Default constructor
19 }
20 
21 
22 
25 
27 {
28  //destructeur
29 }
30 
31 
32 
36 
38 {
39  //Print a list of all particles in the event with some characteristics.
40  //Optional argument t can be used to select particles (="ok", "groupname", ...)
41 
42  cout << "\nKVSimEvent with " << ((KVSimEvent*) this)->GetMult(t) << " particles :" << endl;
43  cout << "------------------------------------" << endl;
44  fParameters.Print();
45  KVSimNucleus* frag = 0;
46  const_cast<KVSimEvent*>(this)->ResetGetNextParticle();
47  while ((frag = (KVSimNucleus*)((KVSimEvent*) this)->GetNextParticle(t))) {
48  frag->Print();
49  cout << " Position: (" << frag->GetPosition().x() << "," << frag->GetPosition().y() << "," << frag->GetPosition().z() << ")" << endl;
50  }
51 
52 }
53 
54 
55 
59 
61 {
62  // Calculate total Coulomb potential energy of all particles in event
63  // Units are MeV.
64 
65  Double_t Vtot = 0;
66  for (KVEvent::Iterator it = begin(); it != end(); ++it) {
67  KVEvent::Iterator it2(it);
68  for (++it2; it2 != end(); ++it2) {
69  TVector3 D12 = it.get_reference<KVSimNucleus>().GetPosition() -
70  it2.get_reference<KVSimNucleus>().GetPosition();
71  Vtot += (*it).GetZ() * (*it2).GetZ() * KVNucleus::e2 / D12.Mag();
72  }
73  }
74  return Vtot;
75 
76 }
77 
78 
int Int_t
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
double Double_t
const char Option_t
ReferenceType & get_reference() const
Definition: KVEvent.h:304
Base class container for multi-particle events.
Definition: KVEvent.h:176
static Double_t e2
e^2/(4.pi.epsilon_0) in MeV.fm
Definition: KVNucleus.h:176
Container class for simulated nuclei, KVSimNucleus.
Definition: KVSimEvent.h:15
Double_t GetTotalCoulombEnergy() const
Definition: KVSimEvent.cpp:60
virtual ~KVSimEvent()
destructeur
Definition: KVSimEvent.cpp:26
virtual void Print(Option_t *t="") const
Definition: KVSimEvent.cpp:37
Nucleus in a simulated event.
Definition: KVSimNucleus.h:20
void Print(Option_t *t="") const
Display nucleus parameters.
const TVector3 * GetPosition() const
Definition: KVSimNucleus.h:44
Double_t z() const
Double_t x() const
Double_t Mag() const
Double_t y() const