1 #include "StarPythia6.h"
4 #include "StarCallf77.h"
5 #include "StarGenerator/EVENT/StarGenPPEvent.h"
6 #include "StarGenerator/EVENT/StarGenEPEvent.h"
7 #include "StarGenerator/EVENT/StarGenParticle.h"
9 #include "StarGenerator/UTIL/StarRandom.h"
13 #include "TGenericTable.h"
17 TGenericTable *regtable(
const Char_t *type,
const Char_t *name,
void *address )
20 table->
Adopt( 1, address );
21 _maker -> AddData( table,
".const" );
33 StarPythia6::StarPythia6(
const Char_t *name ) :
StarGenerator(name)
40 const Int_t decays[] = { 2, 3, 4, 5, 11, 12, 13, 14, 15 };
41 for ( UInt_t i=0;i<
sizeof(decays)/
sizeof(Int_t); i++ )
45 const Int_t docum[] = { 21, 31, 32, 41, 42, 51, 52 };
46 for ( UInt_t i=0;i<
sizeof(docum)/
sizeof(Int_t); i++ )
53 regtable(
"PyJets_t",
"pyjets", address_of_pyjets() );
54 regtable(
"PySubs_t",
"pysubs", address_of_pysubs() );
55 regtable(
"PyDat1_t",
"pydat1", address_of_pydat1() );
56 regtable(
"PyDat3_t",
"pydat3", address_of_pydat3() );
57 regtable(
"PyPars_t",
"pypars", address_of_pypars() );
58 regtable(
"PyInt5_t",
"pyint5", address_of_pyint5() );
99 std::map< TString, string > particle;
100 particle[
"proton"]=
"p";
119 return StMaker::Init();
136 mNumberOfParticles =
pyjets().n;
137 for ( Int_t idx=1; idx<=mNumberOfParticles; idx++ )
140 Int_t
id =
pyjets().k(idx,2);
141 Int_t stat = mStatusCode[
pyjets().k(idx,1) ];
145 Int_t m1 =
pyjets().k(idx,3);
147 Int_t d1 =
pyjets().k(idx,4);
148 Int_t d2 =
pyjets().k(idx,5);
149 Double_t px =
pyjets().p(idx,1);
150 Double_t py =
pyjets().p(idx,2);
151 Double_t pz =
pyjets().p(idx,3);
152 Double_t E =
pyjets().p(idx,4);
153 Double_t M =
pyjets().p(idx,5);
154 Double_t vx =
pyjets().v(idx,1);
155 Double_t vy =
pyjets().v(idx,2);
156 Double_t vz =
pyjets().v(idx,3);
157 Double_t vt =
pyjets().v(idx,4);
159 mEvent -> AddParticle( stat,
id, m1, m2, d1, d2, px, py, pz, E, M, vx, vy, vz, vt );
174 myevent -> idBlue =
pypars().msti(11);
175 myevent -> idYell =
pypars().msti(12);
176 myevent -> process =
pysubs().msel;
177 myevent -> subprocess =
pypars().msti(1);
179 myevent -> idParton1 =
pypars().msti(15);
180 myevent -> idParton2 =
pypars().msti(16);
181 myevent -> xParton1 =
pypars().pari(31);
182 myevent -> xParton2 =
pypars().pari(32);
183 myevent -> xPdf1 = 0;
184 myevent -> xPdf2 = 0;
185 myevent -> Q2fac =
pypars().pari(22);
186 myevent -> Q2ren = 0.;
187 myevent -> valence1 = -1;
188 myevent -> valence2 = -1;
190 myevent -> sHat =
pypars().pari(14);
191 myevent -> tHat =
pypars().pari(15);
192 myevent -> uHat =
pypars().pari(16);
193 myevent -> ptHat =
pypars().pari(17);
194 myevent -> thetaHat = TMath::ACos(
pypars().pari(41) );
195 myevent -> phiHat = -999;
197 myevent -> weight =
pypars().pari(7);
199 myevent -> mstu72 =
pydat1().mstu(72);
200 myevent -> mstu73 =
pydat1().mstu(73);
212 myevent -> idBlue =
pypars().msti(11);
213 myevent -> idYell =
pypars().msti(12);
214 myevent -> process =
pysubs().msel;
215 myevent -> subprocess =
pypars().msti(1);
218 Int_t
id =
pypars().msti(15);
219 Double_t x =
pypars().pari(31);
220 if ( TMath::Abs(
id)>6 ) {
id =
pypars().msti(16); x =
pypars().pari(32); }
221 myevent -> idParton = id;
222 myevent -> xParton = x;
226 myevent -> Q2 =
pypars().pari(22);
227 myevent -> weight =
pypars().pari(7);
233 StarGenStats stats(
"Pythia6Stats",
"Pythia 6 Run Statistics");
236 stats.nTried =
pyint5().ngen(0,1);
237 stats.nSelected =
pyint5().ngen(0,2);
238 stats.nAccepted =
pyint5().ngen(0,3);
239 stats.sigmaGen =
pyint5().xsec(0,3);
244 stats.nFilterSeen = stats.nAccepted;
245 stats.nFilterAccept = stats.nAccepted;
void FillEP(StarGenEvent *event)
(Optional) Method to fill a DIS event
void PyTune(Int_t tune)
Calls the pytune function.
Double_t mRootS
CMS energy or incident beam momentum for fixed target collisions.
static StarRandom & Instance()
Obtain the single instance of the random number generator.
TString mYell
Name of the yellow beam particle (-z)
PyDat3_t & pydat3()
Returns a reference to the /PYDAT3/ common block.
Event record class tailored to PP kinematics.
TLorentzVector mYellMomentum
4-Momentum of the yellow beam
ABC for defining event generator interfaces.
StarGenEvent * mEvent
Generated event.
void FillPP(StarGenEvent *event)
(Optional) Method to fill a PP event
PyInt5_t & pyint5()
Returns a reference to the /PYINT5/ common block.
void PyStat(Int_t stat)
Calls the pystat function.
TLorentzVector mBlueMomentum
4-Momentum of the blue beam
PyDat1_t & pydat1()
Returns a reference to the /PYDAT1/ common block.
PySubs_t & pysubs()
Returns a reference to the /PYSUBS/ common block.
Double_t flat() const
Return a random number uniformly distributed between 0 and 1.
End of run statistics for event generators.
StarGenStats Stats()
Create and retrieve end-of-run statistics.
PyJets_t & pyjets()
Returns a reference to the /PYJETS/ common block.
Base class for event records.
Event record class tailored to DIS kinemaics.
PyPars_t & pypars()
Returns a reference to the /PYPARS/ common block.
TString mFrame
Frame of the collision, i.e. CMS, FIXT, 3MOM, 4MOM, 5MOM.
TString mBlue
Name of the blue beam particle (+z)
void PyList(Int_t list)
Calls the pylist function.
virtual void Adopt(Int_t n, void *array)