SND@LHC Software
Loading...
Searching...
No Matches
g4Ex Namespace Reference

Classes

class  MyEventAction
 
class  MyGeneratorAction
 
class  MyRunAction
 
class  MySteppingAction
 
class  MyTrackingAction
 
class  ScoreSD
 

Functions

 ConstructGeom ()
 

Variables

bool debug = False
 
bool withNtuple = True
 
bool muonNuclear = True
 
str model = "QGSP_BERT_EMX"
 
int runnr = 1
 
int nev = 100
 
int nevTot = 0
 
int myEventnr = 0
 
int mytrack = 1
 
int scoreLog = 1
 
dict myTimer = {'total':0,'pythia':0,'geant4_conv':0}
 
int ecut = 10
 
bool tauOnly = False
 
 myPythia = ROOT.TPythia8()
 
 rnr = ROOT.TRandom()
 
 R = int(time.time()%900000000)
 
dict h = {}
 
 f = ROOT.TFile.Open('pythia8_Geant4_'+str(runnr)+'_'+str(ecut)+'.root', 'RECREATE')
 
list leptons = [12,13,14,15,16]
 
list pionkaons = [211,321]
 
list rest = [130,310,3122]
 
list allPart = []
 
list notWanted = [22,11,-11,990]
 
 rand_engine = Ranlux64Engine()
 
 physList = Geant4.FTFP_BERT()
 
 factory = G4physicslists.G4PhysListFactory()
 
 xx = factory.GetReferencePhysList(model)
 
 myGE = MyGeneratorAction()
 
 myTA = MyTrackingAction()
 
 myRA = MyRunAction()
 
 myEA = MyEventAction()
 
 sens = ScoreSD('Score')
 
 t0 = time.time()
 
 t1 = time.time()
 

Function Documentation

◆ ConstructGeom()

g4Ex.ConstructGeom ( )

Definition at line 219 of file g4Ex.py.

219def ConstructGeom():
220 print("* Constructing geometry...")
221 world_r = 100.*m
222 # reset world material
223 vac = G4Material.GetMaterial("G4_Galactic")
224 g4py.ezgeom.SetWorldMaterial(vac)
225 g4py.ezgeom.ResizeWorld(world_r, world_r, world_r)
226 # a snoopy world is placed
227 global snoopy,snoopyPhys,scoreLog
228 snoopy = G4EzVolume("Snoopy")
229 snoopy.CreateTubeVolume(vac, 0., 10*m, 50.*m)
230 snoopyPhys = snoopy.PlaceIt(G4ThreeVector(0.,0.,0.*m))
231 snoopyLog = snoopyPhys.GetLogicalVolume()
232 snoopy.SetVisibility(False)
233 # a target box is placed
234 global target,targetPhys
235 iron = G4Material.GetMaterial("G4_Fe")
236 air = G4Material.GetMaterial("G4_AIR")
237 tungsten = G4Material.GetMaterial("G4_W")
238 lead = G4Material.GetMaterial("G4_Pb")
239 alum = G4Material.GetMaterial("G4_Al")
240 target = G4EzVolume("Target")
241 target.CreateTubeVolume(tungsten, 0., 25.*cm, 25.*cm)
242 targetPhys = target.PlaceIt(G4ThreeVector(0.,0.,-50.*m+25.*cm),1,snoopy)
243 target.SetColor(G4Color(0.0,0.5,0.5,1.0))
244 target.SetVisibility(True)
245 # = 0.1m3 = 2t
246 # a hadron absorber is placed
247 absorber = G4EzVolume("Absorber")
248# iron alloys saturate at 1.6-2.2T
249 # inner radius outer radius length
250 absorber.CreateTubeVolume(iron, 0., 100.*cm, 150.*cm)
251 absorberPhys = absorber.PlaceIt(G4ThreeVector(0.,0.,-50*m+2*25.*cm+150.*cm),1,snoopy)
252 absorber.SetColor(G4Color(0.898,0.902,0.91,1.0))
253 absorber.SetVisibility(True)
254 xx = G4VisAttributes()
255 xx.SetForceWireframe(True)
256 absorberlog = absorberPhys.GetLogicalVolume()
257 absorberlog.SetVisAttributes(xx)
258# scoring plane
259 scorez = -50.*m+2*25.*cm+2*150.*cm+1*mm
260 score = G4EzVolume("Score")
261 score.CreateTubeVolume(vac, 0., 50.*m, 1.*mm)
262 scorePhys = score.PlaceIt(G4ThreeVector(0.,0.,scorez),1,snoopy)
263 scoreLog = scorePhys.GetLogicalVolume()
264 g4py.ezgeom.Construct()
265

Variable Documentation

◆ allPart

list g4Ex.allPart = []

Definition at line 80 of file g4Ex.py.

◆ debug

bool g4Ex.debug = False

Definition at line 2 of file g4Ex.py.

◆ ecut

g4Ex.ecut = 10

Definition at line 13 of file g4Ex.py.

◆ f

g4Ex.f = ROOT.TFile.Open('pythia8_Geant4_'+str(runnr)+'_'+str(ecut)+'.root', 'RECREATE')

Definition at line 74 of file g4Ex.py.

◆ factory

g4Ex.factory = G4physicslists.G4PhysListFactory()

Definition at line 274 of file g4Ex.py.

◆ h

dict g4Ex.h = {}

Definition at line 72 of file g4Ex.py.

◆ leptons

list g4Ex.leptons = [12,13,14,15,16]

Definition at line 77 of file g4Ex.py.

◆ model

str g4Ex.model = "QGSP_BERT_EMX"

Definition at line 5 of file g4Ex.py.

◆ muonNuclear

bool g4Ex.muonNuclear = True

Definition at line 4 of file g4Ex.py.

◆ myEA

g4Ex.myEA = MyEventAction()

Definition at line 291 of file g4Ex.py.

◆ myEventnr

int g4Ex.myEventnr = 0

Definition at line 9 of file g4Ex.py.

◆ myGE

g4Ex.myGE = MyGeneratorAction()

Definition at line 279 of file g4Ex.py.

◆ myPythia

g4Ex.myPythia = ROOT.TPythia8()

Definition at line 43 of file g4Ex.py.

◆ myRA

g4Ex.myRA = MyRunAction()

Definition at line 288 of file g4Ex.py.

◆ myTA

g4Ex.myTA = MyTrackingAction()

Definition at line 282 of file g4Ex.py.

◆ myTimer

dict g4Ex.myTimer = {'total':0,'pythia':0,'geant4_conv':0}

Definition at line 12 of file g4Ex.py.

◆ mytrack

int g4Ex.mytrack = 1

Definition at line 10 of file g4Ex.py.

◆ nev

g4Ex.nev = 100

Definition at line 7 of file g4Ex.py.

◆ nevTot

int g4Ex.nevTot = 0

Definition at line 8 of file g4Ex.py.

◆ notWanted

list g4Ex.notWanted = [22,11,-11,990]

Definition at line 84 of file g4Ex.py.

◆ physList

g4Ex.physList = Geant4.FTFP_BERT()

Definition at line 269 of file g4Ex.py.

◆ pionkaons

list g4Ex.pionkaons = [211,321]

Definition at line 78 of file g4Ex.py.

◆ R

g4Ex.R = int(time.time()%900000000)

Definition at line 63 of file g4Ex.py.

◆ rand_engine

g4Ex.rand_engine = Ranlux64Engine()

Definition at line 91 of file g4Ex.py.

◆ rest

list g4Ex.rest = [130,310,3122]

Definition at line 79 of file g4Ex.py.

◆ rnr

g4Ex.rnr = ROOT.TRandom()

Definition at line 44 of file g4Ex.py.

◆ runnr

g4Ex.runnr = 1

Definition at line 6 of file g4Ex.py.

◆ scoreLog

int g4Ex.scoreLog = 1

Definition at line 11 of file g4Ex.py.

◆ sens

g4Ex.sens = ScoreSD('Score')

Definition at line 297 of file g4Ex.py.

◆ t0

g4Ex.t0 = time.time()

Definition at line 300 of file g4Ex.py.

◆ t1

g4Ex.t1 = time.time()

Definition at line 302 of file g4Ex.py.

◆ tauOnly

g4Ex.tauOnly = False

Definition at line 18 of file g4Ex.py.

◆ withNtuple

bool g4Ex.withNtuple = True

Definition at line 3 of file g4Ex.py.

◆ xx

g4Ex.xx = factory.GetReferencePhysList(model)

Definition at line 275 of file g4Ex.py.