// Defaults
if (pdg == 0) {
- index = kN - order;
+ index = fgkN - order;
newEntry = kFALSE;
}
// check fCounter
- if (newEntry && (fCounter > kN-3)) {
+ if (newEntry && (fCounter > fgkN-3)) {
Error("AliAfterBurnerFlow","Overflow");
return;
}
// and particle momentum (Pt, Y)
//
- Int_t index = kN - n; // default index
+ Int_t index = fgkN - n; // default index
Float_t v = 0;
// try to find specific parametrs
private:
- static const Int_t kN = 30;
+ static const Int_t fgkN = 30; // Size of array fParams
Float_t GetCoefficient(Int_t pdg, Int_t n, Float_t Pt, Float_t Y);
void SetFlowParameters(Int_t pdg, Int_t order, Int_t type, Float_t v1, Float_t v2, Float_t v3, Float_t v4);
Float_t fReactionPlane; // Reaction plane angle (in rad)
- Float_t fParams[kN][7]; // parameters (0: pdg, 1: order, 2: type, 3-6: actual parameters)
+ Float_t fParams[fgkN][7]; // parameters (0: pdg, 1: order, 2: type, 3-6: actual parameters)
Int_t fCounter; // counter
- public:
ClassDef(AliGenAfterBurnerFlow,2)
// Generator to simulate beam gas interactions.
// At present single interactions are read from an external file.
// Several interactions are combined in one event.
-
+// By default the vertex is smeared between +/- 20 m
+// Author: andreas.morsch@cern.ch
#include "AliGenBeamGas.h"
-#include "AliRun.h"
#include <TParticle.h>
-#include <TFile.h>
-#include <TTree.h>
ClassImp(AliGenBeamGas)
/* $Id$ */
+//
+// Generator to simulate beam gas interactions.
+// At present single interactions are read from an external file.
+// Author: andreas.morsch@cern.ch
#include "AliGenExtFile.h"
-#include "AliGenReader.h"
-
-class TTree;
class AliGenBeamGas : public AliGenExtFile
{
virtual void Init();
// generate event
virtual void Generate();
+ protected:
+ Int_t fInteractions; // Number of interactions
private:
void Copy(AliGenBeamGas&) const;
- protected:
- Int_t fInteractions;
- ClassDef(AliGenBeamGas,1) //Generate for beam gas interactions
+ ClassDef(AliGenBeamGas,1) //Generator for beam gas interactions
};
#endif
// 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"
/* $Id$ */
-/*
- Generator for particles in a preset
- kinematic range (flat distribution)
- Comments and suggestions: andreas.morsch@cern.ch
-*/
+
+// Generator for particles in a preset
+// kinematic range (flat distribution)
+// Comments and suggestions: andreas.morsch@cern.ch
+
#include "AliGenerator.h"
class AliGenBox : public AliGenerator
void FirstGeneratorPair(AliGenCocktailEntry*&e1, AliGenCocktailEntry*&e2);
void NextGeneratorPair (AliGenCocktailEntry*&e1, AliGenCocktailEntry*&e2);
AliGenCocktail & operator=(const AliGenCocktail & rhs);
- private:
- void Copy(AliGenCocktail &arun) const;
+
protected:
Int_t fNGenerators; // Number of generators booked
TList *fEntries; // List of Generators
TObjLink *flnk1; // ! Iterator for first generator
TObjLink *flnk2; // ! Iterator for second generator
//
+ private:
+ void Copy(AliGenCocktail &arun) const;
ClassDef(AliGenCocktail,1) // Particle cocktail generator a la SHAKER
};
void SetNBgEvents(Int_t nbg=0){fNBgEvents = nbg;}
static TMCProcess IntToMCProcess(Int_t no);
- private:
- void Copy(AliGenCocktailAfterBurner &arun) const;
+
protected:
Int_t fNAfterBurners; // Number of afterburners
TList *fAfterBurnerEntries;// List of afterburners
//needed by some afterburners that works better with higher statistics
//this generates such a artificial one
private:
-
+ void Copy(AliGenCocktailAfterBurner &arun) const;
+
ClassDef(AliGenCocktailAfterBurner,2) // Particle cocktail generator a la SHAKER
//background events added
};
void SetGenerator(AliGenerator* generator){fGenerator=generator;}
void SetFirst(Int_t first){fFirst=first;}
void SetLast (Int_t last ){fLast =last;}
- Int_t GetFirst(){return fFirst;}
- Int_t GetLast (){return fLast;}
- Float_t Rate(){return fRate;}
+ Int_t GetFirst() const {return fFirst;}
+ Int_t GetLast () const {return fLast;}
+ Float_t Rate() const {return fRate;}
void PrintInfo();
AliGenCocktailEntry & operator =(const AliGenCocktailEntry & rhs);
- private:
- void Copy(AliGenCocktailEntry&) const;
protected:
AliGenerator *fGenerator; // Pointer to generator
Int_t fNGenerated; // Number of primaries generated
Float_t fRate; // Rate per event
Float_t fKineBias; // Bias due to kinematic selecion
Float_t fBias; // Bias
+ void Copy(AliGenCocktailEntry&) const;
private:
ClassDef(AliGenCocktailEntry,1) // Generator entry of AliGenCocktail
};
void SetReader(AliGenReader* reader) {fReader = reader;}
protected:
void CdEventFile();
- private:
void Copy(AliGenExtFile&) const;
- protected:
const Text_t *fFileName; //! File to read from
AliGenReader *fReader; //! Reader to read the file
// generate event
virtual void Generate();
AliGenFLUKAsource & operator=(const AliGenFLUKAsource & rhs);
- private:
- void Copy(AliGenFLUKAsource &arun) const;
+
protected:
Int_t fIkine; // Flag to choose type of particles to be read
Float_t fPtg; // Pt of primary particle
Float_t fAge; // Time of flight
-
+ private:
+ void Copy(AliGenFLUKAsource &arun) const;
ClassDef(AliGenFLUKAsource,1) //Boundary source
};
// Simple particle gun.
// Momentum, phi and theta of the partice as well as the particle type can be set.
+// If fExplicit is true the user set momentum vector is used,
+// otherwise it is calculated.
// 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"
/* $Id$ */
// Simple particle gun.
-// Momentum, phi and theta of the partice as well as the particle type can be set.
+// Momentum, phi and theta of the particle as well as the particle type can be set.
// andreas.morsch@cern.ch
protected:
- Int_t fIpart; // Particle type
- Int_t fExplicit;
- Float_t fP[3];
+ Int_t fIpart; // Particle type
+ Int_t fExplicit; // True if momentum vector has been set by user.
+ Float_t fP[3]; // Momentum vector
ClassDef(AliGenFixed,1) // Single particle generator
};
-////////////////////////////////////////////////////////////////////////////////
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
//
// AliGenGeVSim is a class implementing GeVSim event generator.
//
//////////////////////////////////////////////////////////////////////////////////
-Bool_t AliGenGeVSim::CheckPtYPhi(Float_t pt, Float_t y, Float_t phi) {
+Bool_t AliGenGeVSim::CheckPtYPhi(Float_t pt, Float_t y, Float_t phi) const {
//
// private function used by Generate()
//
#ifndef ALIGENGEVSIM_H
#define ALIGENGEVSIM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
////////////////////////////////////////////////////////////////////////////////
//
Float_t GetdNdYToTotal();
- Bool_t CheckPtYPhi(Float_t pt, Float_t y, Float_t phi); // for histograms only
+ Bool_t CheckPtYPhi(Float_t pt, Float_t y, Float_t phi) const; // for histograms only
Bool_t CheckAcceptance(Float_t p[3]);
Float_t FindScaler(Int_t paramId, Int_t pdg);
// Fraction of events corresponding to the selected phi-range
Float_t phiFrac = (fPhiMax-fPhiMin)/2/TMath::Pi();
+
fParentWeight = Float_t(fNpart)/(intETASel*ptFrac*phiFrac);
+ if (fAnalog != 0) {
+ fPtWgtPi = (fPtMax - fPtMin) / fPtpi->Integral(0., 20.);
+ fPtWgtKa = (fPtMax - fPtMin) / fPtka->Integral(0., 20.);
+ fParentWeight = Float_t(fNpart)/(intETASel*phiFrac);
+ }
+
+
printf("%s: The number of particles in the selected kinematic region corresponds to %f percent of a full event\n ",
ClassName(),100.*fParentWeight);
const Int_t kKaons[4] = {kK0Long, kK0Short, kKPlus, kKMinus};
//
Float_t origin[3];
- Float_t pt, pl, ptot;
+ Float_t pt, pl, ptot, wgt;
Float_t phi, theta;
Float_t p[3];
Int_t i, part, j;
eventVertex[0] = origin[0];
eventVertex[1] = origin[1];
eventVertex[2] = origin[2];
-
+
for(i=0;i<fNpart;i++) {
while(1) {
- Rndm(random,3);
+ Rndm(random,4);
if(random[0]<kBorne) {
part=kPions[Int_t (random[1]*3)];
ptf=fPtpi;
etaf=fETApic;
+ wgt = fPtWgtPi;
} else {
part=kKaons[Int_t (random[1]*4)];
ptf=fPtka;
etaf=fETAkac;
+ wgt = fPtWgtKa;
}
phi=fPhiMin+random[2]*(fPhiMax-fPhiMin);
theta=2*TMath::ATan(TMath::Exp(-etaf->GetRandom()));
if(theta<fThetaMin || theta>fThetaMax) continue;
- pt=ptf->GetRandom();
+
+ if (fAnalog == 0) {
+ pt = ptf->GetRandom();
+ } else {
+ pt = fPtMin + random[3] * (fPtMax - fPtMin);
+ }
+
+
pl=pt/TMath::Tan(theta);
ptot=TMath::Sqrt(pt*pt+pl*pl);
if(ptot<fPMin || ptot>fPMax) continue;
TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
}
}
+
+ if (fAnalog == 0) {
+ wgt = fParentWeight;
+ } else {
+ wgt *= (fParentWeight * ptf->Eval(pt));
+ }
+
+
if (part == kPi0 && fPi0Decays){
//
// Decay pi0 if requested
TF1* fETAkac; // Parametrised eta distribution fro ka
AliDecayer* fDecayer; // ! Pointer to pythia object for decays
- private:
void DecayPi0(Float_t* orig, Float_t * p);
void Copy(AliGenHIJINGpara ¶) const;
ClassDef(AliGenHIJINGpara,3) // Hijing parametrisation generator
{
// eta-distribution
//____________________________________________________________
- const Float_t p0 = 1.10343e+02;
- const Float_t p1 = 1.73247e+01;
- const Float_t p2 = -7.23808e+00;
- const Float_t p3 = 4.48334e-01;
- const Double_t y = TMath::Abs(*py);
+ const Float_t kp0 = 1.10343e+02;
+ const Float_t kp1 = 1.73247e+01;
+ const Float_t kp2 = -7.23808e+00;
+ const Float_t kp3 = 4.48334e-01;
+ const Double_t ky = TMath::Abs(*py);
//
- return (p0+p1*y+p2*y*y+p3*y*y*y)/20.;
+ return (kp0+kp1*ky+kp2*ky*ky+kp3*ky*ky*ky)/20.;
}
AliGenHIJINGparaBa::AliGenHIJINGparaBa()
fPtba = 0;
}
+AliGenHIJINGparaBa::AliGenHIJINGparaBa(const AliGenHIJINGparaBa& para) : AliGenHIJINGpara(para)
+{
+// Copy constructor
+ para.Copy(*this);
+}
+
//_____________________________________________________________________________
AliGenHIJINGparaBa::~AliGenHIJINGparaBa()
{
/* $Id$ */
// Parameterisation of pi, K, n and p eta and pt distributions
+// eta: according to HIJING (shadowing + quenching)
+// pT : according to CDF measurement at 1.8 TeV
// Author: andreas.morsch@cern.ch
#include "AliGenHIJINGpara.h"
public:
AliGenHIJINGparaBa();
AliGenHIJINGparaBa(Int_t npart);
+ AliGenHIJINGparaBa(const AliGenHIJINGparaBa &HIJINGpara);
+ AliGenHIJINGparaBa& operator = (const AliGenHIJINGparaBa ¶)
+ {para.Copy(*this); return (*this);}
virtual ~AliGenHIJINGparaBa();
virtual void Generate();
virtual void Init();
//
// Transform into interaction rates
//
- const Float_t crossSection = 0.094e-28; // m^2
+ const Float_t kCrossSection = 0.094e-28; // m^2
Float_t pFlux[5] = {0.2, 0.2, 0.3, 0.3, 1.0};
for (j = 0; j < 5; j++) {
pFlux[j] *= 1.e11/25.e-9;
for (i = 0; i < 21; i++)
{
- fG1[i][j] = fG1[i][j] * crossSection * pFlux[j]; // 1/m/s
- fG2[i][j] = fG2[i][j] * crossSection * pFlux[j]; // 1/m/s
+ fG1[i][j] = fG1[i][j] * kCrossSection * pFlux[j]; // 1/m/s
+ fG2[i][j] = fG2[i][j] * kCrossSection * pFlux[j]; // 1/m/s
}
}
AliGenHaloProtvino & operator=(const AliGenHaloProtvino & rhs);
- private:
- void Copy(AliGenHaloProtvino&) const;
+
protected:
FILE* fFile; // ! Pointer to file
TString fFileName; // Choose the file
Int_t fNskip; // Number of entries to skip
Float_t fZ1[21], fZ2[21]; // ! z-positions for gas pressure tables
Float_t fG1[21][5], fG2[21][5]; // ! gas pressures
+ private:
+ void Copy(AliGenHaloProtvino&) const;
ClassDef(AliGenHaloProtvino,1) // LHC background boundary source (Protvino Group results)
+
+
};
#endif
virtual Int_t NextEvent() = 0;
virtual TParticle* NextParticle() = 0;
virtual void RewindEvent() = 0;
- enum Code_t {kPDG, kGEANT3};
+ typedef enum {kPDG, kGEANT3} Code_t;
void SetParticleCode(Code_t code) {fCode = code;}
AliGenReader & operator=(const AliGenReader & rhs);
/* $Id$ */
+//
+// Realisation of AliGenReader to be used with AliGenExtFile
+// It reads events from a ntuple like event structure.
+// Author: andreas.morsch@cern.ch
+//
#include "AliGenReader.h"
virtual TParticle* NextParticle();
virtual void RewindEvent(){;}
AliGenReaderCwn & operator=(const AliGenReaderCwn & rhs);
- private:
- void Copy(AliGenReaderCwn&) const;
protected:
Int_t fNcurrent; // points to the next entry
Float_t fPhi; // Phi
Float_t fP; // Total momentum
Float_t fE; // Total energy
+ private:
+ void Copy(AliGenReaderCwn&) const;
ClassDef(AliGenReaderCwn,1) // Read particles from cwn-ntuple
};
#endif
/* $Id$ */
+// Realisation of AliGenerator that generates particles with
+// vertices on a user defined grid.
+// The vertex positions can be smeared.
+// Momentum vectors are defined through the methods provided by AliGenerator.
+// Author: andreas.morsch@cern.ch
+
#include "AliGenScan.h"
#include "AliRun.h"
/* $Id$ */
+// Realisation of AliGenerator that generates particles with
+// vertices on a user defined grid.
+// Author: andreas.morsch@cern.ch
+
#include "AliGenerator.h"
class AliGenScan : public AliGenerator
/* $Id$ */
-////////////////////////////////////////////////////////////////////////
-//
-// generates n particles with in the same phi angle, varies theta
+
+// Generates n particles with in the same phi angle, varies theta
// in equidistant intervals
// This class is intended to use for studies of TPC response
// via merging with background event.
-//
// Note that for a given theta pt and p are not independent
// Range for only one variable (pt or p) should be given.
// Based on the AliGenBox class written by andreas.morsch@cern.ch
//
// Comments and suggestions: Jiri.Chudoba@cern.ch
-//
-////////////////////////////////////////////////////////////////////////
+
#include <TPDGCode.h>
/* $Id$ */
-/*
- generates n particles with in the same phi angle, varies theta
- in equidistant intervals
- Comments and suggestions: Jiri.Chudoba@cern.ch
-*/
+
+// Generates n particles with in the same phi angle, varies theta
+// In equidistant intervals
+// Comments and suggestions: Jiri.Chudoba@cern.ch
+
#include "AliGenerator.h"
class AliGenThetaSlice : public AliGenerator
/* $Id$ */
+// Helper class to interface pdflib and the TPythia
+// the c++ interface for Pythia
+// The pdf codes used in pdflib are mapped
+// to a more user friendly enumeration type.
+// Author: andreas.morsch@cern.ch
+
#include "AliStructFuncType.h"
#ifndef WIN32
-#ifndef ALISTRUCFUNCTYPE_H
-#define ALISTRUCFUNCTYPE_H
+#ifndef ALISTRUCTFUNCTYPE_H
+#define ALISTRUCTFUNCTYPE_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
+// Helper class to interface pdflib and the TPythia
+// the c++ interface for Pythia
+// Author: andreas.morsch@cern.ch
+
#include <TObject.h>
class AliStructFuncType : public TObject {