FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Pythia8Generator.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 // -------------------------------------------------------------------------
9 // ----- M. Al-Turany June 2014 -----
10 // -------------------------------------------------------------------------
11 
12 #ifndef My_PYTHIA8GENERATOR_H
13 #define My_PYTHIA8GENERATOR_H 1
14 
15 #include "FairGenerator.h" // for FairGenerator
16 #include "Pythia8/Basics.h" // for RndmEngine
17 #include "Pythia8/Pythia.h" // for Pythia
18 
19 #include <Rtypes.h> // for Double_t, Bool_t, Int_t, etc
20 #include <TRandom.h> // for TRandom
21 #include <TRandom1.h> // for TRandom1
22 #include <TRandom3.h> // for TRandom3, gRandom
23 class FairPrimaryGenerator; // lines 22-22
24 
26 using namespace Pythia8;
27 
28 class PyTr1Rng : public RndmEngine
29 {
30  public:
31  PyTr1Rng() { rng = new TRandom1(gRandom->GetSeed()); };
32  virtual ~PyTr1Rng(){};
33 
34  Double_t flat() { return rng->Rndm(); };
35 
36  private:
37  TRandom1 *rng;
38 };
39 
40 class PyTr3Rng : public RndmEngine
41 {
42  public:
43  PyTr3Rng() { rng = new TRandom3(gRandom->GetSeed()); };
44  virtual ~PyTr3Rng(){};
45 
46  Double_t flat() { return rng->Rndm(); };
47 
48  private:
49  TRandom3 *rng;
50 };
51 
53 {
54  public:
57 
59  virtual ~Pythia8Generator();
60 
62  Bool_t ReadEvent(FairPrimaryGenerator *);
63  void SetParameters(char *);
64  void Print();
65 
66  virtual Bool_t Init();
67 
68  void SetMom(Double_t mom) { fMom = mom; };
69  void SetId(Double_t id) { fId = id; };
70  void SetHNLId(Int_t id) { fHNL = id; };
71  void UseRandom1()
72  {
73  fUseRandom1 = kTRUE;
74  fUseRandom3 = kFALSE;
75  };
76  void UseRandom3()
77  {
78  fUseRandom1 = kFALSE;
79  fUseRandom3 = kTRUE;
80  };
81  void GetPythiaInstance(int);
82 
83  private:
84  Pythia fPythia;
85  RndmEngine *fRandomEngine;
86 
87  protected:
88  Double_t fMom; // proton momentum
89  Int_t fHNL; // HNL ID
90  Int_t fId; // target type
91  Bool_t fUseRandom1; // flag to use TRandom1
92  Bool_t fUseRandom3; // flag to use TRandom3 (default)
93 
94  ClassDef(Pythia8Generator, 1);
95 };
96 
97 #endif /* !My_PYTHIA8GENERATOR_H */
Double_t flat()
void SetMom(Double_t mom)
Double_t flat()
virtual ~PyTr1Rng()
void SetHNLId(Int_t id)
void SetId(Double_t id)
virtual ~PyTr3Rng()