StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
starsim.hijingstandalone.C
1 
12 class St_geant_Maker;
13 St_geant_Maker *geant_maker = 0;
14 
15 class StarGenEvent;
16 StarGenEvent *event = 0;
17 
18 class StarPrimaryMaker;
19 StarPrimaryMaker *_primary = 0;
20 
21 class StarHijing;
22 StarHijing *hijing = 0;
23 // ----------------------------------------------------------------------------
24 void trig( Int_t n=1 )
25 {
26  for ( Int_t i=0; i<n; i++ ) {
27  chain->Clear();
28  chain->Make();
29  _primary -> event() -> Print();
30  }
31 }
32 // ----------------------------------------------------------------------------
33 // ----------------------------------------------------------------------------
34 // ----------------------------------------------------------------------------
35 void Pythia6( TString mode="pp:W", Int_t tune=320 )
36 {
37 
38  // gSystem->Load( "libStarGeneratorPoolPythia6_4_23.so" );
39  gSystem->Load( "libPythia6_4_28.so");
40 
41  StarPythia6 *pythia6 = new StarPythia6("pythia6");
42  if ( mode=="pp:W" )
43  {
44  pythia6->SetFrame("CMS", 510.0 );
45  pythia6->SetBlue("proton");
46  pythia6->SetYell("proton");
47  if ( tune ) pythia6->PyTune( tune );
48 
49  // Setup pythia process
50  PySubs_t &pysubs = pythia6->pysubs();
51  int& msel = pysubs.msel;
52  msel = 12;
53 
54  // Setup other common block variables / array elements
55  float& ckin3 = pysubs.ckin(3);
56  ckin3 = 4.0;
57 
58  //
59  // Set particles to be stable so that the decay manager
60  // can handle them in the starsim phase
61  //
62  pythia6 -> SetDecayFlag( +24, 0 ); // W+
63  pythia6 -> SetDecayFlag( -24, 0 ); // W-
64  pythia6 -> SetDecayFlag( +23, 0 ); // Z0
65  pythia6 -> SetDecayFlag( -23, 0 ); // Z0
66  pythia6 -> SetDecayFlag( +15, 0 ); // tau+
67  pythia6 -> SetDecayFlag( -15, 0 ); // tau-
68 
69 
70  }
71  if ( mode == "pp:minbias" )
72  {
73  pythia6->SetFrame("CMS", 510.0 );
74  pythia6->SetBlue("proton");
75  pythia6->SetYell("proton");
76  if ( tune ) pythia6->PyTune( tune );
77  }
78  if ( mode == "ep" )
79  {
80  Double_t pblue[]={0.,0.,30.0};
81  Double_t pyell[]={0.,0.,-320.0};
82  pythia6->SetFrame("3MOM", pblue, pyell );
83  pythia6->SetBlue("e-");
84  pythia6->SetYell("proton");
85  if ( tune ) pythia6->PyTune( tune );
86  }
87 
88  _primary->AddGenerator(pythia6);
89 }
90 // ----------------------------------------------------------------------------
91 // ----------------------------------------------------------------------------
92 // ----------------------------------------------------------------------------
93 void Pythia8( TString config="pp:W", const char* _library="libPythia8_1_62.so" )
94 {
95  gSystem->Load( _library );
96 
97  //
98  // Create the pythia 8 event generator and add it to
99  // the primary generator
100  //
101  StarPythia8 *pythia8 = new StarPythia8();
102  if ( config=="pp:W" )
103  {
104  pythia8->SetFrame("CMS", 510.0);
105  pythia8->SetBlue("proton");
106  pythia8->SetYell("proton");
107 
108  pythia8->Set("WeakSingleBoson:all=off");
109  pythia8->Set("WeakSingleBoson:ffbar2W=on");
110  pythia8->Set("24:onMode=0"); // switch off all W+/- decaus
111  pythia8->Set("24:onIfAny 11 -11"); // switch on for decays to e+/-
112 
113  }
114  if ( config=="pp:minbias" )
115  {
116  pythia8->SetFrame("CMS", 510.0);
117  pythia8->SetBlue("proton");
118  pythia8->SetYell("proton");
119 
120  pythia8->Set("SoftQCD:minBias = on");
121  }
122 
123  _primary -> AddGenerator( pythia8 );
124 
125 }
126 // ----------------------------------------------------------------------------
127 void Hijing()
128 {
129  gSystem->Load( "libHijing1_383.so");
130 
131 
132  hijing = new StarHijing();
133  hijing->SetTitle("Hijing 1.383");
134 
135  // Setup collision frame, energy and beam species
136  hijing->SetFrame("CMS",200.0);
137  hijing->SetBlue("Au");
138  hijing->SetYell("Au");
139  hijing->SetImpact(0.0, 30.0); // Impact parameter min/max (fm) 0. 30.
140 
141 
142 
143  _primary -> AddGenerator(hijing);
144  _primary -> SetCuts( 1.0E-6 , -1., -2.5, +2.5 );
145 
146 }
147 // ----------------------------------------------------------------------------
148 // ----------------------------------------------------------------------------
149 // ----------------------------------------------------------------------------
150 void starsim( Int_t nevents=1000, UInt_t rngSeed = 12345 )
151 {
152 
153  gROOT->ProcessLine(".L bfc.C");
154  {
155  TString simple = "tables nodefault";
156  bfc(0, simple );
157  }
158 
159  gSystem->Load( "libVMC.so");
160  gSystem->Load( "St_g2t.so" );
161  gSystem->Load( "St_geant_Maker.so" );
162 
163  gSystem->Load( "StarGeneratorUtil.so" );
164  gSystem->Load( "StarGeneratorEvent.so" );
165  gSystem->Load( "StarGeneratorBase.so" );
166 
167  gSystem->Load( "libMathMore.so" );
168 
169  //
170  // Create the primary event generator and insert it
171  // before the geant maker
172  //
173  // StarPrimaryMaker *
174  _primary = new StarPrimaryMaker();
175  {
176  _primary -> SetFileName( "hijing.starsim.root");
177  // chain -> AddBefore( "geant", primary );
178  }
179 
180  //
181  // Setup an event generator
182  //
183  Hijing();
184 
185 
186  //
187  // Initialize random number generator
188  //
189  StarRandom &random = StarRandom::Instance();
190  random.capture(); // maps all ROOT TRandoms to StarRandom
191  random.seed( rngSeed );
192 
193 
194  //
195  // Setup cuts on which particles get passed to geant for
196  // simulation. (To run generator in standalone mode,
197  // set ptmin=1.0E9.)
198  // ptmin ptmax
199  _primary->SetPtRange (1.0E9, -1.0); // GeV
200  // etamin etamax
201  _primary->SetEtaRange ( -5.0, +5.0 );
202  // phimin phimax
203  _primary->SetPhiRange ( 0., TMath::TwoPi() );
204 
205 
206  //
207  // Fixed x, y, z vertex
208  //
209  _primary->SetVertex( 0., 0., 0. );
210  _primary->SetSigma( 0., 0., 0. );
211 
212  //
213  // Initialize primary event generator and all sub makers
214  //
215  _primary -> Init();
216 
217 
218  // Configure HIJING simulation
219 
220 
221  HiParnt_t &hiparnt = hijing->hiparnt();
222  {
223  hiparnt.ihpr2(4) = 0; // Jet quenching (1=yes/0=no) 0
224  hiparnt.ihpr2(3) = 0; // Hard scattering (1=yes/0=no)
225  //hiparnt.hipr1(10) = -2.5; // pT jet (negative indicates lower limit)
226  hiparnt.ihpr2(8) = 10; // Max number of jets / nucleon
227  hiparnt.ihpr2(11) = 1; // Set baryon production
228  hiparnt.ihpr2(12) = 1; // Turn on/off decay of particles [1=recommended]
229  hiparnt.ihpr2(18) = 0; // 1=B quark production. 0=C quark production.
230  hiparnt.hipr1(7) = 5.35; // Set B production ???? Not really used... Really ????
231 
232  // For more configuration options, see the HIJING manual
233  // http://ntc0.lbl.gov/~xnwang/hijing/doc.html
234  }
235  //
236  // Trigger on nevents
237  //
238  trig( nevents );
239 
240 }
241 // ----------------------------------------------------------------------------
242 
HIJING /HIPARNT/ common block/.
Definition: Hijing.h:79
void PyTune(Int_t tune)
Calls the pytune function.
Definition: StarPythia6.cxx:44
static StarRandom & Instance()
Obtain the single instance of the random number generator.
Definition: StarRandom.cxx:87
void SetSigma(Double_t sx, Double_t sy, Double_t sz, Double_t rho=0)
void SetFrame(const Char_t *frame, const Double_t val)
void SetImpact(Double_t bmin, Double_t bmax)
Set the minimum and maximum impact parameters for the collision (HI generators)
void SetPhiRange(Double_t phimin, Double_t phimax)
Set phi range. Particles falling outside this range will be dropped from simulation.
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
void AddGenerator(StarGenerator *gener)
void SetBlue(const Char_t *b)
Sets the particle species for the blue beam.
int & ihpr2(int i)
Definition: Hijing.h:94
A class for providing random number generation.
Definition: StarRandom.h:30
PySubs_t & pysubs()
Returns a reference to the /PYSUBS/ common block.
Definition: StarPythia6.h:61
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
Interface to pythia 6.
Definition: StarPythia6.h:48
Main steering class for event generation.
void SetYell(const Char_t *y)
Sets the particle species for the yellow beam.
void SetPtRange(Double_t ptmin, Double_t ptmax=-1)
Set PT range. Particles falling outside this range will be dropped from simulation.
static void capture()
Capture gRandom random number generator.
Definition: StarRandom.cxx:57
void SetEtaRange(Double_t etamin, Double_t etamax)
Set rapidity range. Particles falling outside this range will be dropped from simulation.
Int_t Init()
Definition: StarHijing.cxx:98
void Set(const char *s)
Pass a string to Pythia8::Pythia::readString(), for user configuration.
Definition: StarPythia8.h:91
void SetVertex(Double_t x, Double_t y, Double_t z)
Set the x, y and z vertex position.