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

#include <tPythia6Generator.h>

Inheritance diagram for tPythia6Generator:
[legend]
Collaboration diagram for tPythia6Generator:
[legend]

Public Member Functions

 tPythia6Generator ()
 ~tPythia6Generator () override
Bool_t ReadEvent (FairPrimaryGenerator *) override
Bool_t Init () override
Bool_t Init (const char *inFile) override
Bool_t Init (const char *inFile, int startEvent) 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 ()
virtual Bool_t Init (const std::vector< std::string > &inFiles, int startNumber)
virtual Bool_t Init (const std::vector< std::string > &inFiles)
Public Member Functions inherited from SHiP::Generator
 Generator ()=default
 ~Generator () override
virtual void UseExternalFile (std::string x, Int_t i)
virtual void UseExternalFile (std::vector< std::string > &inFiles, Int_t i)
void SetMaxTheta (Double_t thetaX, Double_t thetaY)
Int_t nrOfGeoRejections () const
Long64_t GetCounter (const std::string &name) const
void SetCounter (const std::string &name, Long64_t value)
void IncrementCounter (const std::string &name, Long64_t delta=1)

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
Double_t fMaxThetaX = 0
Double_t fMaxThetaY = 0
bool fUseVesselAcceptance = false
Int_t fnGeoRejects = 0
std::unordered_map< std::string, int64_t > fCounters

Private Attributes

TPythia6 * fPythia

Additional Inherited Members

Protected Member Functions inherited from SHiP::Generator
bool IsInVesselAcceptance (Double_t px, Double_t py, Double_t pz) const

Detailed Description

Definition at line 19 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 ( )
overridedefault

destructor

Member Function Documentation

◆ getPyint5_NGEN()

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

Definition at line 48 of file tPythia6Generator.h.

48 {
49 return fPythia->GetPyint5()->NGEN[i][j];
50 };
int i
Definition ShipAna.py:108

◆ getPyint5_NGENPD()

int tPythia6Generator::getPyint5_NGENPD ( )
inline

Definition at line 51 of file tPythia6Generator.h.

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

◆ getPyint5_XSEC()

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

Definition at line 45 of file tPythia6Generator.h.

45 {
46 return fPythia->GetPyint5()->XSEC[i][j];
47 };

◆ Init() [1/5]

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}

◆ Init() [2/5]

Bool_t tPythia6Generator::Init ( const char * inFile)
inlineoverridevirtual

Implements SHiP::Generator.

Definition at line 32 of file tPythia6Generator.h.

32{ return Init(inFile, 0); };
Bool_t Init() override

◆ Init() [3/5]

Bool_t tPythia6Generator::Init ( const char * inFile,
int startEvent )
inlineoverridevirtual

Implements SHiP::Generator.

Definition at line 33 of file tPythia6Generator.h.

33 {
34 LOG(warning) << "Init with files not implemented for tPythia6Generator. "
35 "Using default Init() instead";
36 return Init();
37 };

◆ Init() [4/5]

virtual Bool_t SHiP::Generator::Init ( const std::vector< std::string > & inFiles)
inlinevirtual

Reimplemented from SHiP::Generator.

Definition at line 33 of file Generator.h.

33 {
34 LOG(warning) << "Multiple input files not implemented for this generator "
35 "- only taking the first!";
36 return Init(inFiles.at(0).c_str(), 0);
37 };

◆ Init() [5/5]

virtual Bool_t SHiP::Generator::Init ( const std::vector< std::string > & inFiles,
int startNumber )
inlinevirtual

Reimplemented from SHiP::Generator.

Definition at line 27 of file Generator.h.

28 {
29 LOG(warning) << "Multiple input files not implemented for this generator "
30 "- only taking the first!";
31 return Init(inFiles.at(0).c_str(), startNumber);
32 };

◆ 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->GetK(ii, 3); // parent line number (K(I,3))
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 39 of file tPythia6Generator.h.

39{ fMom = mom; };

◆ SetTarget()

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

Definition at line 40 of file tPythia6Generator.h.

40 {
41 fType = std::move(Type);
42 fTarget = std::move(Target);
43 };

◆ UseDeepCopy()

void tPythia6Generator::UseDeepCopy ( )
inline

Definition at line 44 of file tPythia6Generator.h.

44{ fDeepCopy = kTRUE; };

Member Data Documentation

◆ fDeepCopy

Bool_t tPythia6Generator::fDeepCopy
protected

Definition at line 58 of file tPythia6Generator.h.

◆ fMom

Double_t tPythia6Generator::fMom
protected

Definition at line 57 of file tPythia6Generator.h.

◆ fPionKaonDecay

Bool_t tPythia6Generator::fPionKaonDecay
protected

Definition at line 59 of file tPythia6Generator.h.

◆ fPythia

TPythia6* tPythia6Generator::fPythia
private

Definition at line 54 of file tPythia6Generator.h.

◆ fTarget

TString tPythia6Generator::fTarget
protected

Definition at line 61 of file tPythia6Generator.h.

◆ fType

TString tPythia6Generator::fType
protected

Definition at line 60 of file tPythia6Generator.h.


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