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