// kinematic range (flat distribution)
// Note that for a given theta pt and p are not independent
// Range for only one variable (pt or p) should be given.
-//
// Comments and suggestions: andreas.morsch@cern.ch
-//
-//Begin_Html
-/*
-<img src="picts/AliGeneratorClass.gif">
-</pre>
-<br clear=left>
-<font size=+2 color=red>
-<p>The responsible person for this module is
-<a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
-</font>
-<pre>
-*/
-//End_Html
-// //
-///////////////////////////////////////////////////////////////////
+
#include "TPDGCode.h"
#include "AliConst.h"
#include "AliGenBox.h"
#include "AliRun.h"
+#include "AliGenEventHeader.h"
ClassImp(AliGenBox)
//_____________________________________________________________________________
AliGenBox::AliGenBox()
- :AliGenerator()
+ :AliGenerator(),
+ fIpart(0),
+ fEtaMin(0),
+ fEtaMax(0)
{
//
// Default constructor
//
- fIpart=0;
}
//_____________________________________________________________________________
AliGenBox::AliGenBox(Int_t npart)
- :AliGenerator(npart)
+ :AliGenerator(npart),
+ fIpart(kProton),
+ fEtaMin(0),
+ fEtaMax(0)
{
//
// Standard constructor
//
fName = "Box";
fTitle = "Box particle generator";
- // Generate Proton by default
- fIpart=kProton;
}
//_____________________________________________________________________________
for(i=0;i<fNpart;i++) {
Rndm(random,3);
- theta=fThetaMin+random[0]*(fThetaMax-fThetaMin);
+
+ if (TestBit(kThetaRange)) {
+ theta = fThetaMin+random[0]*(fThetaMax-fThetaMin);
+ } else {
+ Float_t eta = fEtaMin+random[0]*(fEtaMax-fEtaMin);
+ theta = 2. * TMath::ATan(TMath::Exp(-eta));
+ }
+
+
if(TestBit(kMomentumRange)) {
pmom=fPMin+random[1]*(fPMax-fPMin);
pt=pmom*TMath::Sin(theta);
pt=fPtMin+random[1]*(fPtMax-fPtMin);
pmom=pt/TMath::Sin(theta);
}
+
phi=fPhiMin+random[2]*(fPhiMax-fPhiMin);
p[0] = pt*TMath::Cos(phi);
p[1] = pt*TMath::Sin(phi);
}
PushTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
}
+
+ AliGenEventHeader* header = new AliGenEventHeader("BOX");
+ header->SetPrimaryVertex(fVertex);
+ header->SetNProduced(fNpart);
+
+ // Passes header either to the container or to gAlice
+ if (fContainer) {
+ fContainer->AddHeader(header);
+ } else {
+ gAlice->SetGenEventHeader(header);
+ }
}
//_____________________________________________________________________________