KaliVeda
Toolkit for HIC analysis
KVSimReader_HIPSE_asym.cpp
1 //Created by KVClassFactory on Fri Jul 2 15:16:15 2010
2 //Author: bonnet
3 
4 #include "KVSimReader_HIPSE_asym.h"
5 #include "KV2Body.h"
6 #include "TRandom.h"
7 
9 
10 
11 
12 
13 
17 {
18  // Default constructor
19  init();
20 }
21 
22 
23 
25 
27 {
28  init();
30 }
31 
32 
33 
36 
38 {
39  // Destructor
40 }
41 
42 
43 
45 
47 {
48 
49  evt->Clear();
50  Int_t mult = 0, mtotal = 0;
51  auto res = ReadLineAndCheck(2, " ");
52  switch (res) {
54  Info("ReadEvent", "case 0 line est vide");
55  return kFALSE;
57  evt->SetNumber(nevt);
58  mult = GetIntReadPar(0);
59  mtotal = GetIntReadPar(1);
60  evt->GetParameters()->SetValue("mult", mtotal);
61 
62  break;
63  default:
64 
65  return kFALSE;
66  }
67 
68  /*---------------------------------------------
69  Esa = excitation per nucleon
70  vcm = center of mass energy
71  Bparstore = impact parameter
72  PhiPlan = angle of the reaction plane
73  //---------------------------------------------
74  */
75 
76  fPhiPlan = gRandom->Rndm() * 2.*TMath::Pi();
77  rr.SetXEulerAngles(0., 0., fPhiPlan);
78 
79  res = ReadLineAndCheck(3, " ");
80  switch (res) {
82  return kFALSE;
86  evt->GetParameters()->SetValue("Bparstore", GetDoubleReadPar(2));
87  evt->GetParameters()->SetValue("PhiPlan", fPhiPlan);
88  break;
89  default:
90 
91  return kFALSE;
92  }
93 
94 
95  res = ReadLineAndCheck(3, " ");
96  switch (res) {
98  return kFALSE;
100 
101  break;
102  default:
103 
104  return kFALSE;
105  }
106 
107  evt->SetNumber(nevt);
108  for (Int_t mm = 0; mm < mult; mm += 1) {
110  if (!ReadNucleus()) return kFALSE;
111  }
112 
113  nevt += 1;
114  return kTRUE;
115 
116 }
117 
118 
119 
121 
123 {
124 
125  auto res = ReadLineAndCheck(3, " ");
126  switch (res) {
128  Info("ReadNucleus", "case 0 line est vide");
129  return kFALSE;
130 
132  /*
133  proven = 0 -> fusion of the QP and QT
134  proven = 1 -> QP
135  proven = 2 -> QT
136  proven > 2 -> other
137  */
138 
139  nuc->SetZ(GetIntReadPar(1));
140  nuc->SetA(GetIntReadPar(0));
141  nuc->GetParameters()->SetValue("proven", GetDoubleReadPar(2));
142 
143  break;
144 
145  default:
146 
147 
148  return kFALSE;
149  }
150 
151  res = ReadLineAndCheck(3, " ");
152  switch (res) {
154  Info("ReadNucleus", "case 0 line est vide");
155  return kFALSE;
156 
158  //Axe "faisceau dans HIPSE x -> on effectue une rotation X,Y,Z -> Y,Z,X"
160  {
161  TVector3 vv = nuc->GetVelocity();
162  vv *= rr;
163  nuc->SetVelocity(vv);
164  return kTRUE;
165  }
166  default:
167 
168 
169  return kFALSE;
170  }
171 
172 
173 }
174 
175 
176 
180 
182 {
183  // ROOT file called: HIPSE_[PROJ]_[TARG]_[EBEAM]AMeV_ASYM.root
184  // Call after reading file header
185 
186  SetROOTFileName(Form("HIPSE_%s_%s_%.1fAMeV_ASYM.root",
188 }
189 
190 
191 
192 
194 
196 {
197  if (!OpenFileToRead(filename)) return;
198  if (!ReadHeader()) return;
200  tree_title.Form("HIPSE secondary events %s + %s %.1f MeV/nuc.",
202  Run();
203  CloseFile();
204 }
205 
206 
int Int_t
bool Bool_t
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
winID h TVirtualViewer3D vv
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
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
virtual void SetNumber(UInt_t num)
Definition: KVBase.h:215
KVNameValueList * GetParameters() const
Definition: KVEvent.h:179
void Clear(Option_t *opt="") override
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)
Definition: KVFileReader.h:279
void CloseFile()
Definition: KVFileReader.h:237
Double_t GetDoubleReadPar(Int_t pos) const
Definition: KVFileReader.h:334
Int_t GetIntReadPar(Int_t pos) const
Definition: KVFileReader.h:338
Bool_t OpenFileToRead(const KVString &filename)
Definition: KVFileReader.h:210
void SetValue(const Char_t *name, value_type value)
const Char_t * GetSymbol(Option_t *opt="") const
Definition: KVNucleus.cpp:71
void SetA(Int_t a)
Definition: KVNucleus.cpp:647
void SetZ(Int_t z, Char_t mt=-1)
Definition: KVNucleus.cpp:696
KVNameValueList * GetParameters() const
Definition: KVParticle.h:818
void SetVelocity(const TVector3 &)
Set velocity of particle (in cm/ns units)
void SetMomentum(const TVector3 *v)
Definition: KVParticle.h:545
TVector3 GetVelocity() const
returns velocity vector in cm/ns units
Nucleus in a simulated event.
Definition: KVSimNucleus.h:32
Read ascii file for asymptotic events of the HIPSE code after SIMON deexcitation.
virtual ~KVSimReader_HIPSE_asym()
Destructor.
KVSimReader_HIPSE_asym()
Default constructor.
void ConvertEventsInFile(KVString filename) override
Read ascii file for events of the HIPSE code after clusterization.
Bool_t ReadHeader() override
Int_t nevt
Definition: KVSimReader.h:62
KVString tree_title
Definition: KVSimReader.h:63
void Run(Option_t *option="recreate")
void SetROOTFileName(const Char_t *n)
Definition: KVSimReader.h:166
KVSimNucleus * nuc
Definition: KVSimReader.h:60
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
Double_t Rndm() override
TRotation & SetXEulerAngles(Double_t phi, Double_t theta, Double_t psi)
void Form(const char *fmt,...)
void init()
constexpr Double_t Pi()
ClassImp(TPyArg)