Skip to content

Latest commit

 

History

History

eic_evgen

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

eic_evgen

This is an event generator for deep exclusive electro pion production at EIC.

First make two directories:

mkdir LundFiles mkdir RootFiles

This generator uses ROOT libraries. To compile please use following command:

g++ -o eic eic.cxx root-config --cflags --glibs

This generator is valid for: 5.0 < Qsq < 35 GeV^2 2.0 < w < 10 GeV 0 < -t < 1.3 GeV^2

It can generates a root file, a txt file and a dat file. Generation of Root file is turned off. dat file is written in lund format to use in eic_gemc

The last line in txt file "Number of lund events" shows how many events are successfully generated. Use this number in gcard of eic_gemc

Follwing is the format of dat file:

ppiOut << "3"
   << " \t " << fPhi           // var 1
   << " \t " << fPhiS          // var 2
   << " \t " << fx             // var 3
   << " \t " << "1"	       
   << " \t " << fQsq_GeV       // var 4
   << " \t " << fT_GeV         // var 5
   << " \t " << fW_GeV 	       // var 6
   << " \t " << fEpsilon       // var 7
   << " \t " << fEventWeight   // var 8	   
   << endl;
  
// Pion -
ppiOut << setw(10) << "1" 
   << setw(10) << "1" 
   << setw(10) << "1" 
   << setw(10) << "211" 
   << setw(10) << "0" 
   << setw(10) << "0" 
   << setw(16) << lpiong.X()
   << setw(16) << lpiong.Y()   
   << setw(16) << lpiong.Z()  
   << setw(16) << lpiong.E()
   << setw(16) << fPion_Mass_GeV
   << setw(16) << fVertex_X
   << setw(16) << fVertex_Y
   << setw(16) << fVertex_Z
   << endl;

// Electron
ppiOut << setw(10) << "2" 
   << setw(10) << "-1" 
   << setw(10) << "1" 
   << setw(10) << "11" 
   << setw(10) << "0" 
   << setw(10) << "0" 
   << setw(16) << lscatelecg.X() 
   << setw(16) << lscatelecg.Y() 
   << setw(16) << lscatelecg.Z() 
   << setw(16) << lscatelecg.E()
   << setw(16) << fElectron_Mass_GeV
   << setw(16) << fVertex_X
   << setw(16) << fVertex_Y
   << setw(16) << fVertex_Z
   << endl;
  
// Neutron
ppiOut << setw(10) << "3" 
   << setw(10) << "1" 
   << setw(10) << "1" 
   << setw(10) << "2112" 
   << setw(10) << "0" 
   << setw(10) << "0" 
   << setw(16) << lneutrong.X() 
   << setw(16) << lneutrong.Y()
   << setw(16) << lneutrong.Z()
   << setw(16) << lneutrong.E()
   << setw(16) << fNeutron_Mass_GeV
   << setw(16) << fVertex_X
   << setw(16) << fVertex_Y
   << setw(16) << fVertex_Z
   << endl;

Please note that event weight of a single evevnt is normalized to total events tried so you dont need to know the ratio of events generated to events tried, just use the "fEventWeight" for each event

For a quick check just run the follwing command in c-shell

source ./runEIC.csh

Note 1: fEventWeight is a negative number because of the phase space of scattered electron.

Note 2: Lets say you generate "N" dat files and then generate "N" root files using eic_gemc. When you combine these eic_gemc generated "N" files using hadd command of root (or using your own script) then in your analysis code you must divide the eighth variable of header tree(which contains the event event weight) by "N"

header->SetBranchAddress("var8",&var8);

weight = -var8->at(0)/300.0;