Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SQPrimaryParticleGen.h
Go to the documentation of this file.
1 /*====================================================================
2 Author: Abinash Pun, Kun Liu
3 Nov, 2019
4 Goal: Import the physics generator of E906 experiment (DPSimPrimaryGeneratorAction)
5 from Kun to E1039 experiment in Fun4All framework
6 =========================================================================*/
7 #ifndef __SQPrimaryParticleGen_H__
8 #define __SQPrimaryParticleGen_H__
9 
10 #ifndef __CINT__
11 #include <Pythia8/Pythia.h>
12 #endif
13 #include <LHAPDF/LHAPDF.h>
14 #ifndef __CINT__
15 #include <gsl/gsl_rng.h>
16 #endif
17 
18 #include <TGenPhaseSpace.h>
20 
21 class PHCompositeNode;
23 class PHG4InEvent;
24 class PHG4Particle;
25 
26 class SQMCEvent;
27 class SQDimuon;
28 class SQDimuonVector;
29 class SQPrimaryVertexGen;
30 
31 //==========
33 {
34 public:
36  virtual ~SQPrimaryParticleGen();
37 
38 
39  int Init(PHCompositeNode* topNode);
40  int InitRun(PHCompositeNode* topNode);
41  int process_event(PHCompositeNode* topNode);
42  //void GeneratePrimaries(G4Event* anEvent);
43 
45 
46  int generateDrellYan(PHCompositeNode *topNode, TVector3 vtx, const double pARatio, double luminosity);
47  int generateJPsi(PHCompositeNode *topNode, TVector3 vtx, const double pARatio, double luminosity);
48  int generatePsip(PHCompositeNode *topNode, TVector3 vtx, const double pARatio, double luminosity);
49  // void generateDarkPhotonFromEta();
50  int generatePythia(PHCompositeNode *topNode, TVector3 vtx, const double pARatio);
51  int generateCustomDimuon(PHCompositeNode *topNode, TVector3 vtx, const double pARatio);
52 
54 
56  bool generateDimuon(double mass, double xF, bool angular = false);
57 
59 
64 
65  //swith for the generators; Abi
66  //@
67  void enablePythia(){_Pythia = true;}
68  bool _Pythia;
74  void enableJPsiGen(){_JPsiGen = true;}
75  bool _JPsiGen;
76  void enablePsipGen(){_PsipGen = true;}
77  bool _PsipGen;
78 
79  void set_xfRange(const double xmin, const double xmax){
80  xfMin = xmin;
81  xfMax = xmax;
82  }
83  void set_massRange(const double mmin, const double mmax){
84  massMin = mmin;
85  massMax = mmax;
86  }
87  //@
88 
89  private:
90 
91  SQPrimaryVertexGen* _vertexGen;
92  PHG4InEvent *ineve;
93  SQMCEvent* _mcevt; //< An output node
94  SQDimuonVector* _vec_dim; //< An output node
95 
96  SQDimuon* _dim_gen; //< To hold the kinematics of a dimuon generated
97 
98  //Pythia generator
99  Pythia8::Pythia ppGen;
100  Pythia8::Pythia pnGen;
101 
102 
104  TGenPhaseSpace phaseGen;
105 
106 
108  LHAPDF::PDF* pdf;
109 
110 
111  //some initializations
112 
113  double massMin = 0.22;
114  double massMax = 10.;
115  double x1Min = 0.;
116  double x1Max = 1.;
117  double x2Min = 0.;
118  double x2Max = 1.;
119  double xfMin = -1.;
120  double xfMax = 1.;
121  double cosThetaMin = -1.;
122  double cosThetaMax = 1. ;
123  double zOffsetMin = -1.;
124  double zOffsetMax = 1.;
125 
126  void InsertMuonPair(TVector3& vtx);
127  void InsertEventInfo(double xsec, TVector3& vtx);
128 };
129 
130 //========
131 
132 
133 
134 
135 #endif
136 
int process_event(PHCompositeNode *topNode)
int generateCustomDimuon(PHCompositeNode *topNode, TVector3 vtx, const double pARatio)
int generateDrellYan(PHCompositeNode *topNode, TVector3 vtx, const double pARatio, double luminosity)
Various generators.
int InitRun(PHCompositeNode *topNode)
Int_t nEventsThrown
Run-accumulated variables.
void set_xfRange(const double xmin, const double xmax)
bool generateDimuon(double mass, double xF, bool angular=false)
Dimuon phase space generator.
int generatePythia(PHCompositeNode *topNode, TVector3 vtx, const double pARatio)
void set_massRange(const double mmin, const double mmax)
An SQ interface class to hold a list of SQDimuon objects.
int Init(PHCompositeNode *topNode)
int generatePsip(PHCompositeNode *topNode, TVector3 vtx, const double pARatio, double luminosity)
An SQ interface class to hold one true or reconstructed dimuon.
Definition: SQDimuon.h:8
An SQ interface class to hold one simulated-event header.
Definition: SQMCEvent.h:12
int generateJPsi(PHCompositeNode *topNode, TVector3 vtx, const double pARatio, double luminosity)