// Generator using HIJING as an external generator
// The main HIJING options are accessable for the user through this interface.
// Uses the THijing implementation of TGenerator.
+// Author:
+// Andreas Morsch (andreas.morsch@cern.ch)
//
-// andreas.morsch@cern.ch
-#include <TArrayI.h>
#include <TGraph.h>
#include <THijing.h>
#include <TLorentzVector.h>
fAProjectile, fZProjectile, fATarget, fZTarget,
fMinImpactParam, fMaxImpactParam));
- fHijing=(THijing*) fgMCEvGen;
+ fHijing=(THijing*) fMCEvGen;
fHijing->SetIHPR2(2, fRadiation);
fHijing->SetIHPR2(3, fTrigger);
fHijing->SetIHPR2(6, fShadowing);
for (j=0; j < 3; j++) origin0[j] = fVertex[j];
}
+
+ Float_t sign = (fRandomPz && (Rndm() < 0.5))? -1. : 1.;
while(1)
{
// Generate one event
// --------------------------------------------------------------------------
- fSpecn = 0;
- fSpecp = 0;
+ fProjectileSpecn = 0;
+ fProjectileSpecp = 0;
+ fTargetSpecn = 0;
+ fTargetSpecp = 0;
// --------------------------------------------------------------------------
fHijing->GenerateEvent();
fTrials++;
// --------------------------------------------------------------------------
// Count spectator neutrons and protons
- if(ks == 0 || ks == 1 || ks == 10 || ks == 11){
- if(kf == kNeutron) fSpecn += 1;
- if(kf == kProton) fSpecp += 1;
+ if(ks == 0 || ks == 1){
+ if(kf == kNeutron) fProjectileSpecn += 1;
+ if(kf == kProton) fProjectileSpecp += 1;
+ }
+ else if(ks == 10 || ks == 11){
+ if(kf == kNeutron) fTargetSpecn += 1;
+ if(kf == kProton) fTargetSpecp += 1;
}
// --------------------------------------------------------------------------
//
ks = iparticle->GetStatusCode();
p[0] = iparticle->Px();
p[1] = iparticle->Py();
- p[2] = iparticle->Pz();
+ p[2] = iparticle->Pz() * sign;
origin[0] = origin0[0]+iparticle->Vx()/10;
origin[1] = origin0[1]+iparticle->Vy()/10;
origin[2] = origin0[2]+iparticle->Vz()/10;
return res;
}
-Bool_t AliGenHijing::Stable(TParticle* particle)
+Bool_t AliGenHijing::Stable(TParticle* particle) const
{
// Return true for a stable particle
//
fHijing->GetN01(),
fHijing->GetN10(),
fHijing->GetN11());
- ((AliGenHijingEventHeader*) header)->SetSpectators(fSpecn, fSpecp);
+ ((AliGenHijingEventHeader*) header)->SetSpectators(fProjectileSpecn, fProjectileSpecp,
+ fTargetSpecn,fTargetSpecp);
// 4-momentum vectors of the triggered jets.
//
((AliGenHijingEventHeader*) header)->SetTrials(fTrials);
// Event Vertex
header->SetPrimaryVertex(fVertex);
- gAlice->SetGenEventHeader(header);
+ if (gAlice) gAlice->SetGenEventHeader(header);
fCollisionGeometry = (AliGenHijingEventHeader*) header;
}
}
-void AliGenHijing::Copy(AliGenHijing &) const
+void AliGenHijing::Copy(TObject &) const
{
Fatal("Copy","Not implemented!\n");
}