// 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>
fDnDb = 0;
fPtMinJet = -2.5;
fRadiation = 3;
- fEventVertex.Set(3);
-//
+ //
SetSimpleJets();
SetNoGammas();
+ SetRandomPz();
+ SwitchOffHeavyQuarks(kFALSE);
//
fParticles = new TClonesArray("TParticle",10000);
//
}
-AliGenHijing::AliGenHijing(const AliGenHijing & Hijing)
+AliGenHijing::AliGenHijing(const AliGenHijing & hijing):
+ AliGenMC(hijing)
{
// copy constructor
}
fAProjectile, fZProjectile, fATarget, fZTarget,
fMinImpactParam, fMaxImpactParam));
- fHijing=(THijing*) fgMCEvGen;
+ fHijing=(THijing*) fMCEvGen;
fHijing->SetIHPR2(2, fRadiation);
fHijing->SetIHPR2(3, fTrigger);
fHijing->SetIHPR2(6, fShadowing);
fHijing->SetHIPR1(11, 2.5);
}
+//
+// Heavy quarks
+//
+ if (fNoHeavyQuarks) {
+ fHijing->SetIHPR2(49, 1);
+ } else {
+ fHijing->SetIHPR2(49, 0);
+ }
+
AliGenMC::Init();
Float_t polar[3] = {0,0,0};
Float_t origin[3] = {0,0,0};
Float_t origin0[3] = {0,0,0};
- Float_t p[3], random[6];
+ Float_t p[3];
Float_t tof;
// converts from mm/c to s
fTrials = 0;
for (j = 0;j < 3; j++) origin0[j] = fOrigin[j];
if(fVertexSmear == kPerEvent) {
- Float_t dv[3];
- dv[2] = 1.e10;
- while(TMath::Abs(dv[2]) > fCutVertexZ*fOsigma[2]) {
- Rndm(random,6);
- for (j=0; j < 3; j++) {
- dv[j] = fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
- TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
- }
- }
- for (j=0; j < 3; j++) origin0[j] += dv[j];
- } else if (fVertexSmear == kPerTrack) {
-// fHijing->SetMSTP(151,0);
- for (j = 0; j < 3; j++) {
-// fHijing->SetPARP(151+j, fOsigma[j]*10.);
- }
- }
+ Vertex();
+ 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++;
// Get event vertex
//
TParticle * iparticle = (TParticle *) fParticles->At(0);
- fEventVertex[0] = origin0[0];
- fEventVertex[1] = origin0[1];
- fEventVertex[2] = origin0[2];
+ fVertex[0] = origin0[0];
+ fVertex[1] = origin0[1];
+ fVertex[2] = origin0[2];
//
// First select parent particles
// --------------------------------------------------------------------------
// 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;
}
// --------------------------------------------------------------------------
//
TParticle * iparticle = (TParticle *) fParticles->At(i);
Bool_t hasMother = (iparticle->GetFirstMother() >=0);
Bool_t hasDaughter = (iparticle->GetFirstDaughter() >=0);
-
if (pSelected[i]) {
kf = iparticle->GetPdgCode();
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;
if (hasMother) {
imo = iparticle->GetFirstMother();
mother = (TParticle *) fParticles->At(imo);
- imo = (mother->GetPdgCode() != 92) ? imo = newPos[imo] : -1;
+ imo = (mother->GetPdgCode() != 92) ? newPos[imo] : -1;
} // if has mother
Bool_t tFlag = (fTrackIt && !hasDaughter);
- SetTrack(tFlag,imo,kf,p,origin,polar,
+ PushTrack(tFlag,imo,kf,p,origin,polar,
tof,kPNoProcess,nt, 1., ks);
+
+
KeepTrack(nt);
newPos[i] = nt;
} // if selected
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);
+ ((AliGenHijingEventHeader*) header)->SetReactionPlaneAngle(fHijing->GetHINT1(20));
+
+
// 4-momentum vectors of the triggered jets.
//
// Bookkeeping for kinematic bias
((AliGenHijingEventHeader*) header)->SetTrials(fTrials);
// Event Vertex
- header->SetPrimaryVertex(fEventVertex);
- gAlice->SetGenEventHeader(header);
+ header->SetPrimaryVertex(fVertex);
+ AddHeader(header);
fCollisionGeometry = (AliGenHijingEventHeader*) header;
}
+void AliGenHijing::AddHeader(AliGenEventHeader* header)
+{
+ // Passes header either to the container or to gAlice
+ if (fContainer) {
+ fContainer->AddHeader(header);
+ } else {
+ gAlice->SetGenEventHeader(header);
+ }
+}
+
+
Bool_t AliGenHijing::CheckTrigger()
{
// Check the kinematic trigger condition
}
-
+void AliGenHijing::Copy(TObject &) const
+{
+ Fatal("Copy","Not implemented!\n");
+}
AliGenHijing& AliGenHijing::operator=(const AliGenHijing& rhs)
{
-// Assignment operator
- return *this;
+ rhs.Copy(*this);
+ return (*this);
}