FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
PndPythia6Direct Class Reference

#include <PndPythia6Direct.h>

Inheritance diagram for PndPythia6Direct:

Public Member Functions

 PndPythia6Direct ()
 
virtual ~PndPythia6Direct ()
 
Bool_t ReadEvent (FairPrimaryGenerator *)
 
void Print ()
 
virtual Bool_t Init ()
 
void SetMom (Double_t mom)
 
void SetStoreTree (Bool_t store=true)
 
void SetVerbose (int v=1)
 
void SetPandaDefaults ()
 
TPythia6 * GetTPythia6 ()
 

Protected Member Functions

 ClassDef (PndPythia6Direct, 1)
 

Protected Attributes

Double_t fMom
 
bool fStoreTree
 
int fVerbose
 

Private Attributes

TPythia6 * fPythia
 
TClonesArray * fParticleList
 
TMCParticle * fParticle
 

Detailed Description

Definition at line 16 of file PndPythia6Direct.h.

Constructor & Destructor Documentation

PndPythia6Direct::PndPythia6Direct ( )

default constructor

Definition at line 12 of file PndPythia6Direct.cxx.

References fMom, fPythia, fStoreTree, and SetPandaDefaults().

13 {
14  fMom = 15.;
15  fStoreTree=false;
16  fPythia=TPythia6::Instance();
18 }
PndPythia6Direct::~PndPythia6Direct ( )
virtual

destructor

Definition at line 51 of file PndPythia6Direct.cxx.

References fPythia.

52 {
53  if(fPythia!=NULL) delete fPythia;
54 }

Member Function Documentation

PndPythia6Direct::ClassDef ( PndPythia6Direct  ,
 
)
protected
TPythia6* PndPythia6Direct::GetTPythia6 ( )
inline

Definition at line 42 of file PndPythia6Direct.h.

References fPythia.

42  {
43  return fPythia;
44  };
Bool_t PndPythia6Direct::Init ( )
virtual

Definition at line 38 of file PndPythia6Direct.cxx.

References fMom, fParticleList, and fPythia.

39 {
40  std::cout<<"PndPythia6Direct::Init(): Beam Momentum "<<fMom<<std::endl;
41 
42  fPythia->Initialize("FIXT", "pbar", "p", fMom);
43  fParticleList = (TClonesArray*)fPythia->GetListOfParticles();
44 
45  return kTRUE;
46 }
TClonesArray * fParticleList
void PndPythia6Direct::Print ( )

Definition at line 132 of file PndPythia6Direct.cxx.

132  {
133  //fPythia.settings.listAll();
134 }
Bool_t PndPythia6Direct::ReadEvent ( FairPrimaryGenerator *  primGen)

public method ReadEvent

Definition at line 58 of file PndPythia6Direct.cxx.

References fParticle, fParticleList, fPythia, fStoreTree, fT, fVerbose, fX, fY, fZ, i, printf(), and status.

59 {
60  static int evtn=0;
61  if(fVerbose>0) std::cout<<"PndPythia6Direct::ReadEvent() No. "<<evtn<<std::endl;
62  fPythia->GenerateEvent();
63  if(fVerbose>2) std::cout<<"PndPythia6Direct::ReadEvent() Generation done."<<std::endl;
64  double fX, fY, fZ, fT;
65  double Px,Py,Pz, fE; // ,Pm[1000],Wh[1000];
66  int Id,nFD,nLD,nMO,status;
67  bool dotracking;
68  //fParticleList=(TClonesArray*)fPythia->ImportParticles();
69  int npart=fParticleList->GetEntriesFast();
70  if(fVerbose>0) std::cout<<"PndPythia6Direct::ReadEvent() We have "<<npart<<" tracks."<<std::endl;
71  for(int i=0; i<npart; ++i)
72  {
73  if(fVerbose>4) std::cout<<"PndPythia6Direct::ReadEvent() particle No. "<<i<<std::endl;
74  fParticle=(TMCParticle*)fParticleList->At(i);
75  if(fVerbose>4) std::cout<<"PndPythia6Direct::ReadEvent() particle pointer "<<fParticle<<std::endl;
76  if(fParticle==NULL) continue;
77  // add track
78  nFD=fParticle->GetFirstChild();
79  nLD=fParticle->GetLastChild();
80  nMO=fParticle->GetParent();
81  status=fParticle->GetKS();
82  //Id=TDatabasePDG::Instance()->GetParticle(fParticle->GetName())->PdgCode();
83  Id=fParticle->GetKF(); // "Flavour code" is pdg code
84  if(fVerbose>4) {
85  std::cout<<"PndPythia6Direct::ReadEvent() Particle:"
86  //<<" pdg="<<TDatabasePDG::Instance()->GetParticle(fParticle->GetName())->PdgCode()
87  <<" name=\""<<fParticle->GetName()<<"\""
88  <<" nFD= "<<nFD
89  <<" nLD= "<<nLD
90  <<" nMO= "<<nMO
91  <<" pdg= "<<Id
92  <<" status= "<<status
93  <<"\n "
94  <<" Time()*1000="<<fParticle->GetTime()*1000
95  <<" Vx()*0.1= "<<fParticle->GetVx()*0.1
96  <<" Vy()*0.1= "<<fParticle->GetVy()*0.1
97  <<" Vz()*0.1= "<<fParticle->GetVz()*0.1
98  <<"\n "
99  <<" Energy()= "<<fParticle->GetEnergy()
100  <<" Px()= "<<fParticle->GetPx()
101  <<" Py()= "<<fParticle->GetPy()
102  <<" Pz()= "<<fParticle->GetPz()
103  <<std::endl;
104  }
105 
106  if(status==1 || fStoreTree ) //fStoreTree && status==11 && nFD!=nLD)
107  {
108  fT=fParticle->GetTime()*1000; //[mm/c]->s with c in [m/s] // /(1000*TMath::C()); //mm - > s conversion
109  fX=fParticle->GetVx()*0.1; // mm -> cm conversion
110  fY=fParticle->GetVy()*0.1; // mm -> cm conversion
111  fZ=fParticle->GetVz()*0.1; // mm -> cm conversion
112  fE=fParticle->GetEnergy();
113  Px=fParticle->GetPx();
114  Py=fParticle->GetPy();
115  Pz=fParticle->GetPz();
116  if(fVerbose>0&&(evtn<10||(evtn%100)==0)) printf("- I -: new particle %d at: %f, %f, %f (%f)-> %f %f %f (%f) ID %d ##Daughters %d %d Mother %d\n",
117  i,fX, fY, fZ, fT,Px, Py, Pz, fE, Id, nFD, nLD, nMO);
118  if(fStoreTree) {
119  // here we write all particles to the stack, but do processing only for final state particles
120  dotracking = (status==1);
121  primGen->AddTrack(Id, Px, Py, Pz, fX, fY, fZ, nMO,dotracking,fE,fT);
122  } else {
123  primGen->AddTrack(Id, Px, Py, Pz, fX, fY, fZ,-1,true,fE,fT);// set mother id to default: -1, do tracking: true
124  }
125  }
126  }
127  evtn++;
128  return kTRUE;
129 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
Int_t i
Definition: run_full.C:25
TClonesArray * fT
Definition: drawGLTracks.C:13
Double_t fX
Definition: PndCaloDraw.cxx:34
Double_t fZ
Definition: PndCaloDraw.cxx:34
TMCParticle * fParticle
FairPrimaryGenerator * primGen
Definition: sim_emc_apd.C:81
Double_t fY
Definition: PndCaloDraw.cxx:34
TClonesArray * fParticleList
int status[10]
Definition: f_Init.h:28
void PndPythia6Direct::SetMom ( Double_t  mom)
inline

Definition at line 32 of file PndPythia6Direct.h.

References fMom, and mom.

32  {
33  fMom = mom;
34  };
Double_t mom
Definition: plot_dirc.C:14
void PndPythia6Direct::SetPandaDefaults ( )

Definition at line 22 of file PndPythia6Direct.cxx.

References fPythia.

Referenced by PndPythia6Direct().

22  {
23  std::cout<<"PndPythia6Direct::SetPandaDefaults()"<<std::endl;
24  // Those are the FORTRAN settings. Let's access them via TPythia6
25  //c---------- Choice of the nessesary process --------------------
26  fPythia->SetMSEL(0); // full User Access
27  fPythia->SetMSUB(1,1); // qQ-->A*/Z0*
28  //c------------------- Nessesary limits for PANDA ENERGY region ---------
29  fPythia->SetPARP(2,0.5); // Lowest inv. Mass (D=10.GeV)
30  fPythia->SetPARP(111,0.1); // Minimum invar. mass of the remnant hadronic system (D=2.GeV)
31  fPythia->SetCKIN(1,1.); // limits for shat
32  //fPythia->SetCKIN(2,-1.); // no upper limit for S-HAT
33  fPythia->SetCKIN(5,0.1); // low cut limits for PT_-range
34  fPythia->SetCKIN(6,0.1); // low cut limits for intermediate mass
35 }
void PndPythia6Direct::SetStoreTree ( Bool_t  store = true)
inline

Definition at line 35 of file PndPythia6Direct.h.

References fStoreTree, and store().

35  {
37  };
vector< FitStore > store(3000)
void PndPythia6Direct::SetVerbose ( int  v = 1)
inline

Definition at line 38 of file PndPythia6Direct.h.

References fVerbose, and v.

38  {
39  fVerbose=v;
40  };
__m128 v
Definition: P4_F32vec4.h:4

Member Data Documentation

Double_t PndPythia6Direct::fMom
protected

Definition at line 53 of file PndPythia6Direct.h.

Referenced by Init(), PndPythia6Direct(), and SetMom().

TMCParticle* PndPythia6Direct::fParticle
private

Definition at line 50 of file PndPythia6Direct.h.

Referenced by ReadEvent().

TClonesArray* PndPythia6Direct::fParticleList
private

Definition at line 49 of file PndPythia6Direct.h.

Referenced by Init(), and ReadEvent().

TPythia6* PndPythia6Direct::fPythia
private
bool PndPythia6Direct::fStoreTree
protected

Definition at line 54 of file PndPythia6Direct.h.

Referenced by PndPythia6Direct(), ReadEvent(), and SetStoreTree().

int PndPythia6Direct::fVerbose
protected

Definition at line 55 of file PndPythia6Direct.h.

Referenced by ReadEvent(), and SetVerbose().


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