KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVSimReader_HIPSE_asym.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Fri Jul 2 15:16:15 2010
2 //Author: bonnet
3 
5 #include "KV2Body.h"
6 
8 
9 
10 
11 
12 
16 {
17  // Default constructor
18  init();
19 }
20 
21 
22 
24 
26 {
27  init();
28  ConvertEventsInFile(filename);
29 }
30 
31 
32 
35 
37 {
38  // Destructor
39 }
40 
41 
42 
44 
46 {
47 
48  evt->Clear();
49  Int_t mult = 0, mtotal = 0;
50  auto res = ReadLineAndCheck(2, " ");
51  switch (res) {
53  Info("ReadEvent", "case 0 line est vide");
54  return kFALSE;
56  evt->SetNumber(nevt);
57  mult = GetIntReadPar(0);
58  mtotal = GetIntReadPar(1);
59  evt->GetParameters()->SetValue("mult", mtotal);
60 
61  break;
62  default:
63 
64  return kFALSE;
65  }
66 
67  /*---------------------------------------------
68  Esa = excitation per nucleon
69  vcm = center of mass energy
70  Bparstore = impact parameter
71  PhiPlan = angle of the reaction plane
72  //---------------------------------------------
73  */
74 
75  fPhiPlan = gRandom->Rndm() * 2.*TMath::Pi();
76  rr.SetXEulerAngles(0., 0., fPhiPlan);
77 
78  res = ReadLineAndCheck(3, " ");
79  switch (res) {
81  return kFALSE;
85  evt->GetParameters()->SetValue("Bparstore", GetDoubleReadPar(2));
86  evt->GetParameters()->SetValue("PhiPlan", fPhiPlan);
87  break;
88  default:
89 
90  return kFALSE;
91  }
92 
93 
94  res = ReadLineAndCheck(3, " ");
95  switch (res) {
97  return kFALSE;
99 
100  break;
101  default:
102 
103  return kFALSE;
104  }
105 
106  evt->SetNumber(nevt);
107  for (Int_t mm = 0; mm < mult; mm += 1) {
109  if (!ReadNucleus()) return kFALSE;
110  }
111 
112  nevt += 1;
113  return kTRUE;
114 
115 }
116 
117 
118 
120 
122 {
123 
124  auto res = ReadLineAndCheck(3, " ");
125  switch (res) {
127  Info("ReadNucleus", "case 0 line est vide");
128  return kFALSE;
129 
131  /*
132  proven = 0 -> fusion of the QP and QT
133  proven = 1 -> QP
134  proven = 2 -> QT
135  proven > 2 -> other
136  */
137 
138  nuc->SetZ(GetIntReadPar(1));
139  nuc->SetA(GetIntReadPar(0));
140  nuc->GetParameters()->SetValue("proven", GetDoubleReadPar(2));
141 
142  break;
143 
144  default:
145 
146 
147  return kFALSE;
148  }
149 
150  res = ReadLineAndCheck(3, " ");
151  switch (res) {
153  Info("ReadNucleus", "case 0 line est vide");
154  return kFALSE;
155 
157  //Axe "faisceau dans HIPSE x -> on effectue une rotation X,Y,Z -> Y,Z,X"
159  {
160  TVector3 vv = nuc->GetVelocity();
161  vv *= rr;
162  nuc->SetVelocity(vv);
163  return kTRUE;
164  }
165  default:
166 
167 
168  return kFALSE;
169  }
170 
171 
172 }
173 
174 
175 
179 
181 {
182  // ROOT file called: HIPSE_[PROJ]_[TARG]_[EBEAM]AMeV_ASYM.root
183  // Call after reading file header
184 
185  SetROOTFileName(Form("HIPSE_%s_%s_%.1fAMeV_ASYM.root",
187 }
188 
189 
190 
191 
193 
195 {
196  if (!OpenFileToRead(filename)) return;
197  if (!ReadHeader()) return;
199  tree_title.Form("HIPSE secondary events %s + %s %.1f MeV/nuc.",
201  Run();
202  CloseFile();
203 }
204 
205 
int Int_t
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
const Bool_t kFALSE
bool Bool_t
const Bool_t kTRUE
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:203
void Clear(Option_t *opt="")
Clear object properties : name, type/title, number, label.
Definition: KVEvent.h:262
@ 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:278
void CloseFile()
Definition: KVFileReader.h:236
Double_t GetDoubleReadPar(Int_t pos) const
Definition: KVFileReader.h:333
Int_t GetIntReadPar(Int_t pos) const
Definition: KVFileReader.h:337
Bool_t OpenFileToRead(const KVString &filename)
Definition: KVFileReader.h:209
void SetValue(const Char_t *name, value_type value)
const Char_t * GetSymbol(Option_t *opt="") const
Definition: KVNucleus.cpp:81
void SetA(Int_t a)
Definition: KVNucleus.cpp:655
void SetZ(Int_t z, Char_t mt=-1)
Definition: KVNucleus.cpp:704
KVNameValueList * GetParameters() const
Definition: KVParticle.h:816
void SetMomentum(const TVector3 &v)
Definition: KVParticle.h:576
void SetVelocity(const TVector3 &)
Set velocity of particle (in cm/ns units)
TVector3 GetVelocity() const
returns velocity vector in cm/ns units
Nucleus in a simulated event.
Definition: KVSimNucleus.h:31
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)
Method called by constructors with KVString filename argument.
Read ascii file for events of the HIPSE code after clusterization.
Int_t nevt
Definition: KVSimReader.h:68
KVString tree_title
Definition: KVSimReader.h:69
void Run(Option_t *option="recreate")
void SetROOTFileName(const Char_t *n)
Definition: KVSimReader.h:172
KVSimNucleus * nuc
Definition: KVSimReader.h:66
KVSimEvent * evt
Definition: KVSimReader.h:65
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
Particle * AddParticle()
virtual void Info(const char *method, const char *msgfmt,...) const
virtual Double_t Rndm()
TRotation & SetXEulerAngles(Double_t phi, Double_t theta, Double_t psi)
void Form(const char *fmt,...)
const long double mm
Definition: KVUnits.h:69
constexpr Double_t Pi()