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() );
100 std::map< TString, string > particle;
101 particle[
"proton"]=
"p";
120 return StMaker::Init();
137 mNumberOfParticles =
pyjets().n;
138 for ( Int_t idx=1; idx<=mNumberOfParticles; idx++ )
141 Int_t
id =
pyjets().k(idx,2);
142 Int_t stat = mStatusCode[
pyjets().k(idx,1) ];
146 Int_t m1 =
pyjets().k(idx,3);
148 Int_t d1 =
pyjets().k(idx,4);
149 Int_t d2 =
pyjets().k(idx,5);
150 Double_t px =
pyjets().p(idx,1);
151 Double_t py =
pyjets().p(idx,2);
152 Double_t pz =
pyjets().p(idx,3);
153 Double_t E =
pyjets().p(idx,4);
154 Double_t M =
pyjets().p(idx,5);
155 Double_t vx =
pyjets().v(idx,1);
156 Double_t vy =
pyjets().v(idx,2);
157 Double_t vz =
pyjets().v(idx,3);
158 Double_t vt =
pyjets().v(idx,4);
160 mEvent -> AddParticle( stat,
id, m1, m2, d1, d2, px, py, pz, E, M, vx, vy, vz, vt );
175 myevent -> idBlue =
pypars().msti(11);
176 myevent -> idYell =
pypars().msti(12);
177 myevent -> process =
pysubs().msel;
178 myevent -> subprocess =
pypars().msti(1);
180 myevent -> idParton1 =
pypars().msti(15);
181 myevent -> idParton2 =
pypars().msti(16);
182 myevent -> xParton1 =
pypars().pari(31);
183 myevent -> xParton2 =
pypars().pari(32);
184 myevent -> xPdf1 = 0;
185 myevent -> xPdf2 = 0;
186 myevent -> Q2fac =
pypars().pari(22);
187 myevent -> Q2ren = 0.;
188 myevent -> valence1 = -1;
189 myevent -> valence2 = -1;
191 myevent -> sHat =
pypars().pari(14);
192 myevent -> tHat =
pypars().pari(15);
193 myevent -> uHat =
pypars().pari(16);
194 myevent -> ptHat =
pypars().pari(17);
195 myevent -> thetaHat = TMath::ACos(
pypars().pari(41) );
196 myevent -> phiHat = -999;
198 myevent -> weight =
pypars().pari(7);
200 myevent -> mstu72 =
pydat1().mstu(72);
201 myevent -> mstu73 =
pydat1().mstu(73);
213 myevent -> idBlue =
pypars().msti(11);
214 myevent -> idYell =
pypars().msti(12);
215 myevent -> process =
pysubs().msel;
216 myevent -> subprocess =
pypars().msti(1);
219 Int_t
id =
pypars().msti(15);
220 Double_t x =
pypars().pari(31);
221 if ( TMath::Abs(
id)>6 ) {
id =
pypars().msti(16); x =
pypars().pari(32); }
222 myevent -> idParton = id;
223 myevent -> xParton = x;
227 myevent -> Q2 =
pypars().pari(22);
228 myevent -> weight =
pypars().pari(7);
234 StarGenStats stats(
"Pythia6Stats",
"Pythia 6 Run Statistics");
237 stats.nTried =
pyint5().ngen(0,1);
238 stats.nSelected =
pyint5().ngen(0,2);
239 stats.nAccepted =
pyint5().ngen(0,3);
240 stats.sigmaGen =
pyint5().xsec(0,3);
245 stats.nFilterSeen = stats.nAccepted;
246 stats.nFilterAccept = stats.nAccepted;
256 int kc = PyComp( kf );
261 LOG_WARN <<
"Incorrect kf = " << kf << endm;
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.
static void SetDecayFlag(const int kf, const int flag)
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.
static void PyGive(const char *give)
Calls the pygive function.
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)