#include "AliPythia.h"
#include "AliPythiaRndm.h"
#include "AliRun.h"
+#include "AliStack.h"
+#include "AliRunLoader.h"
- ClassImp(AliGenPythia)
+ClassImp(AliGenPythia)
AliGenPythia::AliGenPythia()
:AliGenMC()
// Default Constructor
fParticles = 0;
fPythia = 0;
+ fHeader = 0;
fDecayer = new AliDecayerPythia();
SetEventListRange();
SetJetPhiRange();
SetGammaPhiRange();
SetGammaEtaRange();
SetPtKick();
+ SetQuench();
+
fSetNuclei = kFALSE;
if (!AliPythiaRndm::GetPythiaRandom())
AliPythiaRndm::SetPythiaRandom(GetRandom());
fFlavorSelect = 0;
// Produced particles
fParticles = new TClonesArray("TParticle",1000);
- fEventVertex.Set(3);
+ fHeader = 0;
SetEventListRange();
SetJetPhiRange();
SetJetEtaRange();
SetGammaPhiRange();
SetGammaEtaRange();
SetJetReconstructionMode();
+ SetQuench();
SetPtKick();
// Options determining what to keep in the stack (Heavy flavour generation)
fStackFillOpt = kFlavorSelection; // Keep particle with selected flavor
}
AliGenPythia::AliGenPythia(const AliGenPythia & Pythia)
+ :AliGenMC(Pythia)
{
// copy constructor
Pythia.Copy(*this);
// Initialisation
SetMC(AliPythia::Instance());
- fPythia=(AliPythia*) fgMCEvGen;
+ fPythia=(AliPythia*) fMCEvGen;
//
fParentWeight=1./Float_t(fNpart);
//
void AliGenPythia::Generate()
{
// Generate one event
+
fDecayer->ForceDecay();
Float_t polar[3] = {0,0,0};
// event loop
while(1)
{
+ if (fQuench) {
+ fPythia->SetMSTJ(1, 0);
+ }
+
fPythia->Pyevnt();
+
+ if (fQuench) {
+ fPythia->Quench();
+ fPythia->SetMSTJ(1, 1);
+ fPythia->Pyexec();
+ }
+
+
if (gAlice->GetEvNumber()>=fDebugEventFirst &&
gAlice->GetEvNumber()<=fDebugEventLast) fPythia->Pylist(1);
fTrials++;
Float_t distz = iparticle->Vz()/10.;
if(TMath::Abs(distz)>fCutVertexZ*fOsigma[2]) continue;
//
- fEventVertex[0] = iparticle->Vx()/10.+fOrigin.At(0);
- fEventVertex[1] = iparticle->Vy()/10.+fOrigin.At(1);
- fEventVertex[2] = iparticle->Vz()/10.+fOrigin.At(2);
+ fVertex[0] = iparticle->Vx()/10.+fOrigin.At(0);
+ fVertex[1] = iparticle->Vy()/10.+fOrigin.At(1);
+ fVertex[2] = iparticle->Vz()/10.+fOrigin.At(2);
//
Int_t* pParent = new Int_t[np];
Int_t* pSelected = new Int_t[np];
// Track final state particle
if (ks == 1) trackIt[i] = 1;
// Track semi-stable particles
- if ((ks ==1) || (fDecayer->GetLifetime(kf) > fMaxLifeTime)) trackIt[i] = 1;
+ if ((ks == 1) || (fDecayer->GetLifetime(kf) > fMaxLifeTime)) trackIt[i] = 1;
// Track particles selected by process if undecayed.
if (fForceDecay == kNoDecay) {
if (ParentSelected(kf)) trackIt[i] = 1;
Float_t tof = kconv*iparticle->T();
Int_t ipa = iparticle->GetFirstMother()-1;
Int_t iparent = (ipa > -1) ? pParent[ipa] : -1;
- SetTrack(fTrackIt*trackIt[i] ,
+ PushTrack(fTrackIt*trackIt[i] ,
iparent, kf, p, origin, polar, tof, kPPrimary, nt, 1., ks);
pParent[i] = nt;
KeepTrack(nt);
- } // SetTrack loop
+ } // PushTrack loop
}
} else {
nc = GenerateMB();
} // event loop
SetHighWaterMark(nt);
// adjust weight due to kinematic selection
- AdjustWeights();
+// AdjustWeights();
// get cross-section
fXsection=fPythia->GetPARI(1);
}
origin[1] = fOrigin[1]+iparticle->Vy()/10.;
origin[2] = fOrigin[2]+iparticle->Vz()/10.;
Float_t tof=kconv*iparticle->T();
- SetTrack(fTrackIt*trackIt, iparent, kf, p, origin, polar,
+ PushTrack(fTrackIt*trackIt, iparent, kf, p, origin, polar,
tof, kPPrimary, nt, 1., ks);
KeepTrack(nt);
pParent[i] = nt;
void AliGenPythia::MakeHeader()
{
// Builds the event header, to be called after each event
- AliGenEventHeader* header = new AliGenPythiaEventHeader("Pythia");
+ if (fHeader) delete fHeader;
+ fHeader = new AliGenPythiaEventHeader("Pythia");
//
// Event type
- ((AliGenPythiaEventHeader*) header)->SetProcessType(fPythia->GetMSTI(1));
+ ((AliGenPythiaEventHeader*) fHeader)->SetProcessType(fPythia->GetMSTI(1));
//
// Number of trials
- ((AliGenPythiaEventHeader*) header)->SetTrials(fTrials);
+ ((AliGenPythiaEventHeader*) fHeader)->SetTrials(fTrials);
//
// Event Vertex
- header->SetPrimaryVertex(fEventVertex);
+ fHeader->SetPrimaryVertex(fVertex);
//
// Jets that have triggered
if (fProcess == kPyJets)
GetJets(njet, ntrig, jets);
for (Int_t i = 0; i < ntrig; i++) {
- ((AliGenPythiaEventHeader*) header)->AddJet(jets[0][i], jets[1][i], jets[2][i],
+ ((AliGenPythiaEventHeader*) fHeader)->AddJet(jets[0][i], jets[1][i], jets[2][i],
jets[3][i]);
}
}
- gAlice->SetGenEventHeader(header);
+ gAlice->SetGenEventHeader(fHeader);
}
AliGenPythia& AliGenPythia::operator=(const AliGenPythia& rhs)
{
// Assignment operator
+ rhs.Copy(*this);
return *this;
}
// Load event into Pythia Common Block
//
-
- Int_t npart = (Int_t) (gAlice->TreeK())->GetEntries();
+ AliRunLoader* rl = AliRunLoader::GetRunLoader();
+ Int_t npart = (rl->Stack())-> GetNprimary();
(fPythia->GetPyjets())->N = npart;
for (Int_t part = 0; part < npart; part++) {
- TParticle *MPart = gAlice->Particle(part);
+ TParticle *MPart = (rl->Stack())->Particle(part);
Int_t kf = MPart->GetPdgCode();
Int_t ks = MPart->GetStatusCode();
Float_t px = MPart->Px();
}
}
-void AliGenPythia::RecJetsUA1(Float_t eCellMin, Float_t eCellSeed, Float_t eMin, Float_t rMax,
- Int_t& njets, Float_t jets [4][50])
+void AliGenPythia::RecJetsUA1(Int_t& njets, Float_t jets [4][50])
{
//
// Calls the Pythia jet finding algorithm to find jets in the current event
if (
eta > fEtaMinJet && eta < fEtaMaxJet &&
- phi > fPhiMinJet && eta < fPhiMaxJet &&
+ phi > fPhiMinJet && phi < fPhiMaxJet &&
et > fEtMinJet && et < fEtMaxJet
)
{