]>
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 | ||
18 | #include "AliPrimaryGenerator.h" | |
7005154f | 19 | #include "AliPrimaryGeneratorMessenger.h" |
20 | #include "AliParticleGun.h" | |
676fb573 | 21 | |
22 | #include <G4VUserPrimaryGeneratorAction.hh> | |
23 | #include <globals.hh> | |
24 | ||
676fb573 | 25 | class AliParticleGun; |
676fb573 | 26 | class G4ParticleGun; |
27 | class G4Event; | |
28 | ||
29 | class AliPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction | |
30 | { | |
31 | public: | |
32 | AliPrimaryGeneratorAction(); | |
676fb573 | 33 | virtual ~AliPrimaryGeneratorAction(); |
34 | ||
35 | // methods | |
36 | virtual void GeneratePrimaries(G4Event* event); | |
37 | ||
38 | // set methods | |
39 | void SetGenerator(AliPrimaryGenerator generator); | |
40 | void SetNofGunParticles(G4int nofParticles); | |
41 | void SetVerboseLevel(G4int level); | |
42 | ||
43 | // get methods | |
44 | AliPrimaryGenerator GetGenerator() const; | |
45 | G4int GetNofGunParticles() const; | |
46 | G4int GetVerboseLevel() const; | |
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 | |
58 | G4int fVerboseLevel; //verbose level | |
7005154f | 59 | AliParticleGun fParticleGun; //AliParticleGun |
60 | AliPrimaryGeneratorMessenger fMessenger; //messenger | |
676fb573 | 61 | }; |
62 | ||
63 | // inline methods | |
64 | ||
65 | inline void AliPrimaryGeneratorAction::SetVerboseLevel(G4int level) | |
66 | { fVerboseLevel = level; } | |
67 | ||
68 | inline AliPrimaryGenerator AliPrimaryGeneratorAction::GetGenerator() const | |
69 | { return fGenerator; } | |
70 | ||
71 | inline G4int AliPrimaryGeneratorAction::GetNofGunParticles() const | |
72 | { return fNofGunParticles; } | |
73 | ||
74 | inline G4int AliPrimaryGeneratorAction::GetVerboseLevel() const | |
75 | { return fVerboseLevel; } | |
76 | ||
77 | #endif //ALI_PRIMARY_GENERATOR_ACTION_H | |
78 | ||
79 |