KaliVeda
Toolkit for HIC analysis
KVSimReader_SMF.cpp
1 //Created by KVClassFactory on Mon Jul 5 16:21:41 2010
2 //Author: bonnet
3 
4 #include "KVSimReader_SMF.h"
5 
7 
8 
9 
13 {
14  // Default constructor
15  init();
16 }
17 
18 
19 
21 
23 {
24  init();
26 }
27 
28 
29 
30 
32 
34 {
35 
36  KVString snom;
37  auto res = ReadLineAndCheck(1, " ");
38  switch (res) {
40  return kFALSE;
42  snom.Form("%s", GetReadPar(0).Data());
43  snom.ReplaceAll("evt_", "");
44  //Info("ReadHeader","lecture %d",snom.Atoi());
45  event_number = snom.Atoi();
46  break;
47  default:
48  return kFALSE;
49  }
50  return kTRUE;
51 }
52 
53 
54 
56 
58 {
59  mult = 0;
60  auto res = ReadLineAndCheck(1, " ");
61  switch (res) {
63  return kFALSE;
65  mult = GetIntReadPar(0);
66  break;
67  default:
68  return kFALSE;
69  }
70  evt->SetNumber(event_number);
71  for (Int_t mm = 0; mm < mult; mm += 1) {
72  auto nuc = evt->AddParticle();
73  if (!ReadNucleus(nuc)) return kFALSE;
74  }
75  return kTRUE;
76 }
77 
78 
79 
81 
83 {
84 
85  ReadLine(" ");
86  Int_t res = GetNparRead();
87  Int_t npar = 0;
88  switch (res) {
89  case 0:
90  Info("ReadNucleus", "case 0 line est vide");
91  return kFALSE;
92 
93  default:
94 
95  ReadLineAndAdd(" ");
96  npar = GetNparRead();
97  if (npar != 12) {
98  Info("ReadNucleus", "Nombre de parametres (%d) different de celui attendu(%d)", npar, 12);
99  return kFALSE;
100  }
103  nuc->GetParameters()->SetValue("density", GetDoubleReadPar(2));
105  nuc->GetParameters()->SetValue("spin", GetDoubleReadPar(4));
106  //Axe "faisceau dans SMF z"
109  nuc->GetParameters()->SetValue("avoir", GetDoubleReadPar(11));
110 
111  return kTRUE;
112  }
113 
114 }
115 
116 
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:224
@ 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
ReadStatus ReadLine(const KVString &pattern="")
Definition: KVFileReader.h:243
Double_t GetDoubleReadPar(Int_t pos) const
Definition: KVFileReader.h:334
ReadStatus ReadLineAndAdd(const KVString &pattern="")
Definition: KVFileReader.h:261
Int_t GetIntReadPar(Int_t pos) const
Definition: KVFileReader.h:338
Int_t GetNparRead() const
Definition: KVFileReader.h:325
KVString GetReadPar(Int_t pos) const
Definition: KVFileReader.h:342
void SetValue(const Char_t *name, value_type value)
void SetExcitEnergy(Double_t e)
Definition: KVNucleus.cpp:867
void SetA(Int_t a)
Definition: KVNucleus.cpp:658
void SetZ(Int_t z, Char_t mt=-1)
Definition: KVNucleus.cpp:709
KVNameValueList * GetParameters() const
Definition: KVParticle.h:818
void SetMomentum(const TVector3 &v)
Definition: KVParticle.h:581
Container class for simulated nuclei, KVSimNucleus.
Definition: KVSimEvent.h:22
Nucleus in a simulated event.
Definition: KVSimNucleus.h:32
void SetPosition(Double_t rx, Double_t ry, Double_t rz)
set the position of the nucleus in position space
Read ascii file for events of the SMF code after clusterization.
Bool_t ReadEvent(KVSimEvent *evt) override
KVSimReader_SMF()
Default constructor.
Bool_t ReadNucleus(KVSimNucleus *nuc) override
Bool_t ReadEventHeader(KVSimEvent *evt) override
void ConvertEventsInFile(KVString filename)
Definition: KVSimReader.cpp:24
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()
Int_t Nint(T x)
ClassImp(TPyArg)