PandaRoot
PndPythia8Direct.h
Go to the documentation of this file.
1 #ifndef PNDP8DIRECT_H
2 #define PNDP8DIRECT_H 1
3 
4 #include "TROOT.h"
5 #include "PndTargetGenerator.h"
6 
7 #ifdef __CINT__
8 #define _DLFCN_H_
9 #define _DLFCN_H
10 #endif
11 
12 #include "Pythia.h"
13 #include "TRandom1.h"
14 #include "TRandom.h"
15 
16 #include <memory>
17 
18 class FairPrimaryGenerator;
19 //using namespace Pythia8;
20 
21 // Wrap gRandom to Pythia8
22 class PyTrGRng : public Pythia8::RndmEngine {
23  public:
24  PyTrGRng(){};
25  virtual ~PyTrGRng(){};
26 
27  Double_t flat() { return gRandom->Rndm(); };
28 };
29 
31  public:
34 
36  PndPythia8Direct(Double_t mom, const char *par = "");
37 
39  virtual ~PndPythia8Direct();
40 
42  Bool_t ReadEvent(FairPrimaryGenerator *);
43  void AddParameter(const char *);
44  void SetParameters(const char *);
45  void Print();
46 
47  void SetMom(Double_t mom) { fMom = mom; };
48 
49  virtual Bool_t Init();
50 
51 
52  private:
53  Pythia8::Pythia fPythia;
54 #if (PYTHIA_VERSION_INTEGER >= 8310) // PYTHIA 8310 changed to shared_ptr
55  std::shared_ptr<Pythia8::RndmEngine> fRandomEngine;
56 #else
57  Pythia8::RndmEngine *fRandomEngine;
58 #endif
59 
60  const char *fParams[100];
61 
62  protected:
63  Double_t fMom; // pbar momentum
64  Int_t fPar_it; // number of parameter lines
65 
66  ClassDef(PndPythia8Direct, 1);
67 };
68 
69 #endif /* !PNDP8GENERATOR_H */
virtual ~PyTrGRng()
Double_t flat()
void SetMom(Double_t mom)
Double_t fMom
parameter line storage