// Andreas Morsch (andreas.morsch@cern.ch)
//
+#include <TClonesArray.h>
#include <TGraph.h>
#include <THijing.h>
#include <TLorentzVector.h>
fEvaluate(0),
fSelectAll(0),
fFlavor(0),
- fEnergyCMS(5500.),
fKineBias(0.),
fTrials(0),
fXsection(0.),
fRandomPz(kFALSE),
fNoHeavyQuarks(kFALSE)
{
-// Constructor
- fParticles = 0;
- AliHijingRndm::SetHijingRandom(GetRandom());
+ // Constructor
+ fEnergyCMS = 5500.;
+ AliHijingRndm::SetHijingRandom(GetRandom());
}
AliGenHijing::AliGenHijing(Int_t npart)
fEvaluate(0),
fSelectAll(0),
fFlavor(0),
- fEnergyCMS(5500.),
fKineBias(0.),
fTrials(0),
fXsection(0.),
{
// Default PbPb collisions at 5. 5 TeV
//
+ fEnergyCMS = 5500.;
fName = "Hijing";
fTitle= "Particle Generator using HIJING";
//
- fParticles = new TClonesArray("TParticle",10000);
//
// Set random number generator
AliHijingRndm::SetHijingRandom(GetRandom());
}
-AliGenHijing::AliGenHijing(const AliGenHijing & hijing):
- AliGenMC(hijing),
- fFrame("CMS"),
- fMinImpactParam(0.),
- fMaxImpactParam(5.),
- fKeep(0),
- fQuench(1),
- fShadowing(1),
- fDecaysOff(1),
- fTrigger(0),
- fEvaluate(0),
- fSelectAll(0),
- fFlavor(0),
- fEnergyCMS(5500.),
- fKineBias(0.),
- fTrials(0),
- fXsection(0.),
- fHijing(0),
- fPtHardMin(0.),
- fPtHardMax(1.e4),
- fSpectators(1),
- fDsigmaDb(0),
- fDnDb(0),
- fPtMinJet(-2.5),
- fEtaMinJet(-20.),
- fEtaMaxJet(+20.),
- fPhiMinJet(0.),
- fPhiMaxJet(2. * TMath::Pi()),
- fRadiation(3),
- fSimpleJet(kFALSE),
- fNoGammas(kFALSE),
- fProjectileSpecn(0),
- fProjectileSpecp(0),
- fTargetSpecn(0),
- fTargetSpecp(0),
- fLHC(kFALSE),
- fRandomPz(kFALSE),
- fNoHeavyQuarks(kFALSE)
-{
-// copy constructor
-}
-
-
AliGenHijing::~AliGenHijing()
{
// Destructor
if ( fDsigmaDb) delete fDsigmaDb;
if ( fDnDb) delete fDnDb;
- delete fParticles;
}
void AliGenHijing::Init()
Float_t tof;
// converts from mm/c to s
- const Float_t kconv = 0.001/2.999792458e8;
+ const Float_t kconv = 0.001/2.99792458e8;
//
Int_t nt = 0;
Int_t jev = 0;
fTrials = 0;
+
for (j = 0;j < 3; j++) origin0[j] = fOrigin[j];
if(fVertexSmear == kPerEvent) {
Vertex();
// --------------------------------------------------------------------------
fHijing->GenerateEvent();
fTrials++;
- fHijing->ImportParticles(fParticles,"All");
+ fNprimaries = 0;
+ fHijing->ImportParticles(&fParticles,"All");
if (fTrigger != kNoTrigger) {
if (!CheckTrigger()) continue;
}
if (fLHC) Boost();
- Int_t np = fParticles->GetEntriesFast();
+ Int_t np = fParticles.GetEntriesFast();
printf("\n **************************************************%d\n",np);
Int_t nc = 0;
if (np == 0 ) continue;
// Get event vertex
//
- TParticle * iparticle = (TParticle *) fParticles->At(0);
+ TParticle * iparticle = (TParticle *) fParticles.At(0);
fVertex[0] = origin0[0];
fVertex[1] = origin0[1];
fVertex[2] = origin0[2];
//
for (i = 0; i < np; i++) {
- iparticle = (TParticle *) fParticles->At(i);
+ iparticle = (TParticle *) fParticles.At(i);
// Is this a parent particle ?
if (Stable(iparticle)) continue;
//
for (i = 0; i<np; i++) {
- TParticle * iparticle = (TParticle *) fParticles->At(i);
+ iparticle = (TParticle *) fParticles.At(i);
// Is this a final state particle ?
if (!Stable(iparticle)) continue;
// Write particles to stack
for (i = 0; i<np; i++) {
- TParticle * iparticle = (TParticle *) fParticles->At(i);
+ iparticle = (TParticle *) fParticles.At(i);
Bool_t hasMother = (iparticle->GetFirstMother() >=0);
Bool_t hasDaughter = (iparticle->GetFirstDaughter() >=0);
if (pSelected[i]) {
TParticle* mother = 0;
if (hasMother) {
imo = iparticle->GetFirstMother();
- mother = (TParticle *) fParticles->At(imo);
+ mother = (TParticle *) fParticles.At(imo);
imo = (mother->GetPdgCode() != 92) ? newPos[imo] : -1;
} // if has mother
Bool_t tFlag = (fTrackIt && !hasDaughter);
PushTrack(tFlag,imo,kf,p,origin,polar,tof,kPNoProcess,nt, 1., ks);
-
-
+ fNprimaries++;
KeepTrack(nt);
newPos[i] = nt;
} // if selected
imin = iparticle->GetFirstDaughter();
imax = iparticle->GetLastDaughter();
for (i = imin; i <= imax; i++){
- TParticle * jparticle = (TParticle *) fParticles->At(i);
+ TParticle * jparticle = (TParticle *) fParticles.At(i);
Int_t ip = jparticle->GetPdgCode();
if (KinematicSelection(jparticle,0)&&SelectFlavor(ip)) {
selected=kTRUE; break;
{
// Builds the event header, to be called after each event
AliGenEventHeader* header = new AliGenHijingEventHeader("Hijing");
- ((AliGenHijingEventHeader*) header)->SetNProduced(fHijing->GetNATT());
+ ((AliGenHijingEventHeader*) header)->SetNProduced(fNprimaries);
((AliGenHijingEventHeader*) header)->SetImpactParameter(fHijing->GetHINT1(19));
((AliGenHijingEventHeader*) header)->SetTotalEnergy(fHijing->GetEATT());
((AliGenHijingEventHeader*) header)->SetHardScatters(fHijing->GetJATT());
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()
{
} else if (fTrigger == 2) {
// Gamma Jet
//
- Int_t np = fParticles->GetEntriesFast();
+ Int_t np = fParticles.GetEntriesFast();
for (Int_t i = 0; i < np; i++) {
- TParticle* part = (TParticle*) fParticles->At(i);
+ TParticle* part = (TParticle*) fParticles.At(i);
Int_t kf = part->GetPdgCode();
Int_t ksp = part->GetUniqueID();
if (kf == 22 && ksp == 40) {
} // fTrigger == 2
return triggered;
}
-
-
-void AliGenHijing::Copy(TObject &) const
-{
- Fatal("Copy","Not implemented!\n");
-}
-
-AliGenHijing& AliGenHijing::operator=(const AliGenHijing& rhs)
-{
- rhs.Copy(*this);
- return (*this);
-}
-