]>
Commit | Line | Data |
---|---|---|
676fb573 | 1 | // $Id$ |
2 | // Category: run | |
3 | // | |
4 | // Class that defines primary generator action. | |
5 | // Available primary generators (AliPrimaryGenerator): | |
6 | // kGun, // gun (can be set interactively) | |
7 | // kGeantino, // geantino with random direction | |
8 | // kChargedGeantino, // chargedgeantino with random direction | |
9 | // kAliGenerator // AliGenerator from AliRoot | |
10 | ||
11 | #ifndef ALI_PRIMARY_GENERATOR_ACTION_H | |
12 | #define ALI_PRIMARY_GENERATOR_ACTION_H | |
13 | ||
14 | #include "AliPrimaryGenerator.h" | |
15 | ||
16 | #include <G4VUserPrimaryGeneratorAction.hh> | |
17 | #include <globals.hh> | |
18 | ||
676fb573 | 19 | class AliParticleGun; |
20 | class AliPrimaryGeneratorMessenger; | |
21 | class G4ParticleGun; | |
22 | class G4Event; | |
c97337f9 | 23 | class TClonesArray; |
676fb573 | 24 | |
25 | class AliPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction | |
26 | { | |
27 | public: | |
28 | AliPrimaryGeneratorAction(); | |
29 | // --> protected | |
30 | // AliPrimaryGeneratorAction(const AliPrimaryGeneratorAction& right); | |
31 | virtual ~AliPrimaryGeneratorAction(); | |
32 | ||
33 | // methods | |
34 | virtual void GeneratePrimaries(G4Event* event); | |
35 | ||
36 | // set methods | |
37 | void SetGenerator(AliPrimaryGenerator generator); | |
38 | void SetNofGunParticles(G4int nofParticles); | |
39 | void SetVerboseLevel(G4int level); | |
40 | ||
41 | // get methods | |
42 | AliPrimaryGenerator GetGenerator() const; | |
43 | G4int GetNofGunParticles() const; | |
44 | G4int GetVerboseLevel() const; | |
45 | ||
46 | protected: | |
47 | AliPrimaryGeneratorAction(const AliPrimaryGeneratorAction& right); | |
48 | ||
49 | // operators | |
50 | AliPrimaryGeneratorAction& operator=( | |
51 | const AliPrimaryGeneratorAction& right); | |
52 | ||
53 | private: | |
54 | // methods | |
55 | void ConstructGenerator(); | |
56 | void ConstructGeantinoGenerator(G4bool isCharged); | |
57 | void ConstructAliGenerator(); | |
58 | void GenerateAliGeneratorPrimaries(G4Event* event); | |
59 | ||
60 | // data members | |
61 | AliPrimaryGenerator fGenerator; //selected AliPrimaryGenerator | |
62 | G4int fNofGunParticles; //number of gun particles | |
63 | G4int fVerboseLevel; //verbose level | |
64 | AliParticleGun* fParticleGun; //AliParticleGun | |
65 | TClonesArray* fParticleArray; //AliRun::fParticles | |
66 | AliPrimaryGeneratorMessenger* fMessenger; //messenger | |
67 | }; | |
68 | ||
69 | // inline methods | |
70 | ||
71 | inline void AliPrimaryGeneratorAction::SetVerboseLevel(G4int level) | |
72 | { fVerboseLevel = level; } | |
73 | ||
74 | inline AliPrimaryGenerator AliPrimaryGeneratorAction::GetGenerator() const | |
75 | { return fGenerator; } | |
76 | ||
77 | inline G4int AliPrimaryGeneratorAction::GetNofGunParticles() const | |
78 | { return fNofGunParticles; } | |
79 | ||
80 | inline G4int AliPrimaryGeneratorAction::GetVerboseLevel() const | |
81 | { return fVerboseLevel; } | |
82 | ||
83 | #endif //ALI_PRIMARY_GENERATOR_ACTION_H | |
84 | ||
85 |