FairShip
Loading...
Searching...
No Matches
tPythia6Generator Class Reference

#include <tPythia6Generator.h>

Inheritance diagram for tPythia6Generator:
Collaboration diagram for tPythia6Generator:

Public Member Functions

 tPythia6Generator ()
 
 ~tPythia6Generator () override
 
Bool_t ReadEvent (FairPrimaryGenerator *) override
 
Bool_t Init () override
 
void SetMom (Double_t mom)
 
void SetTarget (TString Type, TString Target)
 
void UseDeepCopy ()
 
double getPyint5_XSEC (int i, int j)
 
double getPyint5_NGEN (int i, int j)
 
int getPyint5_NGENPD ()
 
- Public Member Functions inherited from SHiP::Generator
 Generator ()
 
virtual ~Generator ()
 
virtual Bool_t Init (const char *, int)=0
 
virtual Bool_t Init (const char *)=0
 
virtual Bool_t Init (const std::vector< std::string > &inFiles, int startNumber)
 
virtual Bool_t Init (const std::vector< std::string > &inFiles)
 
virtual void UseExternalFile (std::string x, Int_t i)
 
virtual void UseExternalFile (std::vector< std::string > &inFiles, Int_t i)
 

Protected Attributes

Double_t fMom
 
Bool_t fDeepCopy
 
Bool_t fPionKaonDecay
 
TString fType
 
TString fTarget
 
- Protected Attributes inherited from SHiP::Generator
std::optional< std::string > fextFile
 
Int_t firstEvent = 0
 

Private Attributes

TPythia6 * fPythia
 

Detailed Description

Definition at line 16 of file tPythia6Generator.h.

Constructor & Destructor Documentation

◆ tPythia6Generator()

tPythia6Generator::tPythia6Generator ( )

default constructor

Definition at line 16 of file tPythia6Generator.cxx.

16 {
17 fMom = 400; // muon
18 fDeepCopy = kFALSE; // copy complete pythia event
19 fPythia = TPythia6::Instance();
20 fPionKaonDecay = kFALSE;
21 fType = "gamma/mu-"; // muon proton scattering
22 fTarget = "p+";
23}

◆ ~tPythia6Generator()

tPythia6Generator::~tPythia6Generator ( )
override

destructor

Definition at line 54 of file tPythia6Generator.cxx.

54{}

Member Function Documentation

◆ getPyint5_NGEN()

double tPythia6Generator::getPyint5_NGEN ( int  i,
int  j 
)
inline

Definition at line 39 of file tPythia6Generator.h.

39 {
40 return fPythia->GetPyint5()->NGEN[i][j];
41 };
int i
Definition: ShipAna.py:97

◆ getPyint5_NGENPD()

int tPythia6Generator::getPyint5_NGENPD ( )
inline

Definition at line 42 of file tPythia6Generator.h.

42{ return fPythia->GetPyint5()->NGENPD; };

◆ getPyint5_XSEC()

double tPythia6Generator::getPyint5_XSEC ( int  i,
int  j 
)
inline

Definition at line 36 of file tPythia6Generator.h.

36 {
37 return fPythia->GetPyint5()->XSEC[i][j];
38 };

◆ Init()

Bool_t tPythia6Generator::Init ( )
override

Definition at line 27 of file tPythia6Generator.cxx.

27 {
28 fPythia->SetMRPY(1, gRandom->GetSeed());
29
30 cout << "Muon Momentum " << fMom << endl;
31
32 if (fPionKaonDecay) {
33 // let also pion and kaon decay
34 fPythia->SetMDCY(fPythia->Pycomp(211), 1, 100);
35 fPythia->SetMDCY(fPythia->Pycomp(321), 1, 100);
36 }
37 fPythia->SetMSEL(1); // msel 2 includes diffractive parts
38 // fPythia->SetMSUB(91,0); // elastic scattering
39 fPythia->SetPARP(2, 2); // To get below 10 GeV, you have to change PARP(2)
40
41 /* compass settings
42 # CKIN(10) = 100
43 # MSEL = 2 # include elastic and diffractive to mbias
44 # MSTJ = 1 default, string fragmentation
45 */
46
47 fPythia->Initialize("FIXT", fType, fTarget, fMom);
48
49 return kTRUE;
50}

◆ ReadEvent()

Bool_t tPythia6Generator::ReadEvent ( FairPrimaryGenerator *  cpg)
override

public method ReadEvent

Definition at line 58 of file tPythia6Generator.cxx.

58 {
59 Int_t npart = 0;
60 while (npart == 0) {
61 fPythia->GenerateEvent();
62 // remove all unnecessary stuff
63 fPythia->Pyedit(2);
64 npart = fPythia->GetN();
65 };
66
67 for (Int_t ii = 1; ii < fPythia->GetN() + 1; ii++) {
68 Bool_t wanttracking = false;
69 if (fPythia->GetK(ii, 1) == 1) {
70 wanttracking = true;
71 }
72 Int_t id = fPythia->GetK(ii, 2);
73 Double_t z = fPythia->GetV(ii, 3) / 10.;
74 Double_t x = fPythia->GetV(ii, 1) / 10.;
75 Double_t y = fPythia->GetV(ii, 2) / 10.;
76 Double_t pz = fPythia->GetP(ii, 3);
77 Double_t px = fPythia->GetP(ii, 1);
78 Double_t py = fPythia->GetP(ii, 2);
79 Int_t im = fPythia->GetV(ii, 4);
80 // cout << "debug p6 "<<id<<" "<< pz << endl;
81 // copy blind complete pythia event
82 if (fDeepCopy || wanttracking) {
83 cpg->AddTrack(id, px, py, pz, x, y, z, im, wanttracking);
84 }
85 }
86 return kTRUE;
87}

◆ SetMom()

void tPythia6Generator::SetMom ( Double_t  mom)
inline

Definition at line 30 of file tPythia6Generator.h.

30{ fMom = mom; };

◆ SetTarget()

void tPythia6Generator::SetTarget ( TString  Type,
TString  Target 
)
inline

Definition at line 31 of file tPythia6Generator.h.

31 {
32 fType = Type;
34 };
Definition: Target.h:23

◆ UseDeepCopy()

void tPythia6Generator::UseDeepCopy ( )
inline

Definition at line 35 of file tPythia6Generator.h.

35{ fDeepCopy = kTRUE; };

Member Data Documentation

◆ fDeepCopy

Bool_t tPythia6Generator::fDeepCopy
protected

Definition at line 49 of file tPythia6Generator.h.

◆ fMom

Double_t tPythia6Generator::fMom
protected

Definition at line 48 of file tPythia6Generator.h.

◆ fPionKaonDecay

Bool_t tPythia6Generator::fPionKaonDecay
protected

Definition at line 50 of file tPythia6Generator.h.

◆ fPythia

TPythia6* tPythia6Generator::fPythia
private

Definition at line 45 of file tPythia6Generator.h.

◆ fTarget

TString tPythia6Generator::fTarget
protected

Definition at line 52 of file tPythia6Generator.h.

◆ fType

TString tPythia6Generator::fType
protected

Definition at line 51 of file tPythia6Generator.h.


The documentation for this class was generated from the following files: