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