1 #include "StarHerwig6.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"
17 #define hwrgen F77_NAME(hwrgen, HWRGEN)
19 Double_t hwrgen( Int_t *idummy ){
37 for ( UInt_t i=0; i<101; i++)
55 hwproc().iproc = proccess;
68 std::map< TString, string > particle;
70 particle[
"proton"] =
"P ";
71 particle[
"e-"] =
"E- ";
76 Fatal(
GetName(),
"COM is an invalid frame for Herwig. Exiting");
91 std::vector<string> StableParticles;
93 StableParticles.push_back(
"PI0 ");
95 StableParticles.push_back(
"PI+ ");
97 StableParticles.push_back(
"ETA ");
99 StableParticles.push_back(
"K+ ");
101 StableParticles.push_back(
"K_S0 ");
103 StableParticles.push_back(
"K_L0 ");
105 StableParticles.push_back(
"LAMBDA ");
112 StableParticles.push_back(
"SIGMA+ ");
114 StableParticles.push_back(
"XI- ");
116 StableParticles.push_back(
"XI0 ");
118 StableParticles.push_back(
"OMEGA- ");
120 HWInit( StableParticles );
122 return StMaker::Init();
138 mNumberOfParticles =
hepevt().nhep;
139 for ( Int_t idx=1; idx<=mNumberOfParticles; idx++ )
142 Int_t
id =
hepevt().idhep(idx);
143 Int_t stat = mStatusCode[
hepevt().isthep(idx) ];
147 Int_t m1 =
hepevt().jmohep(idx,1);
148 Int_t m2 =
hepevt().jmohep(idx,2);
149 Int_t d1 =
hepevt().jdahep(idx,1);
150 Int_t d2 =
hepevt().jdahep(idx,2);
151 Double_t px =
hepevt().phep(idx,1);
152 Double_t py =
hepevt().phep(idx,2);
153 Double_t pz =
hepevt().phep(idx,3);
154 Double_t E =
hepevt().phep(idx,4);
155 Double_t M =
hepevt().phep(idx,5);
156 Double_t vx =
hepevt().vhep(idx,1);
157 Double_t vy =
hepevt().vhep(idx,2);
158 Double_t vz =
hepevt().vhep(idx,3);
159 Double_t vt =
hepevt().vhep(idx,4);
161 mEvent -> AddParticle( stat,
id, m1, m2, d1, d2, px, py, pz, E, M, vx, vy, vz, vt );
186 myevent -> idBlue =
hwbeam().ipart1;
187 myevent -> idYell =
hwbeam().ipart2;
188 myevent -> process = hwproc().iproc;
189 myevent -> subprocess = 0;
191 myevent -> idParton1 = -999;
192 myevent -> idParton2 = -999;
193 myevent -> xParton1 = hwhard().xx(1);
194 myevent -> xParton2 = hwhard().xx(2);
195 myevent -> xPdf1 = -999;
196 myevent -> xPdf2 = -999;
197 myevent -> Q2fac = -999;
198 myevent -> Q2ren = -999;
199 myevent -> valence1 = 0;
200 myevent -> valence2 = 0;
202 myevent -> sHat =
custom().hwmans;
203 myevent -> tHat =
custom().hwmant;
204 myevent -> uHat =
custom().hwmanu;
205 myevent -> ptHat = -999;
206 myevent -> thetaHat = -999;
207 myevent -> phiHat = -999;
209 myevent -> weight = -999;
220 myevent -> idBlue =
hwbeam().ipart1;
221 myevent -> idYell =
hwbeam().ipart2;
222 myevent -> process = hwproc().iproc;
223 myevent -> subprocess = 0;
225 myevent -> idParton1 = -999;
226 myevent -> idParton2 = -999;
227 myevent -> xParton1 = hwhard().xx(1);
228 myevent -> xParton2 = hwhard().xx(2);
229 myevent -> xPdf1 = -999;
230 myevent -> xPdf2 = -999;
231 myevent -> Q2fac = -999;
232 myevent -> Q2ren = -999;
233 myevent -> valence1 = 0;
234 myevent -> valence2 = 0;
236 myevent -> sHat =
custom().hwmans;
237 myevent -> tHat =
custom().hwmant;
238 myevent -> uHat =
custom().hwmanu;
239 myevent -> ptHat = -999;
240 myevent -> thetaHat = -999;
241 myevent -> phiHat = -999;
243 myevent -> weight = -999;
StarHerwig6(const Char_t *name="Herwig6")
static StarRandom & Instance()
Obtain the single instance of the random number generator.
TString mYell
Name of the yellow beam particle (-z)
HEPEVT_t & hepevt()
HEPEVT Standard event common block.
void HWFinish()
HWFinish cleans up after Herwig.
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 Clear(const Option_t *opts)
TLorentzVector mBlueMomentum
4-Momentum of the blue beam
Double_t flat() const
Return a random number uniformly distributed between 0 and 1.
void HWInit(std::vector< string > particles)
HWInit runs all of the fortan functions necessary to initialize Herwig and get it ready to generate e...
Base class for event records.
virtual const char * GetName() const
special overload
void SetProcess(Int_t proccess)
SetProcess sets the Herwig process.
void SetBeams(std::string beam1, std::string beam2)
SetBeams reaches into a common block and sets the beam species.
Event record class tailored to DIS kinemaics.
void FillEP(StarGenEvent *event)
(Optional) Method to fill a DIS event
TString mFrame
Frame of the collision, i.e. CMS, FIXT, 3MOM, 4MOM, 5MOM.
TString mBlue
Name of the blue beam particle (+z)
void HWGenerate()
HWGenerate runs all of the fortran functions necessary to generate a Herwig event.
CUSTOM_t & custom()
Custom common block to make certain variables accessible.
void FillPP(StarGenEvent *event)
(Optional) Method to fill a PP event
HWBEAM_t & hwbeam()
HWBEAM, HWBMCH, HWPROC: Beams, process, and number of events.