Re: box generator [message #4274 is a reply to message #4272] |
Mon, 21 May 2007 09:54 |
Pablo Genova
Messages: 32 Registered: May 2007
|
continuous participant |
From: *PV.INFN.IT
|
|
Hi Stefano and Alicia,
one warning on the box generator: is it really uniform in theta? As Kasha and Felice Iazzi noticed the p components are generated uniformly in phi and in theta,
not uniformly in phi and cos(theta).
Do you agree that there is something strange?
ciao, Pablo
The code is the following from CmbBoxGenerator.cxx:
// Generate particles
for (Int_t k = 0; k < fMult; k++) {
phi = gRandom->Uniform(fPhiMin,fPhiMax) * TMath::DegToRad();
if (fPRangeIsSet ) pabs = gRandom->Uniform(fPMin,fPMax);
else if (fPtRangeIsSet) pt = gRandom->Uniform(fPtMin,fPtMax);
if (fThetaRangeIsSet) {
theta = gRandom->Uniform(fThetaMin,fThetaMax) * TMath::DegToRad();
}
else if (fEtaRangeIsSet) {
eta = gRandom->Uniform(fEtaMin,fEtaMax);
theta = 2*TMath::ATan(TMath::Exp(-eta));
}
else if (fYRangeIsSet) {
y = gRandom->Uniform(fYMin,fYMax);
mt = TMath::Sqrt(fPDGMass*fPDGMass + pt*pt);
pz = mt * TMath::SinH(y);
}
if (fThetaRangeIsSet || fEtaRangeIsSet) {
if (fPRangeIsSet ) {
pz = pabs*TMath::Cos(theta);
pt = pabs*TMath::Sin(theta);
}
else if (fPtRangeIsSet)
pz = pt/TMath::Tan(theta);
}
px = pt*TMath::Cos(phi);
py = pt*TMath::Sin(phi);
if (fBoxVtxIsSet) {
fX = gRandom->Uniform(fX1,fX2);
fY = gRandom->Uniform(fY1,fY2);
}
|
|
|