FairShip
Loading...
Searching...
No Matches
run_fixedTarget Namespace Reference

Functions

str get_work_dir (run_number, str|None tag=None)
 

Variables

str mcEngine = "TGeant4"
 
str simEngine = "Pythia8"
 
bool checkOverlap = True
 
str outputDir = "."
 
float dy = 6.0
 
int ds = 8
 
logging logger = logging.getLogger(os.path.splitext(os.path.basename(os.sys.argv[0]))[0])
 
argparse ap = argparse.ArgumentParser(description='Run SHiP "pot" simulation')
 
 action
 
 help
 
 type
 
 int
 
 dest
 
 default
 
 float
 
 BooleanOptionalAction
 
 False
 
 e13
 
 str
 
 choices
 
argparse args = ap.parse_args()
 
 charm
 
 beauty
 
bool withEvtGen = False
 
 pythiaDecay
 
 else :
 
argparse charmInputFile = args.charmInputFile
 
 work_dir
 
argparse seed = args.seed
 
dict ship_geo_kwargs
 
geometry_config ship_geo = geometry_config.create_config(**ship_geo_kwargs)
 
str txt = "pythia8_Geant4_"
 
outFile = f"{outputDir}/{txt}{args.runnr}_{args.ecut}.root"
 
parFile = f"{outputDir}/ship.params.{txt}{args.runnr}_{args.ecut}.root"
 
ROOT timer = ROOT.TStopwatch()
 
ROOT run = ROOT.FairRunSim()
 
ROOT rtdb = run.GetRuntimeDb()
 
ROOT cave = ROOT.ShipCave("CAVE")
 
ROOT TargetStation
 
 d
 
 L
 
 G
 
 M
 
ROOT sensPlanePostT = ROOT.exitHadronAbsorber()
 
int n_params = 15
 
 params
 
ROOT MuonShield
 
ROOT sensPlaneHA = ROOT.exitHadronAbsorber()
 
ROOT sensPlaneT = ROOT.exitHadronAbsorber()
 
ROOT primGen = ROOT.FairPrimaryGenerator()
 
ROOT P8gen = ROOT.FixedTargetGenerator()
 
ROOT gMC = ROOT.TVirtualMC.GetMC()
 
ROOT fStack = gMC.GetStack()
 
ROOT gProcessTable = ROOT.G4ProcessTable.GetProcessTable()
 
ROOT procAnnihil = gProcessTable.FindProcess(ROOT.G4String("AnnihiToMuPair"), ROOT.G4String("e+"))
 
ROOT procGMuPair = gProcessTable.FindProcess(ROOT.G4String("GammaToMuPair"), ROOT.G4String("gamma"))
 
ROOT rtime = timer.RealTime()
 
ROOT ctime = timer.CpuTime()
 
tmpFile = outFile + "tmp"
 
ROOT fin = ROOT.gROOT.GetListOfFiles()[0]
 
ROOT fHeader = fin["FileHeader"]
 
ROOT poteq = P8gen.GetPotForCharm()
 
str info = "POT equivalent = %7.3G" % (poteq)
 
str conditions = " with ecut=" + str(args.ecut)
 
ROOT nt = fin.Get("4DP")
 
ROOT tf = ROOT.TFile("FourDP.root", "recreate")
 
ROOT tnt = nt.CloneTree(0)
 
ROOT rc = nt.GetEvent(i)
 
ROOT t = fin["cbmsim"]
 
ROOT fout = ROOT.TFile(tmpFile, "recreate")
 
ROOT sTree = t.CloneTree(0)
 
int nEvents = 0
 
ROOT x = fin.Get(k.GetName())
 
ROOT className = x.Class().GetName()
 
ROOT xcopy = x.Clone()
 
ROOT ff = fin["FileHeader"].Clone(fout.GetName())
 
os rc1 = os.system("rm " + outFile)
 
os rc2 = os.system("mv " + tmpFile + " " + outFile)
 
ROOT sGeo = ROOT.gGeoManager
 

Function Documentation

◆ get_work_dir()

str run_fixedTarget.get_work_dir (   run_number,
str | None   tag = None 
)

Definition at line 35 of file run_fixedTarget.py.

35def get_work_dir(run_number, tag: str | None = None) -> str:
36 import socket
37
38 host = socket.gethostname()
39 job_base_name = os.path.splitext(os.path.basename(os.sys.argv[0]))[0]
40 if tag:
41 out_dir = f"{host}_{job_base_name}_{run_number}_{tag}"
42 else:
43 out_dir = f"{host}_{job_base_name}_{run_number}"
44 return out_dir
45
46

Variable Documentation

◆ action

run_fixedTarget.action

Definition at line 50 of file run_fixedTarget.py.

◆ ap

argparse run_fixedTarget.ap = argparse.ArgumentParser(description='Run SHiP "pot" simulation')

Definition at line 49 of file run_fixedTarget.py.

◆ args

argparse run_fixedTarget.args = ap.parse_args()

Definition at line 179 of file run_fixedTarget.py.

◆ beauty

run_fixedTarget.beauty

Definition at line 186 of file run_fixedTarget.py.

◆ BooleanOptionalAction

run_fixedTarget.BooleanOptionalAction

Definition at line 71 of file run_fixedTarget.py.

◆ cave

ROOT run_fixedTarget.cave = ROOT.ShipCave("CAVE")

Definition at line 269 of file run_fixedTarget.py.

◆ charm

run_fixedTarget.charm

Definition at line 185 of file run_fixedTarget.py.

◆ charmInputFile

argparse run_fixedTarget.charmInputFile = args.charmInputFile

Definition at line 199 of file run_fixedTarget.py.

◆ checkOverlap

bool run_fixedTarget.checkOverlap = True

Definition at line 14 of file run_fixedTarget.py.

◆ choices

run_fixedTarget.choices

Definition at line 115 of file run_fixedTarget.py.

◆ className

ROOT run_fixedTarget.className = x.Class().GetName()

Definition at line 489 of file run_fixedTarget.py.

◆ conditions

str run_fixedTarget.conditions = " with ecut=" + str(args.ecut)

Definition at line 446 of file run_fixedTarget.py.

◆ ctime

ROOT run_fixedTarget.ctime = timer.CpuTime()

Definition at line 426 of file run_fixedTarget.py.

◆ d

run_fixedTarget.d

Definition at line 282 of file run_fixedTarget.py.

◆ default

run_fixedTarget.default

Definition at line 52 of file run_fixedTarget.py.

◆ dest

run_fixedTarget.dest

Definition at line 52 of file run_fixedTarget.py.

◆ ds

int run_fixedTarget.ds = 8

Definition at line 17 of file run_fixedTarget.py.

◆ dy

float run_fixedTarget.dy = 6.0

Definition at line 16 of file run_fixedTarget.py.

◆ e13

run_fixedTarget.e13

Definition at line 96 of file run_fixedTarget.py.

◆ else

run_fixedTarget.else :

Definition at line 192 of file run_fixedTarget.py.

◆ False

run_fixedTarget.False

Definition at line 75 of file run_fixedTarget.py.

◆ ff

ROOT run_fixedTarget.ff = fin["FileHeader"].Clone(fout.GetName())

Definition at line 494 of file run_fixedTarget.py.

◆ fHeader

ROOT run_fixedTarget.fHeader = fin["FileHeader"]

Definition at line 437 of file run_fixedTarget.py.

◆ fin

ROOT run_fixedTarget.fin = ROOT.gROOT.GetListOfFiles()[0]

Definition at line 434 of file run_fixedTarget.py.

◆ float

run_fixedTarget.float

Definition at line 54 of file run_fixedTarget.py.

◆ fout

ROOT run_fixedTarget.fout = ROOT.TFile(tmpFile, "recreate")

Definition at line 474 of file run_fixedTarget.py.

◆ fStack

ROOT run_fixedTarget.fStack = gMC.GetStack()

Definition at line 401 of file run_fixedTarget.py.

◆ G

run_fixedTarget.G

Definition at line 284 of file run_fixedTarget.py.

◆ gMC

ROOT run_fixedTarget.gMC = ROOT.TVirtualMC.GetMC()

Definition at line 400 of file run_fixedTarget.py.

◆ gProcessTable

ROOT run_fixedTarget.gProcessTable = ROOT.G4ProcessTable.GetProcessTable()

Definition at line 414 of file run_fixedTarget.py.

◆ help

run_fixedTarget.help

Definition at line 51 of file run_fixedTarget.py.

◆ info

f run_fixedTarget.info = "POT equivalent = %7.3G" % (poteq)

Definition at line 442 of file run_fixedTarget.py.

◆ int

run_fixedTarget.int

Definition at line 52 of file run_fixedTarget.py.

◆ L

run_fixedTarget.L

Definition at line 283 of file run_fixedTarget.py.

◆ logger

logging run_fixedTarget.logger = logging.getLogger(os.path.splitext(os.path.basename(os.sys.argv[0]))[0])

Definition at line 31 of file run_fixedTarget.py.

◆ M

run_fixedTarget.M

Definition at line 285 of file run_fixedTarget.py.

◆ mcEngine

str run_fixedTarget.mcEngine = "TGeant4"

Definition at line 12 of file run_fixedTarget.py.

◆ MuonShield

ROOT run_fixedTarget.MuonShield
Initial value:
1= ROOT.ShipMuonShield(
2 in_params=list(ship_geo.muShield.params),
3 z=ship_geo.muShield.z,
4 WithConstShieldField=True,
5 SC_key=ship_geo.SC_mag,
6 )

Definition at line 318 of file run_fixedTarget.py.

◆ n_params

int run_fixedTarget.n_params = 15

Definition at line 311 of file run_fixedTarget.py.

◆ nEvents

int run_fixedTarget.nEvents = 0

Definition at line 476 of file run_fixedTarget.py.

◆ nt

ROOT run_fixedTarget.nt = fin.Get("4DP")

Definition at line 462 of file run_fixedTarget.py.

◆ outFile

f run_fixedTarget.outFile = f"{outputDir}/{txt}{args.runnr}_{args.ecut}.root"

Definition at line 249 of file run_fixedTarget.py.

◆ outputDir

str run_fixedTarget.outputDir = "."

Definition at line 15 of file run_fixedTarget.py.

◆ P8gen

ROOT run_fixedTarget.P8gen = ROOT.FixedTargetGenerator()

Definition at line 361 of file run_fixedTarget.py.

◆ params

run_fixedTarget.params

Definition at line 316 of file run_fixedTarget.py.

◆ parFile

f run_fixedTarget.parFile = f"{outputDir}/ship.params.{txt}{args.runnr}_{args.ecut}.root"

Definition at line 250 of file run_fixedTarget.py.

◆ poteq

ROOT run_fixedTarget.poteq = P8gen.GetPotForCharm()

Definition at line 441 of file run_fixedTarget.py.

◆ primGen

ROOT run_fixedTarget.primGen = ROOT.FairPrimaryGenerator()

Definition at line 360 of file run_fixedTarget.py.

◆ procAnnihil

ROOT run_fixedTarget.procAnnihil = gProcessTable.FindProcess(ROOT.G4String("AnnihiToMuPair"), ROOT.G4String("e+"))

Definition at line 415 of file run_fixedTarget.py.

◆ procGMuPair

ROOT run_fixedTarget.procGMuPair = gProcessTable.FindProcess(ROOT.G4String("GammaToMuPair"), ROOT.G4String("gamma"))

Definition at line 416 of file run_fixedTarget.py.

◆ pythiaDecay

run_fixedTarget.pythiaDecay

Definition at line 188 of file run_fixedTarget.py.

◆ rc

ROOT run_fixedTarget.rc = nt.GetEvent(i)

Definition at line 468 of file run_fixedTarget.py.

◆ rc1

os run_fixedTarget.rc1 = os.system("rm " + outFile)

Definition at line 500 of file run_fixedTarget.py.

◆ rc2

os run_fixedTarget.rc2 = os.system("mv " + tmpFile + " " + outFile)

Definition at line 501 of file run_fixedTarget.py.

◆ rtdb

ROOT run_fixedTarget.rtdb = run.GetRuntimeDb()

Definition at line 264 of file run_fixedTarget.py.

◆ rtime

ROOT run_fixedTarget.rtime = timer.RealTime()

Definition at line 425 of file run_fixedTarget.py.

◆ run

ROOT run_fixedTarget.run = ROOT.FairRunSim()

Definition at line 257 of file run_fixedTarget.py.

◆ seed

argparse run_fixedTarget.seed = args.seed

Definition at line 229 of file run_fixedTarget.py.

◆ sensPlaneHA

ROOT run_fixedTarget.sensPlaneHA = ROOT.exitHadronAbsorber()

Definition at line 328 of file run_fixedTarget.py.

◆ sensPlanePostT

ROOT run_fixedTarget.sensPlanePostT = ROOT.exitHadronAbsorber()

Definition at line 291 of file run_fixedTarget.py.

◆ sensPlaneT

ROOT run_fixedTarget.sensPlaneT = ROOT.exitHadronAbsorber()

Definition at line 333 of file run_fixedTarget.py.

◆ sGeo

ROOT run_fixedTarget.sGeo = ROOT.gGeoManager

Definition at line 508 of file run_fixedTarget.py.

◆ ship_geo

geometry_config run_fixedTarget.ship_geo = geometry_config.create_config(**ship_geo_kwargs)

Definition at line 244 of file run_fixedTarget.py.

◆ ship_geo_kwargs

dict run_fixedTarget.ship_geo_kwargs
Initial value:
1= {
2 "Yheight": dy,
3 "DecayVolumeMedium": args.DecayVolumeMedium,
4 "shieldName": args.shieldName,
5 "TARGET_YAML": args.TARGET_YAML,
6}

Definition at line 238 of file run_fixedTarget.py.

◆ simEngine

str run_fixedTarget.simEngine = "Pythia8"

Definition at line 13 of file run_fixedTarget.py.

◆ str

run_fixedTarget.str

Definition at line 107 of file run_fixedTarget.py.

◆ sTree

ROOT run_fixedTarget.sTree = t.CloneTree(0)

Definition at line 475 of file run_fixedTarget.py.

◆ t

ROOT run_fixedTarget.t = fin["cbmsim"]

Definition at line 473 of file run_fixedTarget.py.

◆ TargetStation

ROOT run_fixedTarget.TargetStation
Initial value:
1= ROOT.ShipTargetStation(
2 name="TargetStation",
3 tl=ship_geo.target.length,
4 tz=ship_geo.target.z,
5 nS=ship_geo.target.nS,
6 HeT=ship_geo.target.HeT,
7)

Definition at line 274 of file run_fixedTarget.py.

◆ tf

ROOT run_fixedTarget.tf = ROOT.TFile("FourDP.root", "recreate")

Definition at line 465 of file run_fixedTarget.py.

◆ timer

ROOT run_fixedTarget.timer = ROOT.TStopwatch()

Definition at line 253 of file run_fixedTarget.py.

◆ tmpFile

f run_fixedTarget.tmpFile = outFile + "tmp"

Definition at line 432 of file run_fixedTarget.py.

◆ tnt

ROOT run_fixedTarget.tnt = nt.CloneTree(0)

Definition at line 466 of file run_fixedTarget.py.

◆ txt

str run_fixedTarget.txt = "pythia8_Geant4_"

Definition at line 246 of file run_fixedTarget.py.

◆ type

run_fixedTarget.type

Definition at line 52 of file run_fixedTarget.py.

◆ withEvtGen

bool run_fixedTarget.withEvtGen = False

Definition at line 187 of file run_fixedTarget.py.

◆ work_dir

run_fixedTarget.work_dir

Definition at line 203 of file run_fixedTarget.py.

◆ x

ROOT run_fixedTarget.x = fin.Get(k.GetName())

Definition at line 488 of file run_fixedTarget.py.

◆ xcopy

ROOT run_fixedTarget.xcopy = x.Clone()

Definition at line 491 of file run_fixedTarget.py.