KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVSimReader_DIT.cpp
1//Created by KVClassFactory on Fri Sep 11 23:31:56 2020
2//Author: henri
3
4#include "KVSimReader_DIT.h"
5
7
8
9// BEGIN_HTML <!--
10/* -->
11<h2>KVSimReader_DIT</h2>
12<h4></h4>
13<!-- */
14// --> END_HTML
16
17
18
19
21{
22 projectile = proj;
23 target = targ;
24 energy = ener;
25 //
26 InitReader();
27 ConvertEventsInFile(filename);
28 SaveTree();
29}
30
31
32
33
36
38{
39 // Destructor
40}
41
42
43
44
46
48{
49 if (!OpenFileToRead(filename)) return;
50
52 Run();
53 CloseFile();
54}
55
56
57
58
60
62{
63 while (IsOK()) {
64 while (ReadEvent()) {
65 if ((nevt % 10000) == 0) Info("ReadFile", "%d events read", nevt);
66 if (HasToFill()) FillTree();
67 }
68 }
69}
70
71
72
73
75
77{
78 evt->Clear();
79 //
80 auto res = ReadLineAndCheck(21, " ");
81
82 switch (res) {
84 Info("ReadEvent", "Line is empty");
85 return kFALSE;
86
90 FillEvent();
91 break;
92
93 default :
94 return kFALSE;
95 }
96
97 nevt++;
98
99 return kTRUE;
100}
101
102
103
104
106
131
132
133
134
137
139{
140 // Fill projectile-like nucleus
141 nuc = static_cast<KVSimNucleus*>(evt->AddParticle());
142
146
147 if (itype == DITCollOk) {
148 if (theta_proj_like < 0.) {
149 nuc->SetPhi(270.);
150 }
151 else {
152 nuc->SetPhi(90.);
153 }
154 }
155 else {
156 nuc->SetPhi(0.);
157 }
158
160 nuc->SetSpin(spin_proj_like, 0., 0.); // Spin component given by the model is normal to the reaction plane, this last being (YZ), thus the spin is on the X-axis
161 //
162 // Fill target-like nucleus if it exists (meaning he itype code is 0, a DIC event and not a fusion
163 if (itype == DITCollOk) {
164 nuc = static_cast<KVSimNucleus*>(evt->AddParticle());
165
169
170 if (theta_targ_like < 0.) {
171 nuc->SetPhi(270.);
172 }
173 else {
174 nuc->SetPhi(90.);
175 }
176
178 nuc->SetSpin(spin_targ_like, 0., 0.); // Spin component given by the model is normal to the reaction plane, this last being (YZ), thus the spin is on the X-axis
179 }
180 //
181 // Add parameters to event
182 evt->SetParameter("weight", weight);
183 evt->SetParameter("inicident_partial_wave", inicident_partial_wave);
184 evt->SetParameter("impact_parameter", impact_parameter);
185 evt->SetParameter("itype", itype);
186 evt->SetParameter("theta_cm", theta_cm);
187 evt->SetParameter("q_reaction", q_reaction);
188 evt->SetParameter("k_n", k_n);
189 evt->SetParameter("k_p", k_p);
190 evt->SetParameter("min_dist", min_dist);
191}
192
193
194
195
197
199{
200 tree_name = "DIT";
201 tree_title = "dit_events";
202 branch_name = "DITKVSimEvents";
203 root_file_name = Form("DIT_%s+%s@%.1fMeV.root", projectile.Data(), target.Data(), energy);
204}
205
206
207
208
214
216{
217 //
218 // Skip first line of the file events.dat, which should be :
219 // WEIGHT/F:ANGM0:IMPAR:ITYPE/I:A[2]:Z[2]:EX[2]/F:SPIN[2]:ELAB[2]:THETA[2]:THCM:Q:KN/I:KP:SMIN/F
220 //
221 ReadLine(0);
222 Info("SkipFirstLine", "Skipping firt line of simulated data file!");
223}
224
225
226//____________________________________________________________________________//
227
bool Bool_t
constexpr Bool_t kFALSE
double Double_t
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
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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
char * Form(const char *fmt,...)
virtual void SetNumber(UInt_t num)
Definition KVBase.h:216
void Clear(Option_t *opt="")
Definition KVEvent.h:238
void SetParameter(const Char_t *name, ValType value) const
Definition KVEvent.h:197
@ 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
Int_t GetIntReadPar(Int_t pos) const
Bool_t IsOK()
Bool_t OpenFileToRead(const KVString &filename)
void SetExcitEnergy(Double_t e)
void SetZandA(Int_t z, Int_t a)
Set atomic number and mass number.
void SetTheta(Double_t theta)
Definition KVParticle.h:693
void SetPhi(Double_t phi)
Definition KVParticle.h:697
void SetE(Double_t a)
Definition KVParticle.h:594
Nucleus in a simulated event.
void SetSpin(Double_t x, Double_t y, Double_t z)
Read and convert to KaliVeda format outputs from DIT.
Double_t impact_parameter
Impact parameter of the collision.
void FillEvent()
Fill projectile-like nucleus.
Double_t energy
Projectile energy in MeV/A.
Int_t itype
Collision type.
Double_t theta_targ_like
Target like theta scattering angle in the laboratory frame in degrees.
Double_t energy_targ_like
Target like energy in the laboratory frame in MeV.
Int_t z_proj_like
Projectile like charge number.
Double_t spin_targ_like
Target like spin in hbar (only components normal to the reaction plane)
Int_t k_p
Number of protons exchanged.
Double_t excitation_energy_proj_like
Projectile like excitation energy (thermal + rotational) in MeV.
virtual ~KVSimReader_DIT()
Destructor.
Int_t z_targ_like
Target like charge number.
KVString projectile
Projectile of the collision in the format '58Ni'.
void ConvertEventsInFile(KVString)
Double_t min_dist
Minimal distance of approach(fm) between nuclear surfaces.
Int_t k_n
Number of neutrons exchanged.
Double_t theta_proj_like
Projectile like theta scattering angle in the laboratory frame in degrees.
Double_t spin_proj_like
Projectile like spin in hbar (only components normal to the reaction plane)
Double_t weight
Weight (?) of the collision.
Double_t theta_cm
Center of mass theta scattering angle in degrees.
Int_t a_targ_like
Target like mass number.
KVString target
Projectile of the collision in the format '64Ni'.
Int_t a_proj_like
Projectile like mass number.
Double_t excitation_energy_targ_like
Target like excitation energy (thermal + rotational) in MeV.
Double_t inicident_partial_wave
Incident partial wave in hbar (to determine the impact parameter) in the center of mass.
Double_t energy_proj_like
Projectile like energy in the laboratory frame in MeV.
Double_t q_reaction
Reaction Q value in MeV.
Base class to read output files for simulation and create tree using KVSimEvent class.
Definition KVSimReader.h:51
KVString root_file_name
Definition KVSimReader.h:63
KVString tree_name
Definition KVSimReader.h:63
KVString tree_title
Definition KVSimReader.h:63
void Run(Option_t *option="recreate")
KVString branch_name
Definition KVSimReader.h:63
KVSimNucleus * nuc
Definition KVSimReader.h:60
virtual Bool_t HasToFill()
virtual void FillTree()
KVSimEvent * evt
Definition KVSimReader.h:59
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
const char * Data() const
Double_t Abs(Double_t d)
ClassImp(TPyArg)