Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build FairShip with the separated libTPythia6.so library #597

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions gconfig/DecayConfigPy6.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ void DecayConfig() {
// specific types of decays defined below.

// Access the external decayer singleton and initialize it
if (TString(gSystem->DynamicPathName("libtpythia6.so", kTRUE)) != TString("")){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is needed, if the ROOT dictionaries are in the correct place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right,

I believe the issue with this and the similar comment is that I should use the same library name as the ROOT old TPythia6 library. libEGPythia6.so, instead of libtpythia6.so.

I will do it and remove all these redundant if conditions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, using the same library name seems like a good idea.

Thanks for the update!

gSystem->Load("libtpythia6.so");
} //load external library for TPythia6, not included in ROOT after 6.32
TPythia6Decayer* decayer = TPythia6Decayer::Instance();
// The following just tells pythia6 to not decay particles only to
// certain channels.
Expand Down
4 changes: 2 additions & 2 deletions gconfig/basiclibs.C
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ void basiclibs()
gSystem->Load("libGeomPainter");
gSystem->Load("libVMC");
gSystem->Load("libEG");
gSystem->Load("libEGPythia6");
//gSystem->Load("libEGPythia6");
gSystem->Load("libPythia6");
gSystem->Load("libPhysics");
gSystem->Load("libNet");
gSystem->Load("libTree");
gSystem->Load("libMinuit");
gSystem->Load("libMathMore");
gSystem->Load("libpythia8");
gSystem->Load("libgenfit.so");
//gSystem->Load("libgenfit.so");
gSystem->Load("libLHAPDF.so");
}
8 changes: 6 additions & 2 deletions macro/makeCascade.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@
sys.exit('ERROR on input, exit')

PDG = ROOT.TDatabasePDG.Instance()
myPythia = ROOT.TPythia6()
try:
myPythia = ROOT.TPythia6()
except: #library not part of ROOT from 6.32 onward, need to load it externally
ROOT.gSystem.Load("libtpythia6.so")
myPythia = ROOT.TPythia6()
tp = ROOT.tPythia6Generator()

# Pythia6 can only accept names below in pyinit, hence reset PDG table:
Expand Down Expand Up @@ -287,7 +291,7 @@ def fillp1(hist):
if stack[nstack][0]==idhist[i]:
idpn=0
# decide on p or n target in Mo
if random.random>fracp: idpn=1
if random.random()>fracp: idpn=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many statements on one line, missing spaces around operators.

idw=i*10+idpn*4+4
ib=h[str(idw)].FindBin(ptot,0.,0.)
prbsig=h[str(idw)].GetBinContent(ib)
Expand Down
6 changes: 5 additions & 1 deletion macro/run_simScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@
# set muon interaction close to decay volume
primGen.SetTarget(ship_geo.target.z0+ship_geo.muShield.length, 0.)
# -----Pythia6-------------------------
test = ROOT.TPythia6() # don't know any other way of forcing to load lib
try:
test = ROOT.TPythia6() # don't know any other way of forcing to load lib
except: #library not part of ROOT from 6.32 onward, need to load it externally
ROOT.gSystem.Load("libtpythia6.so")
test = ROOT.TPythia6()
P6gen = ROOT.tPythia6Generator()
P6gen.SetMom(50.*u.GeV)
P6gen.SetTarget("gamma/mu+","n0") # default "gamma/mu-","p+"
Expand Down
6 changes: 5 additions & 1 deletion muonShieldOptimization/makeMuonDIS.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
#
from array import array
PDG = ROOT.TDatabasePDG.Instance()
myPythia = ROOT.TPythia6()
try:
myPythia = ROOT.TPythia6()
except: #library not part of ROOT from 6.32 onward, need to load it externally
ROOT.gSystem.Load("libtpythia6.so")
myPythia = ROOT.TPythia6()
myPythia.SetMSEL(2) # msel 2 includes diffractive parts
myPythia.SetPARP(2,2) # To get below 10 GeV, you have to change PARP(2)
for kf in [211,321,130,310,3112,3122,3222,3312,3322,3334]:
Expand Down
2 changes: 1 addition & 1 deletion python/basiclibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#gSystem.Load("libGeomPainter.so")
#gSystem.Load("libVMC.so")
#gSystem.Load("libEG.so")
gSystem.Load("libEGPythia6.so")
#gSystem.Load("libEGPythia6.so")
gSystem.Load("libPythia6.so")
#gSystem.Load("libPhysics.so")
#gSystem.Load("libNet.so")
Expand Down
1 change: 1 addition & 0 deletions shipgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ${CMAKE_SOURCE_DIR}/generators
${CMAKE_SOURCE_DIR}/shipdata
${CMAKE_SOURCE_DIR}/veto
${genfit2_INCDIR}
${TPYTHIA6_INCLUDE_DIR}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we define a CMake Target as a dependency instead of manually including the libraries?

)

set(SYSTEM_INCLUDE_DIRECTORIES
Expand Down
Loading