KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVSimEvent.cpp
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>
7using namespace std;
8
10
11
12
13
16
17void KVSimEvent::Print(Option_t* t) const
18{
19 //Print a list of all particles in the event with some characteristics.
20 //Optional argument t can be used to select particles (="ok", "groupname", ...)
21
22 cout << "\nKVSimEvent with " << GetMult(t) << " particles :" << endl;
23 cout << "------------------------------------" << endl;
24 fParameters.Print();
25 KVSimNucleus* frag = 0;
26 for (auto it = GetNextParticleIterator(t); it != end(); ++it) {
27 (*it).Print();
28 cout << " Position: (" << (*it).GetPosition().x() << "," << (*it).GetPosition().y() << "," << (*it).GetPosition().z() << ")" << endl;
29 }
30
31}
32
33
34
38
40{
41 // Calculate total Coulomb potential energy of all particles in event
42 // Units are MeV.
43
44 Double_t Vtot = 0;
45 for (KVSimEvent::Iterator it = begin(); it != end(); ++it) {
46 KVSimEvent::Iterator it2(it);
47 for (++it2; it2 != end(); ++it2) {
48 TVector3 D12 = (*it).GetPosition() - (*it2).GetPosition();
49 Vtot += (*it).GetZ() * (*it2).GetZ() * KVNucleus::e2 / D12.Mag();
50 }
51 }
52 return Vtot;
53
54}
55
56
61
63{
64 //Stream an object of class KVReconstructedEvent.
65 //We set the particles' angles depending on whether mean or random angles
66 //are wanted (fMeanAngles = kTRUE or kFALSE)
67
68 if (R__b.IsReading()) {
69 UInt_t R__s, R__c;
70 UInt_t R__v = R__b.ReadVersion(&R__s, &R__c);
71 if (R__v < 5) {
72 // all versions written with automatic streamer
73 // (version is not read correctly from TTree branches)
74 Clear();
75 KVBase::Streamer(R__b);
76 fParticles->Streamer(R__b);
78 }
79 else
80 R__b.ReadClassBuffer(KVSimEvent::Class(), this, R__v, R__s, R__c);
81 }
82 else {
84 }
85}
86
87
unsigned int UInt_t
double Double_t
const char Option_t
KVNameValueList fParameters
general-purpose list of parameters
Definition KVEvent.h:72
void Clear(Option_t *opt="")
Definition KVEvent.h:238
TClonesArray * fParticles
array of particles in event
Definition KVEvent.h:71
static Double_t e2
e^2/(4.pi.epsilon_0) in MeV.fm
Definition KVNucleus.h:174
Container class for simulated nuclei, KVSimNucleus.
Definition KVSimEvent.h:22
Double_t GetTotalCoulombEnergy() const
virtual void Print(Option_t *t="") const
Nucleus in a simulated event.
void Print(Option_t *t="") const
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
Bool_t IsReading() const
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
void Streamer(TBuffer &) override
void Streamer(TBuffer &) override
static TClass * Class()
Double_t Mag() const
end
ClassImp(TPyArg)