KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVSimReader_SMF.cpp
1//Created by KVClassFactory on Mon Jul 5 16:21:41 2010
2//Author: bonnet
3
4#include "KVSimReader_SMF.h"
5#include "KVString.h"
6
8
9
10//________________________________________________________________
11
12
14
16{
17 // Default constructor
18 init();
19}
20
21
22
24
30
31
32
35
37{
38 // Destructor
39}
40
41
42
43
45
47{
48
49 while (IsOK()) {
50 if (ReadHeader() && ReadEvent()) {
51 if (nevt % 1000 == 0) Info("ReadFile", "%d evts lus", nevt);
52 if (HasToFill()) FillTree();
53 }
54 }
55
56}
57
58
59
61
63{
64
65 KVString snom;
66 auto res = ReadLineAndCheck(1, " ");
67 switch (res) {
69 return kFALSE;
71 snom.Form("%s", GetReadPar(0).Data());
72 snom.ReplaceAll("evt_", "");
73 //Info("ReadHeader","lecture %d",snom.Atoi());
74 nv->SetValue("event_number", snom.Atoi());
75
76 return kTRUE;
77 default:
78
79 return kFALSE;
80 }
81
82}
83
84
85
87
89{
90
91 evt->Clear();
92
93 Int_t mult = 0;
94 auto res = ReadLineAndCheck(1, " ");
95 switch (res) {
97 return kFALSE;
99 mult = GetIntReadPar(0);
100 break;
101
102 default:
103 return kFALSE;
104 }
105
106 evt->SetNumber(nv->GetIntValue("event_number"));
107 //Info("ReadEvent"," Lecture evt %d -> mult %d",evt->GetNumber(),mult);
108 for (Int_t mm = 0; mm < mult; mm += 1) {
110 if (!ReadNucleus()) return kFALSE;
111 }
112
113 nevt += 1;
114
115 return kTRUE;
116
117}
118
119
120
122
124{
125
126 ReadLine(" ");
127 Int_t res = GetNparRead();
128 Int_t npar = 0;
129 switch (res) {
130 case 0:
131 Info("ReadNucleus", "case 0 line est vide");
132 return kFALSE;
133
134 default:
135
136 ReadLineAndAdd(" ");
137 npar = GetNparRead();
138 if (npar != 12) {
139 Info("ReadNucleus", "Nombre de parametres (%d) different de celui attendu(%d)", npar, 12);
140 return kFALSE;
141 }
144 nuc->GetParameters()->SetValue("density", GetDoubleReadPar(2));
147 //Axe "faisceau dans SMF z"
150 nuc->GetParameters()->SetValue("avoir", GetDoubleReadPar(11));
151
152 return kTRUE;
153 }
154
155}
156
157
int Int_t
bool Bool_t
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
virtual void SetNumber(UInt_t num)
Definition KVBase.h:216
void Clear(Option_t *opt="")
Definition KVEvent.h:238
@ EmptyLine
last line read was empty (only whitespace)
@ OK
successful read and import of parameters from line
ReadStatus ReadLineAndCheck(Int_t nexpect, const KVString &pattern)
ReadStatus ReadLine(const KVString &pattern="")
Double_t GetDoubleReadPar(Int_t pos) const
ReadStatus ReadLineAndAdd(const KVString &pattern="")
Int_t GetIntReadPar(Int_t pos) const
Int_t GetNparRead() const
Bool_t IsOK()
KVString GetReadPar(Int_t pos) const
Int_t GetIntValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
void SetExcitEnergy(Double_t e)
void SetA(Int_t a)
void SetZ(Int_t z, Char_t mt=-1)
void SetMomentum(const TVector3 *v)
Definition KVParticle.h:542
KVNameValueList * GetParameters() const
Definition KVParticle.h:815
Nucleus in a simulated event.
void SetPosition(Double_t rx, Double_t ry, Double_t rz)
set the position of the nucleus in position space
Read ascii file for events of the SMF code after clusterization.
virtual void ReadFile()
virtual Bool_t ReadEvent()
virtual Bool_t ReadNucleus()
KVSimReader_SMF()
Default constructor.
virtual ~KVSimReader_SMF()
Destructor.
virtual Bool_t ReadHeader()
KVSimNucleus * nuc
Definition KVSimReader.h:60
virtual Bool_t HasToFill()
virtual void FillTree()
virtual void ConvertEventsInFile(KVString filename)
Method called by constructors with KVString filename argument.
KVSimEvent * evt
Definition KVSimReader.h:59
KVNameValueList * nv
Definition KVSimReader.h:74
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition KVString.h:73
Particle * AddParticle()
virtual void Info(const char *method, const char *msgfmt,...) const
Int_t Atoi() const
void Form(const char *fmt,...)
TString & ReplaceAll(const char *s1, const char *s2)
void init()
Int_t Nint(T x)
ClassImp(TPyArg)