StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
starsim.hijing.hypertriton.C
1 // macro to instantiate the Geant3 from within
2 // STAR C++ framework and get the starsim prompt
3 // To use it do
4 // root4star starsim.C
5 
10 Int_t hid( Int_t z, Int_t a, Int_t l=0 )
11 {
12  // 10LZZZAAAI
13  return ( 1000000000
14  + 10000000*l
15  + 10000*z
16  + 10*a );
17 }
18 
19 class St_geant_Maker;
20 St_geant_Maker *geant_maker = 0;
21 
22 class StarGenEvent;
23 StarGenEvent *event = 0;
24 
25 class StarPrimaryMaker;
26 StarPrimaryMaker *_primary = 0;
27 
28 class StarKinematics;
30 
31 Float_t minPt = +0.1;
32 Float_t maxPt = +1.0;
33 Float_t minEta = -1.0;
34 Float_t maxEta = +1.0;
35 
36 // ----------------------------------------------------------------------------
37 void geometry( TString tag, Bool_t agml=true )
38 {
39  TString cmd = "DETP GEOM "; cmd += tag;
40  if ( !geant_maker ) geant_maker = (St_geant_Maker *)chain->GetMaker("geant");
41  geant_maker -> LoadGeometry(cmd);
42  // if ( agml ) command("gexec $STAR_LIB/libxgeometry.so");
43 }
44 // ----------------------------------------------------------------------------
45 void command( TString cmd )
46 {
47  if ( !geant_maker ) geant_maker = (St_geant_Maker *)chain->GetMaker("geant");
48  geant_maker -> Do( cmd );
49 }
50 // ----------------------------------------------------------------------------
51 void trig( Int_t n=0 )
52 {
53 
54  TString hyperTs = "HyperT_2body,HyperT_3body,HyperT_bar_2body,HyperT_bar_3body";
55 
56 
57  for ( Int_t i=0; i<n+1; i++ ) {
58  chain->Clear();
59  // Throw one hypertriton flat in -1 to 1 w/ momentum btwn 0.1 and 1 GeV
60  if (kinematics) kinematics->Kine( 1, hyperTs, minPt, maxPt, minEta, maxEta );
61  chain->Make();
62  command("gprint kine");
63  }
64 }
65 // ----------------------------------------------------------------------------
66 void HyperTritons()
67 {
68  gSystem->Load( "libKinematics.so");
69  kinematics = new StarKinematics("hyperTritons");
70  _primary -> AddGenerator(kinematics);
71 }
72 // ----------------------------------------------------------------------------
73 void Hijing()
74 {
75  StarHijing *hijing = new StarHijing("hijing");
76  hijing->SetTitle("Hijing 1.383");
77 
78  // Setup collision frame, energy and beam species
79  hijing->SetFrame("CMS",200.0);
80  hijing->SetBlue("Au");
81  hijing->SetYell("Au");
82  hijing->SetImpact(25.0, 26.0); // Impact parameter min/max (fm) 0. 30.
83  HiParnt_t &hiparnt = hijing->hiparnt();
84  {
85  hiparnt.ihpr2(4) = 0; // Jet quenching (1=yes/0=no) 0
86  hiparnt.ihpr2(3) = 0; // Hard scattering (1=yes/0=no)
87  hiparnt.hipr1(10) = 2.0; // pT jet
88  hiparnt.ihpr2(8) = 10; // Max number of jets / nucleon
89  hiparnt.ihpr2(11) = 1; // Set baryon production
90  hiparnt.ihpr2(12) = 1; // Turn on/off decay of particles [1=recommended]
91  hiparnt.ihpr2(18) = 0; // 0=charm production, 1=bottom prouction
92  hiparnt.hipr1(7) = 5.35; // Set B production ???? Not really used... Really ????
93  };
94 
95  // For more configuration options, see the HIJING manual
96  // http://ntc0.lbl.gov/~xnwang/hijing/doc.html
97 
98  _primary -> AddGenerator(hijing);
99  _primary -> SetCuts( 1.0E-6 , -1., -2.5, +2.5 );
100 
101 }
102 // ----------------------------------------------------------------------------
103 // ----------------------------------------------------------------------------
104 // ----------------------------------------------------------------------------
105 void starsim( Int_t nevents=200, Int_t rngSeed=4321 )
106 {
107 
108  gROOT->ProcessLine(".L bfc.C");
109  {
110  TString simple = "y2012 geant gstar usexgeom agml ";
111  //TString full = "tpcrs TpxRaw y2010a MakeEvent ITTF NoSvtIt NoSsdIt Idst IAna l0 ftpc Sti Tree logger genvtx tpcDB TpcHitMover TpxClu pmd bbcSim tofsim tags emcY2 EEfs evout IdTruth geantout -dstout big fzin MiniMcMk clearmem";
112  // TString full = "y2012 geant gstar tpcrs genvtx tpcDb tpxclu dedx event sdt20120224 ";
113  bfc(0, simple );
114  }
115 
116  gSystem->Load( "libVMC.so");
117 
118  gSystem->Load( "StarGeneratorUtil.so" );
119  gSystem->Load( "StarGeneratorEvent.so" );
120  gSystem->Load( "StarGeneratorBase.so" );
121  gSystem->Load( "libMathMore.so" );
122  gSystem->Load( "libHijing1_383.so");
123  gSystem->Load( "xgeometry.so" );
124 
125  // force gstar load/call...
126  gSystem->Load( "gstar.so" );
127  command("call gstar");
128 
129  // Setup RNG seed and map all ROOT TRandom here
130  StarRandom::seed( rngSeed );
132 
133  // Load STAR Particle DataBase and add the hypertriton definitions. Map to the
134  // decay modes as defined in gstar_part.g
136  pdb.AddParticle("HyperT_2body", new TParticlePDG( "HyperpT_2body", "HyperTriton --> He3 pi-", 2.99131, false, 0.0, +3.0, "hypernucleus", +hid(1,1,1), 0, 61053 ));
137  pdb.AddParticle("HyperT_bar_2body", new TParticlePDG( "HyperT_bar_2body", "AntiHyperTriton --> He3bar pi+", 2.99131, false, 0.0, -3.0, "hypernucleus", -hid(1,1,1), 0, 61054 ));
138  pdb.AddParticle("HyperT_3body", new TParticlePDG( "HyperT_3body", "HyperTriton --> d p pi-", 2.99131, false, 0.0, +3.0, "hypernucleus", +hid(1,1,1), 0, 62053 ));
139  pdb.AddParticle("HyperT_bar_3body", new TParticlePDG( "HyperT_bar_3body", "AntiHyperTriton --> dbar pbar pi+", 2.99131, false, 0.0, -3.0, "hypernucleus", -hid(1,1,1), 0, 62054 ));
140 
141 // Hypertriton will be phase-space decayed by geant
142 
143  //
144  // Create the primary event generator and insert it
145  // before the geant maker
146  //
147  _primary = new StarPrimaryMaker();
148  {
149  _primary -> SetFileName( "hijing.starsim.root");
150  chain -> AddBefore( "geant", _primary );
151  }
152 
153 
154 
155  // Setup an event generator
156  //
157  Hijing();
158  //
159  // Setup single hypertritons to be merrged on top
160  //
161  HyperTritons();
162 
163 
164  //
165  // Initialize primary event generator and all sub makers
166  //
167  _primary -> Init();
168 
169  //
170  // Setup geometry and set starsim to use agusread for input
171  //
172  //geometry("y2012");
173  command("gkine -4 0");
174  command("gfile o hijing.starsim.fzd");
175 
176  //
177  // Trigger on nevents
178  //
179  trig( nevents );
180  // command("gprint kine");
181 
182  command("call agexit"); // Make sure that STARSIM exits properly
183 
184 }
185 // ----------------------------------------------------------------------------
186 
HIJING /HIPARNT/ common block/.
Definition: Hijing.h:79
void SetFrame(const Char_t *frame, const Double_t val)
Star Simple Kinematics Generator.
void SetImpact(Double_t bmin, Double_t bmax)
Set the minimum and maximum impact parameters for the collision (HI generators)
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
static StarParticleData & instance()
Returns a reference to the single instance of this class.
Interface to PDG information.
void SetBlue(const Char_t *b)
Sets the particle species for the blue beam.
int & ihpr2(int i)
Definition: Hijing.h:94
void AddParticle(const Char_t *name, TParticlePDG *particle)
Add a particle to the database.
Int_t Init()
Initialize generator.
HiParnt_t & hiparnt()
Returns a reference to the hijing parameters.
Definition: StarHijing.h:58
float & hipr1(int i)
Definition: Hijing.h:90
Interface to the HIJING event generator.
Definition: StarHijing.h:48
virtual Int_t Make()
Definition: StChain.cxx:110
static void seed(UInt_t s)
Definition: StarRandom.cxx:119
Base class for event records.
Definition: StarGenEvent.h:81
Main steering class for event generation.
void SetYell(const Char_t *y)
Sets the particle species for the yellow beam.
static void capture()
Capture gRandom random number generator.
Definition: StarRandom.cxx:57
Sparse class to hold track kinematics.
void Kine(Int_t ntrack, const Char_t *type="pi+,pi-,K+,K-,proton,antiproton", Double_t ptlow=0.0, Double_t pthigh=500.0, Double_t ylow=-10.0, Double_t yhigh=+10.0, Double_t philow=0.0, Double_t phihigh=TMath::TwoPi())