Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pythia8 Module
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
3pia
PXL
Modules
Pythia8 Module
Commits
912868a4
Commit
912868a4
authored
12 years ago
by
komm
Browse files
Options
Downloads
Patches
Plain Diff
improve decay tree & configuration
parent
a5053577
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Pythia8Generator.cpp
+85
-76
85 additions, 76 deletions
Pythia8Generator.cpp
with
85 additions
and
76 deletions
Pythia8Generator.cpp
+
85
−
76
View file @
912868a4
...
...
@@ -34,12 +34,13 @@ private:
std
::
vector
<
std
::
string
>
mode
;
std
::
vector
<
std
::
string
>
colliding_particles
;
std
::
vector
<
std
::
string
>
configList
;
enum
StoredParticles
{
ALL
,
ALL_STABLE
,
HARD_PROCESS
ALL
,
ALL_STABLE
,
HARD_PROCESS
};
StoredParticles
storedParticles
;
...
...
@@ -61,18 +62,25 @@ public:
Pythia8Generator
()
:
Module
()
{
colliding_particles
.
push_back
(
"proton"
);
colliding_particles
.
push_back
(
"anti proton"
);
colliding_particles
.
push_back
(
"electron"
);
colliding_particles
.
push_back
(
"anti electron"
);
colliding_particles
.
push_back
(
"muon"
);
colliding_particles
.
push_back
(
"anti muon"
);
colliding_particles
.
push_back
(
"proton"
);
mode
.
push_back
(
"only hard process"
);
mode
.
push_back
(
"all stable"
);
mode
.
push_back
(
"all"
);
mode
.
push_back
(
"all"
);
colliding_particles
.
push_back
(
"proton"
);
colliding_particles
.
push_back
(
"anti proton"
);
colliding_particles
.
push_back
(
"electron"
);
colliding_particles
.
push_back
(
"anti electron"
);
colliding_particles
.
push_back
(
"muon"
);
colliding_particles
.
push_back
(
"anti muon"
);
colliding_particles
.
push_back
(
"proton"
);
configList
.
push_back
(
"WeakZ0:gmZmode=2"
);
configList
.
push_back
(
"WeakBosonExchange:all=on"
);
configList
.
push_back
(
"WeakSingleBoson:all=on"
);
configList
.
push_back
(
"WeakBosonAndParton:all=on"
);
configList
.
push_back
(
"PhaseSpace:mHatMin=50"
);
configList
.
push_back
(
"PhaseSpace:mHatMax=150"
);
mode
.
push_back
(
"only hard process"
);
mode
.
push_back
(
"all stable"
);
mode
.
push_back
(
"all"
);
mode
.
push_back
(
"all"
);
addSource
(
"out"
,
""
);
addOption
(
"seed"
,
""
,(
int64_t
)
123
);
addOption
(
"number"
,
" "
,(
int64_t
)
10
);
...
...
@@ -81,43 +89,44 @@ public:
addOption
(
"center mass energy"
,
""
,
200.0
);
addOption
(
"eventview name"
,
"the name of the eventview"
,
"Generated"
);
addOption
(
"stored particles"
,
"the particles which are stored into a new eventview with the given name"
,
mode
,
pxl
::
OptionDescription
::
USAGE_TEXT_SELECTION
);
addOption
(
"config strings"
,
""
,
configList
);
running
=
true
;
}
int64_t
getParticleId
(
std
::
string
name
)
{
if
(
name
==
"proton"
)
{
return
2212
;
}
if
(
name
==
"anti proton"
)
{
return
-
2212
;
}
if
(
name
==
"electron"
)
{
return
11
;
}
if
(
name
==
"anti electron"
)
{
return
-
11
;
}
if
(
name
==
"muon"
)
{
return
13
;
}
if
(
name
==
"anti muon"
)
{
return
-
13
;
}
}
StoredParticles
getStoredParticles
(
std
::
string
name
)
{
if
(
name
==
"only hard process"
){
return
HARD_PROCESS
;
}
if
(
name
==
"all stable"
){
return
ALL_STABLE
;
}
if
(
name
==
"all"
){
return
ALL
;
}
}
int64_t
getParticleId
(
std
::
string
name
)
{
if
(
name
==
"proton"
)
{
return
2212
;
}
if
(
name
==
"anti proton"
)
{
return
-
2212
;
}
if
(
name
==
"electron"
)
{
return
11
;
}
if
(
name
==
"anti electron"
)
{
return
-
11
;
}
if
(
name
==
"muon"
)
{
return
13
;
}
if
(
name
==
"anti muon"
)
{
return
-
13
;
}
}
StoredParticles
getStoredParticles
(
std
::
string
name
)
{
if
(
name
==
"only hard process"
){
return
HARD_PROCESS
;
}
if
(
name
==
"all stable"
){
return
ALL_STABLE
;
}
if
(
name
==
"all"
){
return
ALL
;
}
}
~
Pythia8Generator
()
{
...
...
@@ -126,15 +135,13 @@ public:
void
beginJob
()
{
getOption
(
"number"
,
numberOfObjects
);
getOption
(
"seed"
,
seed
);
getOption
(
"seed"
,
seed
);
pythia8
.
readString
(
"Random:setSeed = on"
);
pythia8
.
readString
(
"Random:seed = "
+
seed
);
pythia8
.
readString
(
"WeakZ0:gmZmode=2"
);
pythia8
.
readString
(
"WeakBosonExchange:all=on"
);
pythia8
.
readString
(
"WeakSingleBoson:all=on"
);
pythia8
.
readString
(
"WeakBosonAndParton:all=on"
);
pythia8
.
readString
(
"PhaseSpace:mHatMin=50"
);
pythia8
.
readString
(
"PhaseSpace:mHatMax=150"
);
getOption
(
"config strings"
,
configList
);
for
(
int
cnt
=
0
;
cnt
<
configList
.
size
();
++
cnt
){
pythia8
.
readString
(
configList
[
cnt
]);
}
getOption
(
"colliding particle 1"
,
coll_particle1
);
getOption
(
"colliding particle 2"
,
coll_particle2
);
getOption
(
"center mass energy"
,
cme
);
...
...
@@ -173,11 +180,11 @@ public:
accepted
=
(
fabs
(
status
)
>=
21
and
fabs
(
status
)
<=
29
);
}
if
(
storedParticles
==
ALL_STABLE
)
{
accepted
=
particle
.
isFinal
();
}
accepted
=
particle
.
isFinal
();
}
if
(
storedParticles
==
ALL
)
{
accepted
=
true
;
}
accepted
=
true
;
}
if
(
accepted
)
{
pxl
::
Particle
*
pxl_part
=
new
pxl
::
Particle
();
...
...
@@ -192,22 +199,13 @@ public:
idMap
[
cnt
]
=
pxl_part
;
}
}
map
<
int
,
pxl
::
Particle
*>::
iterator
it
;
for
(
int
cnt
=
0
;
cnt
<
num
;
++
cnt
)
{
Pythia8
::
Particle
particle
=
pEvent
[
cnt
];
if
(
idMap
.
find
(
cnt
)
!=
idMap
.
end
())
{
int
mother1ID
=
particle
.
mother1
();
if
(
mother1ID
>
0
)
{
if
(
idMap
.
find
(
mother1ID
)
!=
idMap
.
end
())
{
(
idMap
[
mother1ID
])
->
linkDaughter
(
idMap
[
cnt
]);
}
}
int
mother2ID
=
particle
.
mother2
();
if
(
mother2ID
>
0
)
{
if
(
idMap
.
find
(
mother2ID
)
!=
idMap
.
end
())
{
(
idMap
[
mother2ID
])
->
linkDaughter
(
idMap
[
cnt
]);
}
if
((
storedParticles
==
ALL
)
||
(
storedParticles
==
HARD_PROCESS
))
{
for
(
int
cnt
=
0
;
cnt
<
num
;
++
cnt
)
{
if
(
idMap
.
find
(
cnt
)
!=
idMap
.
end
())
{
int
mother1ID
=
pEvent
[
cnt
].
mother1
();
linkMother
(
cnt
,
mother1ID
,
idMap
,
pEvent
);
int
mother2ID
=
pEvent
[
cnt
].
mother2
();
linkMother
(
cnt
,
mother2ID
,
idMap
,
pEvent
);
}
}
}
...
...
@@ -219,6 +217,17 @@ public:
return
false
;
}
void
linkMother
(
int
daugtherID
,
int
motherID
,
map
<
int
,
pxl
::
Particle
*>
selectedParticles
,
Pythia8
::
Event
pEvent
)
{
if
(
motherID
>
0
)
{
if
(
selectedParticles
.
find
(
motherID
)
!=
selectedParticles
.
end
())
{
(
selectedParticles
[
motherID
])
->
linkDaughter
(
selectedParticles
[
daugtherID
]);
}
else
{
linkMother
(
daugtherID
,
pEvent
[
motherID
].
mother1
(),
selectedParticles
,
pEvent
);
linkMother
(
daugtherID
,
pEvent
[
motherID
].
mother2
(),
selectedParticles
,
pEvent
);
}
}
}
void
endRun
()
{
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment