3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
9 // Base class for generators using external MC generators.
10 // For example AliGenPythia using Pythia.
11 // Provides basic functionality: setting of kinematic cuts on
12 // decay products and particle selection.
13 // andreas.morsch@cern.ch
21 #include "AliDecayer.h"
22 #include "AliGenerator.h"
24 class AliGenMC : public AliGenerator
28 AliGenMC(Int_t npart);
31 virtual void SetForceDecay(Decay_t decay = kAll) {fForceDecay = decay;}
32 virtual void SetCutOnChild(Int_t flag = 0) {fCutOnChild = flag;}
33 virtual void SetChildMomentumRange(Float_t pmin = 0, Float_t pmax = 1.e10)
34 {fChildPMin = pmin; fChildPMax = pmax;}
35 virtual void SetChildPtRange(Float_t ptmin = 0, Float_t ptmax = 20.)
36 {fChildPtMin = ptmin; fChildPtMax = ptmax;}
37 virtual void SetChildPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
38 {fChildPhiMin = TMath::Pi()*phimin/180;
39 fChildPhiMax = TMath::Pi()*phimax/180;}
40 virtual void SetChildThetaRange(Float_t thetamin = 0, Float_t thetamax = 180)
41 {fChildThetaMin = TMath::Pi()*thetamin/180;
42 fChildThetaMax = TMath::Pi()*thetamax/180;}
43 virtual void SetChildYRange(Float_t ymin = -12, Float_t ymax = 12)
46 virtual void SetMaximumLifetime(Float_t time = 1.e-15) {fMaxLifeTime = time;}
48 virtual void SetGeometryAcceptance(AliGeometry * GeometryAcceptance=0) {fGeometryAcceptance = GeometryAcceptance;}
50 virtual void SetPdgCodeParticleforAcceptanceCut(Int_t PdgCodeParticleforAcceptanceCut=0) {fPdgCodeParticleforAcceptanceCut = PdgCodeParticleforAcceptanceCut;}
52 virtual void SetNumberOfAcceptedParticles(Int_t NumberOfAcceptedParticles=2) {fNumberOfAcceptedParticles = NumberOfAcceptedParticles;}
54 virtual Bool_t CheckAcceptanceGeometry(Int_t np, TClonesArray* particles);
55 virtual void SetProjectile(TString proj="P", Int_t a = 1, Int_t z = 1)
56 {fProjectile = proj; fAProjectile = a; fZProjectile = z;}
57 virtual void SetTarget(TString tar="P", Int_t a = 1, Int_t z = 1)
58 {fTarget = tar; fATarget = a; fZTarget = z;}
59 virtual void SetCrossingAngle(Float_t phiX, Float_t phiY) {fXingAngleX = phiX; fXingAngleY = phiY;}
63 // check if particle is selected as parent particle
64 Bool_t ParentSelected(Int_t ip) const;
65 // check if particle is selected as child particle
66 Bool_t ChildSelected(Int_t ip) const;
67 // all kinematic selection cuts go here
68 Bool_t KinematicSelection(TParticle *particle, Int_t flag) const;
69 Int_t CheckPDGCode(Int_t pdgcode) const;
72 TClonesArray* fParticles; //!Particle List
73 TArrayI fParentSelect; //!Parent particles to be selected
74 TArrayI fChildSelect; //!Decay products to be selected
75 Int_t fCutOnChild; // Cuts on decay products (children) are enabled/disabled
76 Float_t fChildPtMin; // Children minimum pT
77 Float_t fChildPtMax; // Children maximum pT
78 Float_t fChildPMin; // Children minimum p
79 Float_t fChildPMax; // Children maximum p
80 Float_t fChildPhiMin; // Children minimum phi
81 Float_t fChildPhiMax; // Children maximum phi
82 Float_t fChildThetaMin; // Children minimum theta
83 Float_t fChildThetaMax; // Children maximum theta
84 Float_t fChildYMin; // Children minimum y
85 Float_t fChildYMax; // Children maximum y
86 Float_t fXingAngleX; // Crossing angle X
87 Float_t fXingAngleY; // Crossing angle Y
88 Decay_t fForceDecay; // Decay channel forced
89 Float_t fMaxLifeTime; // Maximum lifetime for unstable particles
90 Int_t fAProjectile; // Projectile A
91 Int_t fZProjectile; // Projectile Z
92 Int_t fATarget; // Target A
93 Int_t fZTarget; // Target Z
94 TString fProjectile; // Projectile
95 TString fTarget; // Target
96 Double_t fDyBoost; // dy for boost into lab frame
97 AliGeometry * fGeometryAcceptance; // Geometry to which particles must be simulated
98 Int_t fPdgCodeParticleforAcceptanceCut; // Abs(PDG Code) of the particle to which the GeometryAcceptance must be applied
99 Int_t fNumberOfAcceptedParticles; // Number of accepted particles in GeometryAcceptance with the right Abs(PdgCode)
102 AliGenMC(const AliGenMC &MC);
103 AliGenMC & operator=(const AliGenMC & rhs);
105 ClassDef(AliGenMC,5) // AliGenerator implementation for generators using MC methods