ATLAS Offline Software
ParticleGun_SingleMonopole.py
Go to the documentation of this file.
1 
2 PDG = 4110000
3 loE = (float(monmass) + 10.)*1000.
4 hiE = (float(monmass) + 6000.)*1000.
5 MeVmass=float(monmass)*1000.
6 #--------------------------------------------------------------
7 # Configuration for EvgenJobTransforms
8 #--------------------------------------------------------------
9 evgenConfig.description = "Single magnetic monopole generation for Mass=%s, Gcharge=%s in MC15" % (monmass,gcharge)
10 evgenConfig.keywords = ["exotic", "magneticMonopole", "singleParticle"]
11 evgenConfig.generators = ["ParticleGun"]
12 evgenConfig.contact = ["anlionti@cern.ch"]
13 
14 evgenConfig.specialConfig = 'MASS=%s;GCHARGE=%s;preInclude=SimulationJobOptions/preInclude.Monopole.py' % (monmass,gcharge)
15 
16 
17 
18 #--------------------------------------------------------------
19 # Configuration for ParticleGun
20 #--------------------------------------------------------------
21 include("ParticleGun/ParticleGun_Common.py")
22 
23 import ParticleGun as PG
24 PG.MASSES[4110000] = float(MeVmass)
25 genSeq.ParticleGun.sampler.pid = (-PDG, PDG)
26 genSeq.ParticleGun.sampler.mom = PG.EEtaMPhiSampler(energy=[loE,hiE], eta=[-2,2])
27 
28 
29 #--------------------------------------------------------------
30 # Edit PDGTABLE.MeV with monopole mass
31 #--------------------------------------------------------------
32 ALINE1="M 4110000 %s.E+03 +0.0E+00 -0.0E+00 Monopole 0" % (monmass)
33 ALINE2="W 4110000 0.E+00 +0.0E+00 -0.0E+00 Monopole 0"
34 
35 import os
36 import sys
37 
38 pdgmod = os.path.isfile('PDGTABLE.MeV')
39 if pdgmod is True:
40  os.remove('PDGTABLE.MeV')
41 os.system('get_files -data PDGTABLE.MeV')
42 f=open('PDGTABLE.MeV','a')
43 f.writelines(str(ALINE1))
44 f.writelines('\n')
45 f.writelines(str(ALINE2))
46 f.writelines('\n')
47 f.close()
48 
49 del ALINE1
50 del ALINE2
51 
52 #--------------------------------------------------------------
53 # Edit G4particle_acceptlist.txt with monopole
54 #--------------------------------------------------------------
55 
56 ALINE1="4110000 mm %s.E+03 (Mev/c) lepton %s" % (monmass,gcharge)
57 ALINE2="-4110000 mmbar %s.E+03 (Mev/c) lepton -%s" % (monmass,gcharge)
58 
59 import os
60 import sys
61 
62 pdgmod = os.path.isfile('G4particle_acceptlist.txt')
63 if pdgmod is True:
64  os.remove('G4particle_acceptlist.txt')
65 os.system('get_files -data G4particle_acceptlist.txt')
66 f=open('G4particle_acceptlist.txt','a')
67 f.writelines(str(ALINE1))
68 f.writelines('\n')
69 f.writelines(str(ALINE2))
70 f.writelines('\n')
71 f.close()
72 
73 del ALINE1
74 del ALINE2
python.Include.include
include
Definition: Include.py:318
Trk::open
@ open
Definition: BinningType.h:40
str
Definition: BTagTrackIpAccessor.cxx:11
readCCLHist.float
float
Definition: readCCLHist.py:83