///////////////////////////////////////////////////////////////////
#include <TArrayF.h>
+#include <TCanvas.h>
#include <TClonesArray.h>
#include <TDatabasePDG.h>
#include <TF1.h>
#include <TH1.h>
-#include <TParticle.h>
#include <TPDGCode.h>
-#include <TCanvas.h>
-#include <TVirtualMC.h>
+#include <TParticle.h>
#include <TROOT.h>
+#include <TVirtualMC.h>
#include "AliConst.h"
#include "AliDecayer.h"
#include "AliGenEventHeader.h"
#include "AliGenHIJINGpara.h"
+#include "AliLog.h"
#include "AliRun.h"
ClassImp(AliGenHIJINGpara)
-AliGenHIJINGpara::AliGenHIJINGpara(const AliGenHIJINGpara & para):
- AliGenerator(para)
-{
-// Copy constructor
- para.Copy(*this);
-}
//_____________________________________________________________________________
-static Double_t ptpi(Double_t *px, Double_t *)
+static Double_t ptpi(const Double_t *px, const Double_t *)
{
//
// PT-PARAMETERIZATION CDF, PRL 61(88) 1819
//_____________________________________________________________________________
AliGenHIJINGpara::AliGenHIJINGpara()
- :AliGenerator()
+ :AliGenerator(),
+ fNt(-1),
+ fNpartProd(0),
+ fPi0Decays(kFALSE),
+ fPtWgtPi(0.),
+ fPtWgtKa(0.),
+ fPtpi(0),
+ fPtka(0),
+ fETApic(0),
+ fETAkac(0),
+ fDecayer(0)
{
//
// Default constructor
//
- fPtpi = 0;
- fPtka = 0;
- fETApic = 0;
- fETAkac = 0;
- fDecayer = 0;
- fNt = -1;
SetCutVertexZ();
SetPtRange();
- SetPi0Decays();
}
//_____________________________________________________________________________
AliGenHIJINGpara::AliGenHIJINGpara(Int_t npart)
- :AliGenerator(npart)
+ :AliGenerator(npart),
+ fNt(-1),
+ fNpartProd(npart),
+ fPi0Decays(kFALSE),
+ fPtWgtPi(0.),
+ fPtWgtKa(0.),
+ fPtpi(0),
+ fPtka(0),
+ fETApic(0),
+ fETAkac(0),
+ fDecayer(0)
{
//
// Standard constructor
//
fName="HIJINGpara";
fTitle="HIJING Parametrisation Particle Generator";
- fPtpi = 0;
- fPtka = 0;
- fETApic = 0;
- fETAkac = 0;
- fDecayer = 0;
- fNt = -1;
SetCutVertexZ();
SetPtRange();
- SetPi0Decays();
}
//_____________________________________________________________________________
Float_t phiFrac = (fPhiMax-fPhiMin)/2/TMath::Pi();
- fParentWeight = Float_t(fNpart)/(intETASel*ptFrac*phiFrac);
+ fParentWeight = (intETASel*ptFrac*phiFrac) / Float_t(fNpart);
if (fAnalog != 0) {
fPtWgtPi = (fPtMax - fPtMin) / fPtpi->Integral(0., 20.);
fPtWgtKa = (fPtMax - fPtMin) / fPtka->Integral(0., 20.);
- fParentWeight = Float_t(fNpart)/(intETASel*phiFrac);
+ fParentWeight = (intETASel*phiFrac) / Float_t(fNpart);
}
- printf("%s: The number of particles in the selected kinematic region corresponds to %f percent of a full event\n ",
- ClassName(),100.*fParentWeight);
+ AliInfo(Form("The number of particles in the selected kinematic region corresponds to %f percent of a full event",
+ 100./ fParentWeight));
// Issue warning message if etaMin or etaMax are outside the alowed range
// of the parametrization
if (etaMin < -8.001 || etaMax > 8.001) {
- printf("\n \n WARNING FROM AliGenHIJINGPara !");
- printf("\n YOU ARE USING THE PARAMETERISATION OUTSIDE ");
- printf("\n THE ALLOWED PSEUDORAPIDITY RANGE (-8. - 8.)");
- printf("\n YOUR LIMITS: %f %f \n \n ", etaMin, etaMax);
+ AliWarning("\nYOU ARE USING THE PARAMETERISATION OUTSIDE ");
+ AliWarning("THE ALLOWED PSEUDORAPIDITY RANGE (-8. - 8.)");
+ AliWarning(Form("YOUR LIMITS: %f %f \n ", etaMin, etaMax));
}
//
//
if (fPi0Decays && gMC)
fDecayer = gMC->GetDecayer();
+
+ if (fPi0Decays)
+ {
+ fDecayer->SetForceDecay(kNeutralPion);
+ fDecayer->Init();
+ }
+
}
TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
}
}
-
+
if (fAnalog == 0) {
wgt = fParentWeight;
} else {
if (part == kPi0 && fPi0Decays){
//
// Decay pi0 if requested
- PushTrack(0,-1,part,p,origin,polar,0,kPPrimary,fNt,fParentWeight);
+ PushTrack(0,-1,part,p,origin,polar,0,kPPrimary,fNt,wgt);
KeepTrack(fNt);
DecayPi0(origin, p);
} else {
- PushTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,fNt,fParentWeight);
+ // printf("fNt %d", fNt);
+ PushTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,fNt,wgt);
+
KeepTrack(fNt);
}
AliGenEventHeader* header = new AliGenEventHeader("HIJINGparam");
// Event Vertex
header->SetPrimaryVertex(eventVertex);
+ header->SetNProduced(fNpartProd);
gAlice->SetGenEventHeader(header);
}
//
Float_t polar[3] = {0., 0., 0.};
Int_t np = fDecayer->ImportParticles(particles);
- Int_t nt;
+ fNpartProd += (np-1);
+ Int_t nt = 0;
for (Int_t i = 1; i < np; i++)
{
TParticle* iParticle = (TParticle *) particles->At(i);
fNt = nt;
}
-void AliGenHIJINGpara::Copy(TObject &) const
-{
- Fatal("Copy","Not implemented!\n");
-}
-
-
void AliGenHIJINGpara::Draw( const char * /*opt*/)
{
//