PandaRoot
PndPythia8Direct.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef PNDP8DIRECT_H
14 #define PNDP8DIRECT_H 1
15 
16 #include "TROOT.h"
17 #include "PndTargetGenerator.h"
18 
19 #ifdef __CINT__
20 #define _DLFCN_H_
21 #define _DLFCN_H
22 #endif
23 
24 #include "Pythia.h"
25 #include "TRandom1.h"
26 #include "TRandom.h"
27 
28 #include <memory>
29 
30 class FairPrimaryGenerator;
31 //using namespace Pythia8;
32 
33 // Wrap gRandom to Pythia8
34 class PyTrGRng : public Pythia8::RndmEngine {
35  public:
36  PyTrGRng(){};
37  virtual ~PyTrGRng(){};
38 
39  Double_t flat() { return gRandom->Rndm(); };
40 };
41 
43  public:
46 
48  PndPythia8Direct(Double_t mom, const char *par = "");
49 
51  virtual ~PndPythia8Direct();
52 
54  Bool_t ReadEvent(FairPrimaryGenerator *);
55  void AddParameter(const char *);
56  void SetParameters(const char *);
57  void Print();
58 
59  void SetMom(Double_t mom) { fMom = mom; };
60 
61  virtual Bool_t Init();
62 
63 
64  private:
65  Pythia8::Pythia fPythia;
66 #if (PYTHIA_VERSION_INTEGER >= 8310) // PYTHIA 8310 changed to shared_ptr
67  std::shared_ptr<Pythia8::RndmEngine> fRandomEngine;
68 #else
69  Pythia8::RndmEngine *fRandomEngine;
70 #endif
71 
72  const char *fParams[100];
73 
74  protected:
75  Double_t fMom; // pbar momentum
76  Int_t fPar_it; // number of parameter lines
77 
78  ClassDef(PndPythia8Direct, 1);
79 };
80 
81 #endif /* !PNDP8GENERATOR_H */
virtual ~PyTrGRng()
Double_t flat()
void SetMom(Double_t mom)
Double_t fMom
parameter line storage