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 
16 {
17  // Default constructor
18  init();
19 }
20 
21 
22 
24 
26 {
27  init();
29 }
30 
31 
32 
34 
36 {
37 
38  mult = 0, mtotal = 0;
39  auto res = ReadLineAndCheck(2, " ");
40  switch (res) {
42  Info("ReadEvent", "case 0 line est vide");
43  return kFALSE;
45  mult = GetIntReadPar(0);
46  mtotal = GetIntReadPar(1);
47  evt->GetParameters()->SetValue("mult", mtotal);
48  break;
49  default:
50  return kFALSE;
51  }
52 
53  /*---------------------------------------------
54  Esa = excitation per nucleon
55  vcm = center of mass energy
56  Bparstore = impact parameter
57  PhiPlan = angle of the reaction plane
58  //---------------------------------------------
59  */
60 
61  fPhiPlan = gRandom->Rndm() * 2.*TMath::Pi();
62  rr.SetXEulerAngles(0., 0., fPhiPlan);
63 
64  res = ReadLineAndCheck(3, " ");
65  switch (res) {
67  return kFALSE;
69  evt->GetParameters()->SetValue("Esa", GetDoubleReadPar(0));
70  evt->GetParameters()->SetValue("vcm", GetDoubleReadPar(1));
71  evt->GetParameters()->SetValue("Bparstore", GetDoubleReadPar(2));
72  h1->Fill(evt->GetParameters()->GetDoubleValue("Bparstore"));
73  evt->GetParameters()->SetValue("PhiPlan", fPhiPlan);
74  break;
75  default:
76  return kFALSE;
77  }
78 
79  res = ReadLineAndCheck(3, " ");
80  switch (res) {
82  return kFALSE;
84  break;
85  default:
86  return kFALSE;
87  }
88  return kTRUE;
89 }
90 
91 
92 
94 
96 {
97 
98  auto res = ReadLineAndCheck(3, " ");
99  switch (res) {
101  Info("ReadNucleus", "case 0 line est vide");
102  return kFALSE;
103 
105  /*
106  proven = 0 -> fusion of the QP and QT
107  proven = 1 -> QP
108  proven = 2 -> QT
109  proven > 2 -> other
110  */
111  nuc->SetZ(GetIntReadPar(1));
112  nuc->SetA(GetIntReadPar(0));
113  nuc->GetParameters()->SetValue("proven", GetDoubleReadPar(2));
114  break;
115 
116  default:
117  return kFALSE;
118  }
119 
120  res = ReadLineAndCheck(3, " ");
121  switch (res) {
123  Info("ReadNucleus", "case 0 line est vide");
124  return kFALSE;
125 
127  //Axe "faisceau dans HIPSE x -> on effectue une rotation X,Y,Z -> Y,Z,X"
129  {
130  TVector3 vv = nuc->GetVelocity();
131  vv *= rr;
132  nuc->SetVelocity(vv);
133  }
134  break;
135  default:
136  return kFALSE;
137  }
138 
139  return true;
140 }
141 
142 
143 
147 
148 void KVSimReader_HIPSE_asym::define_output_filename()
149 {
150  // ROOT file called: HIPSE_[PROJ]_[TARG]_[EBEAM]AMeV_ASYM.root
151  // Call after reading file header
152 
153  SetROOTFileName(Form("HIPSE_%s_%s_%.1fAMeV_ASYM",
154  proj.GetSymbol(), targ.GetSymbol(), ebeam));
155  SetTreeTitle(Form("HIPSE secondary events %s + %s %.1f MeV/nuc.",
156  proj.GetSymbol(), targ.GetSymbol(), ebeam));
157 }
158 
159 
160 
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,...)
KVNameValueList * GetParameters() const
Definition: KVEvent.h:180
@ 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
Double_t GetDoubleReadPar(Int_t pos) const
Definition: KVFileReader.h:334
Int_t GetIntReadPar(Int_t pos) const
Definition: KVFileReader.h:338
Double_t GetDoubleValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
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
void SetVelocity(const TVector3 &)
Set velocity of particle (in cm/ns units)
TVector3 GetVelocity() const
returns velocity vector in cm/ns units
Container class for simulated nuclei, KVSimNucleus.
Definition: KVSimEvent.h:22
Nucleus in a simulated event.
Definition: KVSimNucleus.h:32
Converts final events of the HiPSE code after secondary decay.
Bool_t ReadEventHeader(KVSimEvent *) override
KVSimReader_HIPSE_asym()
Default constructor.
Bool_t ReadNucleus(KVSimNucleus *) override
Converts primary HiPSE events, after clusterization but before secondary decay.
void SetROOTFileName(KVString name)
Definition: KVSimReader.h:247
void SetTreeTitle(KVString n)
Definition: KVSimReader.h:237
void ConvertEventsInFile(KVString filename)
Definition: KVSimReader.cpp:24
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
virtual Int_t Fill(const char *name, Double_t w)
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)
TH1F * h1
void init()
constexpr Double_t Pi()
ClassImp(TPyArg)