FairShip
Loading...
Searching...
No Matches
shipRoot_conf.py
Go to the documentation of this file.
1# SPDX-License-Identifier: LGPL-3.0-or-later
2# SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP Collaboration
3
4import os
5
6import ROOT
7from pythia8_conf_utils import addHNLtoROOT
8from pythia8darkphoton_conf import addDPtoROOT
9
10if os.environ.get("FAIRSHIP_ROOT", "") == "":
11 print("FairShip environment not found, quitting.")
12 quit()
13
14ROOT.gSystem.Load("libEGPythia6")
15ROOT.gSystem.Load("libPythia6")
16ROOT.gSystem.Load("libpythia8")
17
18# GenFit 02-03-00 no longer ships rootmap or unified PCM files, so ROOT's
19# autoloading cannot discover genfit classes. Load the library, point Cling
20# at the headers, and explicitly parse those used at runtime.
21genfit_root = os.environ.get("GENFIT_ROOT", os.environ.get("GENFIT", ""))
22if genfit_root:
23 ROOT.gSystem.Load("libgenfit2")
24 ROOT.gInterpreter.AddIncludePath(os.path.join(genfit_root, "include"))
25 ROOT.gInterpreter.Declare(
26 """
27#include "DAF.h"
28#include "DetPlane.h"
29#include "Exception.h"
30#include "FieldManager.h"
31#include "MaterialEffects.h"
32#include "MeasuredStateOnPlane.h"
33#include "RKTrackRep.h"
34#include "SharedPlanePtr.h"
35#include "StateOnPlane.h"
36#include "TGeoMaterialInterface.h"
37#include "Tools.h"
38#include "Track.h"
39#include "TrackPoint.h"
40#include "WireMeasurement.h"
41"""
42 )
43
44
45def configure(darkphoton=None) -> None:
46 ROOT.gROOT.ProcessLine('#include "' + os.environ["FAIRSHIP"] + '/shipdata/ShipGlobals.h"')
47 pdg = ROOT.TDatabasePDG.Instance()
48 # pythia stuff not known to ROOT
49 pdg.AddParticle("system", "system", 0.0, False, 0.0, 0.0, "XXX", 90)
50 pdg.AddParticle("Pomeron", "Pomeron", 0.0, False, 0.0, 0.0, "Pomeron", 990)
51 pdg.AddParticle("p_diffr+", "p_diffr+", 0.0, False, 0.0, 0.0, "XXX", 9902210)
52 pdg.AddParticle("n_diffr0", "n_diffr0", 0.0, False, 0.0, 0.0, "XXX", 9902110)
53 pdg.AddParticle("C12", "Carbon-12", 12.0, True, 0, 6.0, "nucleus", 1000060120)
54 pdg.AddParticle("C13", "Carbon-13", 13.003355, True, 0, 6.0, "nucleus", 1000060130)
55 pdg.AddParticle("J/psi[3PJ(8)]", "J/psi[3PJ(8)]", 3.29692, False, 0.0, 0.0, "Meson", 9942003)
56 pdg.AddParticle("J/psi[1S0(8)]", "J/psi[1S0(8)]", 3.29692, False, 0.0, 0.0, "Meson", 9941003)
57 pdg.AddParticle("f0(980)", "f0(980)", 1.0, False, 0.0, 0.0, "Meson", 9010221)
58 pdg.AddParticle("psi(3770)", "psi(3770)", 3.77315, False, 0.02720, 0, "Meson", 30443)
59 pdg.AddParticle("psi(3770)[3PJ(8)]", "psi(3770)[3PJ(8)]", 3.97315, False, 0.0, 0, "Meson", 9942033)
60 pdg.AddParticle("J/psi[3S1(8)]", "J/psi[3S1(8)]", 3.29692, False, 0.0, 0, "Meson", 9940003)
61 pdg.AddParticle("chi_0c[3S1(8)]", "chi_0c[3S1(8)]", 3.61475, False, 0.0, 0, "Meson", 9940011)
62 pdg.AddParticle("psi(2S)[1S0(8)]", "psi(2S)[1S0(8)]", 3.88611, False, 0.0, 0, "Meson", 9941103)
63 pdg.AddParticle("psi(2S)[3S1(8)]", "psi(2S)[3S1(8)]", 3.88611, False, 0.0, 0, "Meson", 9940103)
64 pdg.AddParticle("psi(2S)[3PJ(8)]", "psi(2S)[3PJ(8)]", 3.88611, False, 0.0, 0, "Meson", 9942103)
65 pdg.AddParticle("chi_1c[3S1(8)]", "chi_1c[3S1(8)]", 3.71066, False, 0.0, 0, "Meson", 9940023)
66 pdg.AddParticle("chi_2c[3S1(8)]", "chi_2c[3S1(8)]", 3.75620, False, 0.0, 0, "Meson", 9940005)
67 pdg.AddParticle("Upsilon[3S1(8)]", "Upsilon[3S1(8)]", 9.66030, False, 0.0, 0, "Meson", 9950003)
68
69 if darkphoton == 0:
70 return # will be added by pythia8_conf
71 if darkphoton:
72 addDPtoROOT()
73 else:
74 addHNLtoROOT()
None configure(darkphoton=None)