GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Event Generators » PndBoxGenerator
PndBoxGenerator [message #4298] Tue, 22 May 2007 18:59 Go to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
After some discussions I wrote a new box generator inside pgenerators directory: PndBoxGenerator.

PndBoxGenerator is like CbmBoxGenerator, but I put one function in order to set uniform distributions in cos(theta), and not in theta as it is done by default.

Example:

If you want to have a unifor distribution i theta, you have to type in your simulation macro:


PndBoxGenerator* boxGen = new PndBoxGenerator(13, 1);
boxGen->SetPRange(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., 0., 0.); // vertex coordinates [cm]
primGen->AddGenerator(boxGen);



IF you want to have a unifor distribution in cos(theta):

PndBoxGenerator* boxGen = new PndBoxGenerator(13, 1);
boxGen->SetPRange(1.,1.); // GeV/c
boxGen->SetPhiRange(0., 360.); // Azimuth angle range [degree]
boxGen->SetThetaRange(0., 180.); // Polar angle in lab system range [degree]
boxGen->SetCosTheta(); // Set uniform ditribution in cos(theta)
boxGen->SetXYZ(0., 0., 0.); // vertex coordinates [cm]
primGen->AddGenerator(boxGen);


And that's all.
Enjoy...

Ste



[Updated on: Fri, 20 July 2007 13:51]

Report message to a moderator

Re: PndBoxGenerator -> distributions uniform in cos(theta) [message #4299 is a reply to message #4298] Tue, 22 May 2007 19:11 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
To show that the PndBoxGenerator works...

Comparison plots with the two methods:
RED - uniform theta
BLUE - uniform cos(theta)

Theta distributions
index.php?t=getfile&id=3549&private=0

Cos(Thata) distributions
index.php?t=getfile&id=3548&private=0

Yes, it works!
Re: PndBoxGenerator -> distributions uniform in 1/p [message #4721 is a reply to message #4299] Fri, 20 July 2007 13:59 Go to previous message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Hello,
I added in PndBoxGenerator a new option, in order to have distributions uniform in 1/p (sometimes is can be useful).

It works as the CosTheta function, so (example):

PndBoxGenerator* boxGen = new PndBoxGenerator(13, 1);
boxGen->SetPRange(0.1,15.);
boxGen->SetPhiRange(0., 360.);
boxGen->SetThetaRange(1., 12.);
boxGen->SetXYZ(0., 0., 0.);
primGen->AddGenerator(boxGen);


generates particles with a uniform distribution opver p in the fixed range, while if you add the boxGen->SetInverseP() function:

PndBoxGenerator* boxGen = new PndBoxGenerator(13, 1);
boxGen->SetPRange(0.1,15.);
boxGen->SetInverseP();
boxGen->SetPhiRange(0., 360.);
boxGen->SetThetaRange(1., 12.);
boxGen->SetXYZ(0., 0., 0.);
primGen->AddGenerator(boxGen);


you will have a distribution in the same range BUT uniform in 1/p. It works even with pt range (so uniform in 1/pt).

Enjoy.

P.S. meanwhile I corrected a missing initialization in the constructor, ad sone for CbmBoxGenerator.
Previous Topic: fluka events for test purposes
Next Topic: Basic Documentation
Goto Forum:
  


Current Time: Tue May 07 11:27:09 CEST 2024

Total time taken to generate the page: 0.00849 seconds