KaliVeda
Toolkit for HIC analysis
KVSimEvent.cpp
1 //Created by KVClassFactory on Wed Jun 30 15:10:22 2010
2 //Author: bonnet
3 
4 #include "KVSimEvent.h"
5 
7 
8 
9 
10 
13 void KVSimEvent::Print(Option_t* t) const
14 {
15  //Print a list of all particles in the event with some characteristics.
16 
17  std::cout << "SimEvent #" << GetNumber() << " MULT=" << GetMult() << std::endl;
18  fParameters.ls();
19  std::cout << std::endl;
20  int id = 1;
21  for (auto& p : *this) {
22  std::cout << id << " : ";
23  p.Print();
24  std::cout << std::endl << std::endl;
25  ++id;
26  }
27 }
28 
29 
30 
34 
36 {
37  // Calculate total Coulomb potential energy of all particles in event
38  // Units are MeV.
39 
40  Double_t Vtot = 0;
41  for (KVSimEvent::Iterator it = begin(); it != end(); ++it) {
42  KVSimEvent::Iterator it2(it);
43  for (++it2; it2 != end(); ++it2) {
44  TVector3 D12 = (*it).GetPosition() - (*it2).GetPosition();
45  Vtot += (*it).GetZ() * (*it2).GetZ() * KVNucleus::e2 / D12.Mag();
46  }
47  }
48  return Vtot;
49 
50 }
51 
52 
57 
58 void KVSimEvent::Streamer(TBuffer& R__b)
59 {
60  //Stream an object of class KVReconstructedEvent.
61  //We set the particles' angles depending on whether mean or random angles
62  //are wanted (fMeanAngles = kTRUE or kFALSE)
63 
64  if (R__b.IsReading()) {
65  UInt_t R__s, R__c;
66  UInt_t R__v = R__b.ReadVersion(&R__s, &R__c);
67  if (R__v < 5) {
68  // all versions written with automatic streamer
69  // (version is not read correctly from TTree branches)
70  Clear();
71  KVBase::Streamer(R__b);
72  fParticles->Streamer(R__b);
73  fParameters.Streamer(R__b);
74  }
75  else
76  R__b.ReadClassBuffer(KVSimEvent::Class(), this, R__v, R__s, R__c);
77  }
78  else {
79  R__b.WriteClassBuffer(KVSimEvent::Class(), this);
80  }
81 }
82 
83 
unsigned int UInt_t
double Double_t
const char Option_t
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
KVNameValueList fParameters
general-purpose list of parameters
Definition: KVEvent.h:72
TClonesArray * fParticles
array of particles in event
Definition: KVEvent.h:71
void Clear(Option_t *opt="") override
Definition: KVEvent.h:238
static Double_t e2
e^2/(4.pi.epsilon_0) in MeV.fm
Definition: KVNucleus.h:170
Container class for simulated nuclei, KVSimNucleus.
Definition: KVSimEvent.h:22
Double_t GetTotalCoulombEnergy() const
Definition: KVSimEvent.cpp:35
virtual void ls(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()
virtual void Print(Option_t *option="") const
Double_t Mag() const
ClassImp(TPyArg)