KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVSimReader_SMF_asym.cpp
1//Created by KVClassFactory on Mon Jul 5 15:24:25 2010
2//Author: bonnet
3
4#include "KVSimReader_SMF_asym.h"
5#include "KVString.h"
6
8
9
10
12
14{
15 // Default constructor
16 init();
17}
18
19
20
22
28
29
30
31
34
39
40
41
43
45{
46
47 while (IsOK()) {
48 if (ReadHeader()) {
49 for (Int_t nd = 0; nd < nv->GetIntValue("ndes"); nd += 1) {
50 if (ReadEvent()) {
51 if (nevt % 1000 == 0) Info("ReadFile", "%d evts lus", nevt);
52 if (HasToFill()) FillTree();
53 }
54 }
55 }
56 }
57
58}
59
60
61
62
64
66{
67
68 KVString snom;
69 auto res = ReadLineAndCheck(1, " ");
70 switch (res) {
72 return kFALSE;
74 snom.Form("%s", GetReadPar(0).Data());
75 snom.ReplaceAll("evt_", "");
76 //Info("ReadHeader","lecture %d",snom.Atoi());
77 nv->SetValue("event_number", snom.Atoi());
78
79 break;
80 default:
81 return kFALSE;
82 }
83
84 res = ReadLineAndCheck(1, " ");
85 switch (res) {
87 return kFALSE;
89 nv->SetValue("ndes", GetIntReadPar(0));
90 ndes = 0;
91
92 return kTRUE;
93 default:
94 return kFALSE;
95 }
96
97
98}
99
100
101//-----------------------------------------
102
103
105
107{
108
109 evt->Clear();
110
111 Int_t mult = 0;
112 auto res = ReadLineAndCheck(1, " ");
113 switch (res) {
115 return kFALSE;
117 mult = GetIntReadPar(0);
118 break;
119
120 default:
121 return kFALSE;
122 }
123
124 evt->SetNumber(nv->GetIntValue("event_number"));
125 evt->GetParameters()->SetValue("sub_number", ndes);
126 for (Int_t mm = 0; mm < mult; mm += 1) {
128 if (!ReadNucleus()) return kFALSE;
129 }
130
131 nevt += 1;
132 ndes += 1;
133
134 return kTRUE;
135
136}
137
138
139//-----------------------------------------
140
141
143
145{
146
147 auto res = ReadLineAndCheck(5, " ");
148 switch (res) {
150 Info("ReadNucleus", "case 0 line est vide");
151 return kFALSE;
152
156
157 //Axe "faisceau dans SMF z"
159
160 return kTRUE;
161
162 default:
163
164 return kFALSE;
165 }
166
167}
168
169
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
KVNameValueList * GetParameters() const
Definition KVEvent.h:179
@ 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)
Double_t GetDoubleReadPar(Int_t pos) const
Int_t GetIntReadPar(Int_t pos) 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 SetA(Int_t a)
void SetZ(Int_t z, Char_t mt=-1)
void SetMomentum(const TVector3 *v)
Definition KVParticle.h:542
Nucleus in a simulated event.
Read ascii file for asymptotic events of the SMF code after SIMON deexcitation.
virtual ~KVSimReader_SMF_asym()
Destructor.
KVSimReader_SMF_asym()
Default constructor.
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()
ClassImp(TPyArg)