Home » PANDA » PandaRoot » Bugs, Fixes, Releases » box generator
() 1 Vote
box generator [message #4264] |
Wed, 16 May 2007 17:24 |
asanchez
Messages: 350 Registered: March 2006
|
first-grade participant |
From: *gsi.de
|
|
hi I want to use the box generator
to simulate one uniforme momentum distribution
my detector is at a Z-distance -76.5 cm
from the center of Panda.
I do the following selection
boxGen->SetPRange(.1,1.); // GeV/c
// boxGen->SetPtRange(1.,1.); // GeV/c
boxGen->SetPhiRange(0., 360.); // Azimuth angle range [degree]
boxGen->SetThetaRange(0., 180.); // Polar angle in lab system range [degree]
boxGen->SetXYZ(0.,10., -760.); // vertex coordinates [mm]
primGen->AddGenerator(boxGen);
but I get any hit in the detector.
is it something wrong with
the parameters.
thanks a lot
alicia
|
|
|
|
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);
}
|
|
|
|
Re: box generator [message #4276 is a reply to message #4275] |
Mon, 21 May 2007 10:30 |
Pablo Genova
Messages: 32 Registered: May 2007
|
continuous participant |
From: *PV.INFN.IT
|
|
Hi Stefano,
so we misunderstood the aim of the box generator.
The box generator is not a generator which generates uniformly on the solid angle, but it generates uniformly on theta, phi angles.
I mean, if one wants to generate isotropically in 3D with a fixed total momentum, or fixed transverse momentum, which is a common request, one has to generate uniformly on cos\theta and \phi and the cbmbox generator is NOT correct for this.
I thought it were!
I think it is really useful to have a 3d uniform generator not to be confused with the present box generator.
I do not understand completely the need for uniform generation on theta and phi variables, but this is not important.
ciao, Pablo
|
|
|
|
|
Re: box generator [message #4292 is a reply to message #4275] |
Tue, 22 May 2007 13:01 |
Katarzyna Szymanska
Messages: 1 Registered: May 2007 Location: Torino
|
occasional visitor |
From: *polito.it
|
|
Hi Stefano,
Few remarks concerning the direction generation:
1) the possible distributions of the (physically meaningful) directions are infinite: the uniform direction is the simplest, corresponds to the s-wave in the two-body kinematics and is mostly used to evaluate the relative acceptances and efficiencies at different solid angles
2) therefore, we think that the collaboration needs such a distribution which is generated by -1 < cos(theta) < +1 and 0 < phi < 360, both uniform.
3) neverthless, if someone uses the "uniform theta" distribution, which should peak the directions forward, one has the remember that the relative and absolute acceptances, efficiencies must be suitable normalized.
4) in any case, it will be useful to comment clearly the "uniform theta" distribution and its physical meaning in term of directions.
Regards,
Felice and Kasia
|
|
|
Re: box generator [message #4324 is a reply to message #4292] |
Thu, 24 May 2007 19:43 |
Pablo Genova
Messages: 32 Registered: May 2007
|
continuous participant |
From: *PV.INFN.IT
|
|
Hi Stefano and generators' people,
triggered also by Katarzyna and Felice, I checked the two generators, the former CbmBoxGenerator and the PndBoxGenerator with option SetCosTheta(), which Stefano wrote recently.
As they suggested, I used a detector consisting of a sphere, everything in vacuum.
You can see the results in the attached plots
1. box_NON_uniform.jpg : with uniform theta.
2. box_uniform.jpg : with uniform cos theta.
As expected the first plot shows enhanced momenta in region x=0 & y=0, i. e. along the zed axis , and only using the SetCosTheta option you get the truly uniform generation.
So everything is OK, but I would strongly suggest to put a comment a like: "if you want to generate uniformly in the solid angle use the SetCosTheta() function" or even call that function
SetUniform3D() , to avoid errors or misunderstandings.
Maybe even in the macros it is better to default to uniform distributions, with suitable comment to clear this to the user.
(I went into the mistake of supposing uniform what uniform was not!)
ciao, Pablo
ps: this forum is wonderful!
|
|
|
Goto Forum:
Current Time: Mon Nov 25 08:54:49 CET 2024
Total time taken to generate the page: 0.00662 seconds
|