KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVSimReader_HIPSE.cpp
1//Created by KVClassFactory on Wed Jul 7 12:15:56 2010
2//Author: bonnet
3
4#include "KVSimReader_HIPSE.h"
5
7
8
9
10
12
14{
15 // Default constructor
16 init();
17}
18
19
20
22
28
29
30
32
36
37
38
39
41
43{
44 h1 = new TH1F("impact_parameter", "distri", 200, 0, 20);
46 h1->SetDirectory(nullptr);//avoid double deletion on ROOT file close
47
48 while (IsOK()) {
49 while (ReadEvent()) {
50 if (nevt % 1000 == 0) Info("ReadFile", "%d evts lus", nevt);
51 h1->Fill(evt->GetParameters()->GetDoubleValue("Bparstore"));
52 if (HasToFill()) FillTree();
53 }
54 }
55
56}
57
58
59
61
63{
64
65 auto res = ReadLineAndCheck(2, " ");
66 switch (res) {
68 return kFALSE;
70 AddInfo("Aproj", GetReadPar(0).Data());
71 AddInfo("Zproj", GetReadPar(1).Data());
72 proj.SetZandA(GetReadPar(1).Atoi(), GetReadPar(0).Atoi());
73 break;
74 default:
75 return kFALSE;
76 }
77
78 res = ReadLineAndCheck(2, " ");
79 switch (res) {
81 return kFALSE;
83 AddInfo("Atarg", GetReadPar(0).Data());
84 AddInfo("Ztarg", GetReadPar(1).Data());
85 targ.SetZandA(GetReadPar(1).Atoi(), GetReadPar(0).Atoi());
86
87 break;
88 default:
89
90 return kFALSE;
91 }
92
93 res = ReadLineAndCheck(1, " ");
94 switch (res) {
96 return kFALSE;
98 AddInfo("Ebeam", GetReadPar(0).Data());
99 ebeam = GetReadPar(0).Atof();
100 return kTRUE;
101
102
103 default:
104
105 return kFALSE;
106 }
107
108}
109
110
111
113
115{
116
117 evt->Clear();
118 Int_t mult = 0, mtotal = 0;
119
120 /*---------------------------------------------
121 mul_vrai = multiplicity of charged particles
122 mult = total multiplicity (i.e. including neutrons)
123 //---------------------------------------------
124 */
125 auto res = ReadLineAndCheck(2, " ");
126 switch (res) {
128 Info("ReadEvent", "case 0 line est vide");
129 return kFALSE;
132 mult = GetIntReadPar(0); //mul_vrai
133 mtotal = GetIntReadPar(1);
134 evt->GetParameters()->SetValue("mult", mtotal);
135
136 break;
137 default:
138
139 return kFALSE;
140 }
141
142 /*---------------------------------------------
143 Esa = excitation per nucleon
144 vcm = center of mass energy
145 Bparstore = impact parameter
146 //---------------------------------------------
147 */
148 res = ReadLineAndCheck(3, " ");
149 switch (res) {
151 return kFALSE;
155 evt->GetParameters()->SetValue("Bparstore", GetDoubleReadPar(2));
156
157 break;
158 default:
159
160 return kFALSE;
161 }
162
163 /*---------------------------------------------
164 energetic information
165 excitat : total excitation energy
166 xmassav : Q-value
167 ekinav : total kinetic energy at freeze-out
168 epotav : total potential energy at freeze-out
169 erotav : total rotational energy at freeze-out
170 //---------------------------------------------
171 */
172 res = ReadLineAndCheck(2, " ");
173 switch (res) {
175 return kFALSE;
177 evt->GetParameters()->SetValue("excitat", GetDoubleReadPar(0));
178 evt->GetParameters()->SetValue("xmassav", GetDoubleReadPar(1));
179
180 break;
181 default:
182
183 return kFALSE;
184 }
185
186 res = ReadLineAndCheck(3, " ");
187 switch (res) {
189 return kFALSE;
191
192 evt->GetParameters()->SetValue("ekinav", GetDoubleReadPar(0));
193 evt->GetParameters()->SetValue("epotav", GetDoubleReadPar(1));
194 evt->GetParameters()->SetValue("erotav", GetDoubleReadPar(2));
195 break;
196
197 default:
198 return kFALSE;
199 }
200
202 for (Int_t mm = 0; mm < mult; mm += 1) {
204 if (!ReadNucleus()) return kFALSE;
205 }
206
207 nevt += 1;
208 return kTRUE;
209
210}
211
212
213
215
217{
218
219 auto res = ReadLineAndCheck(3, " ");
220 switch (res) {
222 Info("ReadNucleus", "case 0 line est vide");
223 return kFALSE;
224
226 /*
227 proven = 0 -> fusion of the QP and QT
228 proven = 1 -> QP
229 proven = 2 -> QT
230 proven > 2 -> other
231 */
234 nuc->GetParameters()->SetValue("proven", GetDoubleReadPar(2));
235 break;
236
237 default:
238 return kFALSE;
239 }
240
241 res = ReadLineAndCheck(3, " ");
242 switch (res) {
244 Info("ReadNucleus", "case 0 line est vide");
245 return kFALSE;
246
248 //Axe "faisceau dans HIPSE x -> on effectue une rotation X,Y,Z -> Y,Z,X"
250 break;
251
252 default:
253 return kFALSE;
254 }
255
256 int AA = nuc->GetA();
257
258 /*---------------------------------------------------------
259 exci(I) : excitation energy
260 ether(I) : not used
261 spinx(i),spiny(i),spinz(i) : angular momentum (hbar units)
262 //---------------------------------------------
263 */
264 res = ReadLineAndCheck(2, " ");
265 switch (res) {
267 Info("ReadNucleus", "case 0 line est vide");
268 return kFALSE;
269
274 break;
275
276 default:
277 return kFALSE;
278 }
279
280 res = ReadLineAndCheck(3, " ");
281 switch (res) {
283 Info("ReadNucleus", "case 0 line est vide");
284 return kFALSE;
285
287 //On effectue la meme rotation que les impulsions ... à vérifier
289 return kTRUE;
290
291 default:
292 return kFALSE;
293 }
294
295
296
297}
298
299
303
305{
306 // ROOT file called: HIPSE_[PROJ]_[TARG]_[EBEAM]AMeV.root
307 // Call after reading file header
308
309 SetROOTFileName(Form("HIPSE_%s_%s_%.1fAMeV.root",
311}
312
313
314
315
317
319{
320 if (!OpenFileToRead(filename)) return;
321 if (!ReadHeader()) return;
323 tree_title.Form("HIPSE primary events %s + %s %.1f MeV/nuc.",
325 Run();
326 CloseFile();
327}
328
329
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
char * Form(const char *fmt,...)
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
Bool_t OpenFileToRead(const KVString &filename)
Double_t GetDoubleValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
const Char_t * GetSymbol(Option_t *opt="") const
Definition KVNucleus.cpp:81
void SetExcitEnergy(Double_t e)
Int_t GetA() const
void SetA(Int_t a)
void SetZ(Int_t z, Char_t mt=-1)
void SetZandA(Int_t z, Int_t a)
Set atomic number and mass number.
void SetMomentum(const TVector3 *v)
Definition KVParticle.h:542
KVNameValueList * GetParameters() const
Definition KVParticle.h:815
Nucleus in a simulated event.
void SetAngMom(Double_t lx, Double_t ly, Double_t lz)
set the angular momentum of the nucleus
Read ascii file for events of the HIPSE code after clusterization.
virtual void define_output_filename()
KVSimReader_HIPSE()
Default constructor.
void ConvertEventsInFile(KVString filename)
KVString tree_title
Definition KVSimReader.h:63
void Run(Option_t *option="recreate")
void SetROOTFileName(const Char_t *n)
KVSimNucleus * nuc
Definition KVSimReader.h:60
virtual Bool_t HasToFill()
virtual void FillTree()
void AddObject(TObject *obj)
KVSimEvent * evt
Definition KVSimReader.h:59
void AddInfo(const Char_t *name, const Char_t *val)
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition KVString.h:73
Particle * AddParticle()
virtual void SetDirectory(TDirectory *dir)
virtual Int_t Fill(const char *name, Double_t w)
virtual void Info(const char *method, const char *msgfmt,...) const
Double_t Atof() const
void Form(const char *fmt,...)
void init()
ClassImp(TPyArg)