fBias(0.),
fTrials(0),
fDeltaPt(0.01),
+ fSelectAll(kFALSE),
fDecayer(0)
{
// Default constructor
}
//____________________________________________________________
-AliGenParam::AliGenParam(Int_t npart, AliGenLib * Library, Int_t param, char* tname)
+AliGenParam::AliGenParam(Int_t npart, const AliGenLib * Library, Int_t param, const char* tname)
:AliGenMC(npart),
fPtParaFunc(Library->GetPt(param, tname)),
fYParaFunc (Library->GetY (param, tname)),
fBias(0.),
fTrials(0),
fDeltaPt(0.01),
+ fSelectAll(kFALSE),
fDecayer(0)
{
// Constructor using number of particles parameterisation id and library
fBias(0.),
fTrials(0),
fDeltaPt(0.01),
+ fSelectAll(kFALSE),
fDecayer(0)
{
// Constructor using parameterisation id and number of particles
fBias(0.),
fTrials(0),
fDeltaPt(0.01),
+ fSelectAll(kFALSE),
fDecayer(0)
{
// Constructor
*/
//End_Html
char name[256];
- sprintf(name, "pt-parameterisation for %s", GetName());
+ snprintf(name, 256, "pt-parameterisation for %s", GetName());
if (fPtPara) fPtPara->Delete();
fPtPara = new TF1(name, fPtParaFunc, fPtMin, fPtMax,0);
fPtPara->SetNpx(npx);
- sprintf(name, "y-parameterisation for %s", GetName());
+ snprintf(name, 256, "y-parameterisation for %s", GetName());
if (fYPara) fYPara->Delete();
fYPara = new TF1(name, fYParaFunc, fYMin, fYMax, 0);
gROOT->GetListOfFunctions()->Remove(fYPara);
- sprintf(name, "pt-for-%s", GetName());
+ snprintf(name, 256, "pt-for-%s", GetName());
TF1 ptPara(name ,fPtParaFunc, 0, 15, 0);
- sprintf(name, "y-for-%s", GetName());
+ snprintf(name, 256, "y-for-%s", GetName());
TF1 yPara(name, fYParaFunc, -6, 6, 0);
//
//
Float_t polar[3]= {0,0,0}; // Polarisation of the parent particle (for GEANT tracking)
Float_t origin0[3]; // Origin of the generated parent particle (for GEANT tracking)
+ Float_t time0; // Time0 of the generated parent particle
Float_t pt, pl, ptot; // Transverse, logitudinal and total momenta of the parent particle
Float_t phi, theta; // Phi and theta spherical angles of the parent particle momentum
Float_t p[3], pc[3],
// Calculating vertex position per event
for (j=0;j<3;j++) origin0[j]=fOrigin[j];
+ time0 = fTimeOrigin;
if(fVertexSmear==kPerEvent) {
Vertex();
for (j=0;j<3;j++) origin0[j]=fVertex[j];
+ time0 = fTime;
}
Int_t ipa=0;
"Division by 0: Please check you rapidity range !");
}
- pl=xmt*ty/sqrt(1.-ty*ty);
+ pl=xmt*ty/sqrt((1.-ty)*(1.+ty));
theta=TMath::ATan2(pt,pl);
// Cut on theta
if(theta<fThetaMin || theta>fThetaMax) continue;
fOrigin[j]+fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
}
+ Rndm(random,2);
+ time0 = fTimeOrigin + fOsigma[2]/TMath::Ccgs()*
+ TMath::Cos(2*random[0]*TMath::Pi())*
+ TMath::Sqrt(-2*TMath::Log(random[1]));
}
// Looking at fForceDecay :
if (np >1) {
decayed = kTRUE;
- TParticle* iparticle = (TParticle *) particles->At(0);
+ TParticle* iparticle = 0;
Int_t ipF, ipL;
for (i = 1; i<np ; i++) {
trackIt[i] = 1;
//
// children
- if ((ChildSelected(TMath::Abs(kf)) || fForceDecay == kAll) && trackIt[i])
+ if ((ChildSelected(TMath::Abs(kf)) || fForceDecay == kAll || fSelectAll) && trackIt[i])
{
if (fCutOnChild) {
pc[0]=iparticle->Px();
// Parent
- PushTrack(0, -1, iPart, p, origin0, polar, 0, kPPrimary, nt, wgtp, ((decayed)? 11 : 1));
+ PushTrack(0, -1, iPart, p, origin0, polar, time0, kPPrimary, nt, wgtp, ((decayed)? 11 : 1));
pParent[0] = nt;
KeepTrack(nt);
fNprimaries++;
PushTrack(fTrackIt * trackIt[i], iparent, kf,
pc, och, polar,
- 0, kPDecay, nt, wgtch, ksc);
+ time0 + iparticle->T(), kPDecay, nt, wgtch, ksc);
pParent[i] = nt;
KeepTrack(nt);
fNprimaries++;
else // nodecay option, so parent will be tracked by GEANT (pions, kaons, eta, omegas, baryons)
{
gAlice->GetMCApp()->
- PushTrack(fTrackIt,-1,iPart,p,origin0,polar,0,kPPrimary,nt,wgtp, 1);
+ PushTrack(fTrackIt,-1,iPart,p,origin0,polar,time0,kPPrimary,nt,wgtp, 1);
ipa++;
fNprimaries++;
}
AliGenEventHeader* header = new AliGenEventHeader("PARAM");
header->SetPrimaryVertex(fVertex);
+ header->SetInteractionTime(fTime);
header->SetNProduced(fNprimaries);
AddHeader(header);
}