/*
$Log$
+Revision 1.32 2001/01/26 19:55:51 hristov
+Major upgrade of AliRoot code
+
+Revision 1.31 2001/01/17 10:54:31 hristov
+Better protection against FPE
+
+Revision 1.30 2000/12/18 08:55:35 morsch
+Make AliPythia dependent generartors work with new scheme of random number generation
+
+Revision 1.29 2000/12/04 11:22:03 morsch
+Init of sRandom as in 1.15
+
+Revision 1.28 2000/12/02 11:41:39 morsch
+Use SetRandom() to initialize random number generator in constructor.
+
+Revision 1.27 2000/11/30 20:29:02 morsch
+Initialise static variable sRandom in constructor: sRandom = fRandom;
+
+Revision 1.26 2000/11/30 07:12:50 alibrary
+Introducing new Rndm and QA classes
+
+Revision 1.25 2000/10/18 19:11:27 hristov
+Division by zero fixed
+
+Revision 1.24 2000/09/18 10:41:35 morsch
+Add possibility to use nuclear structure functions from PDF library V8.
+
+Revision 1.23 2000/09/14 14:05:40 morsch
+dito
+
Revision 1.22 2000/09/14 14:02:22 morsch
- Correct conversion from mm to cm when passing particle vertex to MC.
- Correct handling of fForceDecay == all.
// structure function GRVHO
//
fXsection = 0.;
+ fNucA1=0;
+ fNucA2=0;
fParentSelect.Set(5);
fChildSelect.Set(5);
for (Int_t i=0; i<5; i++) fParentSelect[i]=fChildSelect[i]=0;
SetPtHard();
SetEnergyCMS();
fDecayer = new AliDecayerPythia();
+ // Set random number generator
+ sRandom=fRandom;
}
AliGenPythia::AliGenPythia(const AliGenPythia & Pythia)
fPythia->SetCKIN(3,fPtHardMin);
fPythia->SetCKIN(4,fPtHardMax);
+ if (fNucA1 > 0 && fNucA2 > 0) fPythia->SetNuclei(fNucA1, fNucA2);
fPythia->ProcInit(fProcess,fEnergyCMS,fStrucFunc);
// fPythia->Pylist(0);
pP[3] = massP;
gAlice->SetTrack(0,-1,-1,
pP,originP,polar,
- 0,"Hard Scat.",ntP,fParentWeight);
+ 0,kPPrimary,ntP,fParentWeight);
+// 0,"Hard Scat.",ntP,fParentWeight);
gAlice->KeepTrack(ntP);
}
nc++;
if (fForceDecay == nodecay) trackit = 1;
gAlice->SetTrack(trackit,ntP,kf,
p,origin,polar,
- 0,"Primary",nt,fParentWeight);
+ 0,kPPrimary,nt,fParentWeight);
gAlice->KeepTrack(nt);
Int_t iparent = nt;
//
Float_t tof=kconv*ichild->T();
gAlice->SetTrack(fTrackIt, iparent, kf,
p,origin,polar,
- tof,"Decay",nt,fChildWeight);
+ tof,kPDecay,nt,fChildWeight);
gAlice->KeepTrack(nt);
} // select child
} // child loop
origin[2]=origin0[2]+iparticle->Vz()/10.;
Float_t tof=kconv*iparticle->T();
gAlice->SetTrack(fTrackIt,-1,kf,p,origin,polar,
- tof,"Primary",nt);
+ tof,kPPrimary,nt);
gAlice->KeepTrack(nt);
} // select particle
} // particle loop
if (jev >= fNpart || fNpart == -1) {
fKineBias=Float_t(fNpart)/Float_t(fTrials);
printf("\n Trials: %i %i %i\n",fTrials, fNpart, jev);
+// Print x-section summary
+ fPythia->Pystat(1);
break;
}
}
//
// rapidity cut
- Float_t y = 0.5*TMath::Log((e+pz)/(e-pz));
- if (y > fYMax || y < fYMin)
- {
+ if ( (e-pz)<=0 || (e+pz)<=0 ) {
+ return kFALSE;
+ }
+ else {
+ Float_t y = 0.5*TMath::Log((e+pz)/(e-pz));
+ if (y > fYMax || y < fYMin)
+ {
// printf("\n failed y cut %f %f %f \n",y,fYMin,fYMax);
- return kFALSE;
+ return kFALSE;
+ }
}
//
{
// Adjust the weights after generation of all events
//
- TClonesArray *partArray = gAlice->Particles();
TParticle *part;
Int_t ntrack=gAlice->GetNtrack();
for (Int_t i=0; i<ntrack; i++) {
- part= (TParticle*) partArray->UncheckedAt(i);
+ part= gAlice->Particle(i);
part->SetWeight(part->GetWeight()*fKineBias);
}
}
//non diffractive state -- return code unchanged
return pdgcode;
}
-
+
+
+void AliGenPythia::SetNuclei(Int_t a1, Int_t a2)
+{
+// Treat protons as inside nuclei with mass numbers a1 and a2
+ fNucA1 = a1;
+ fNucA2 = a2;
+}
+
+
AliGenPythia& AliGenPythia::operator=(const AliGenPythia& rhs)
{
// Assignment operator
}
+
+#ifdef never
void AliGenPythia::Streamer(TBuffer &R__b)
{
// Stream an object of class AliGenPythia.
// fDecayer->Streamer(R__b);
}
}
-
-
-
-
-
-
-
+#endif