]>
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; | |
23 | ||
24 | class AliPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction | |
25 | { | |
26 | public: | |
27 | AliPrimaryGeneratorAction(); | |
28 | // --> protected | |
29 | // AliPrimaryGeneratorAction(const AliPrimaryGeneratorAction& right); | |
30 | virtual ~AliPrimaryGeneratorAction(); | |
31 | ||
32 | // methods | |
33 | virtual void GeneratePrimaries(G4Event* event); | |
34 | ||
35 | // set methods | |
36 | void SetGenerator(AliPrimaryGenerator generator); | |
37 | void SetNofGunParticles(G4int nofParticles); | |
38 | void SetVerboseLevel(G4int level); | |
39 | ||
40 | // get methods | |
41 | AliPrimaryGenerator GetGenerator() const; | |
42 | G4int GetNofGunParticles() const; | |
43 | G4int GetVerboseLevel() const; | |
44 | ||
45 | protected: | |
46 | AliPrimaryGeneratorAction(const AliPrimaryGeneratorAction& right); | |
47 | ||
48 | // operators | |
49 | AliPrimaryGeneratorAction& operator=( | |
50 | const AliPrimaryGeneratorAction& right); | |
51 | ||
52 | private: | |
53 | // methods | |
54 | void ConstructGenerator(); | |
55 | void ConstructGeantinoGenerator(G4bool isCharged); | |
56 | void ConstructAliGenerator(); | |
57 | void GenerateAliGeneratorPrimaries(G4Event* event); | |
58 | ||
59 | // data members | |
60 | AliPrimaryGenerator fGenerator; //selected AliPrimaryGenerator | |
61 | G4int fNofGunParticles; //number of gun particles | |
62 | G4int fVerboseLevel; //verbose level | |
63 | AliParticleGun* fParticleGun; //AliParticleGun | |
676fb573 | 64 | AliPrimaryGeneratorMessenger* fMessenger; //messenger |
65 | }; | |
66 | ||
67 | // inline methods | |
68 | ||
69 | inline void AliPrimaryGeneratorAction::SetVerboseLevel(G4int level) | |
70 | { fVerboseLevel = level; } | |
71 | ||
72 | inline AliPrimaryGenerator AliPrimaryGeneratorAction::GetGenerator() const | |
73 | { return fGenerator; } | |
74 | ||
75 | inline G4int AliPrimaryGeneratorAction::GetNofGunParticles() const | |
76 | { return fNofGunParticles; } | |
77 | ||
78 | inline G4int AliPrimaryGeneratorAction::GetVerboseLevel() const | |
79 | { return fVerboseLevel; } | |
80 | ||
81 | #endif //ALI_PRIMARY_GENERATOR_ACTION_H | |
82 | ||
83 |