3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
9 #include <TClonesArray.h>
11 #include "AliGenerator.h"
12 #include "AliCRTConstants.h"
14 class AliGenCRT : public AliGenerator {
18 AliGenCRT(Int_t npart);
19 AliGenCRT(const AliGenCRT& gen);
20 AliGenCRT& operator= (const AliGenCRT& gen);
23 // Overloaded methods.
25 virtual void Generate();
26 virtual void SetPart(Int_t part) {fIpart = part;}
29 void SetMode(ECRMode mode) {fCRMode = mode;}
30 const TString* GetMode() const {return fCRModeName;}
32 void SetZenithalAngleRange(Float_t min,Float_t max=0) {fZenithMin=min;fZenithMax=max;}
33 void SetAzimuthalAngleRange(Float_t min, Float_t max=0) {fAzimuthMin=min;fAzimuthMax=max;}
35 void SetGridRange(Int_t nx,Float_t xwidth, Int_t nz, Float_t zwidth);
36 const Float_t GetMomentumResolution() const {return fPResolution;}
38 void SetMomentumDistrubutionFunction(TF1 *func) {fMomentumDist=func;}
39 void SetZenithalDistributionFunction(TF1 *func) {fZenithDist = func;}
40 void SetMomentumResolution(Float_t res=1.) {fPResolution=res;}
42 const Float_t GetMomentum() {return fMomentumDist->GetRandom();}
43 const Float_t GetZenithAngle(Float_t mom=0.);
45 // The following methods are for testing pourpuses
46 TF1* GetMomentumDistibution() {return fMomentumDist;}
47 TF1* GetUnfoldedDistribution() {return fUnfoldedMomentumDist;}
50 void InitApWeightFactors();
51 void InitMomentumGeneration();
52 void InitZenithalAngleGeneration();
54 Int_t fIpart; // Particle type.
55 ECRMode fCRMode; // Cosmic muons generation method flag
56 TString* fCRModeName; // Cosmic muons generation mode name
58 Float_t fXwidth; // X width of the grid
59 Int_t fNx; // Number of divisions in x
60 Float_t fZwidth; // Z widht of the grid
61 Int_t fNz; // Number of divisions in z
62 Bool_t fMuonGrid; // Flag for method (Muon-bundles) checkout
64 Float_t fZenithMin; // Minimum zenithal angle.
65 Float_t fZenithMax; // Maximum zenithal angle.
67 Float_t fAzimuthMin; // Minimum azimuthal angle.
68 Float_t fAzimuthMax; // Maximum azimuthal angle.
70 Float_t fPRange; // Cosmic muon momentum range width in GeVs.
71 Float_t fPResolution; // Momentum resolution in GeVs.
73 TArrayF* fAp; // a(p) weught factors for the ang. dist.
75 TF1* fMomentumDist; // Function to generate the momentum dist.
76 TF1* fUnfoldedMomentumDist;
77 TF1* fZenithDist; // Function to generate the zenith angle dist.
79 TClonesArray* fPDist; // Array of fZenithDist, to be used by a(p).
82 ClassDef(AliGenCRT, 0) // Generator for AliCRT class