Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Sherwood
athena
Commits
a5f97642
Commit
a5f97642
authored
4 years ago
by
Andrii Verbytskyi
Browse files
Options
Downloads
Patches
Plain Diff
Migrate TrigInDetTrackTruth to HepMC3
parent
338bb564
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Trigger/TrigTruthEvent/TrigInDetTruthEvent/src/TrigInDetTrackTruth.cxx
+15
-4
15 additions, 4 deletions
...ruthEvent/TrigInDetTruthEvent/src/TrigInDetTrackTruth.cxx
with
15 additions
and
4 deletions
Trigger/TrigTruthEvent/TrigInDetTruthEvent/src/TrigInDetTrackTruth.cxx
+
15
−
4
View file @
a5f97642
...
@@ -112,7 +112,7 @@ int TrigInDetTrackTruth::updateFamilyTree()
...
@@ -112,7 +112,7 @@ int TrigInDetTrackTruth::updateFamilyTree()
// first get GenParticle pointer
// first get GenParticle pointer
if
(
!
it1
->
isValid
()
)
continue
;
if
(
!
it1
->
isValid
()
)
continue
;
const
HepMC
::
GenParticle
*
p_child
=
(
*
it1
);
auto
p_child
=
(
*
it1
);
log
<<
MSG
::
DEBUG
<<
"GenParticle "
<<
child
<<
" ("
<<
p_child
<<
"); PDG id="
log
<<
MSG
::
DEBUG
<<
"GenParticle "
<<
child
<<
" ("
<<
p_child
<<
"); PDG id="
<<
p_child
->
pdg_id
()
<<
"; status="
<<
p_child
->
status
()
<<
p_child
->
pdg_id
()
<<
"; status="
<<
p_child
->
status
()
<<
"; pT="
<<
p_child
->
momentum
().
perp
()
<<
"; pT="
<<
p_child
->
momentum
().
perp
()
...
@@ -120,8 +120,8 @@ int TrigInDetTrackTruth::updateFamilyTree()
...
@@ -120,8 +120,8 @@ int TrigInDetTrackTruth::updateFamilyTree()
<<
endmsg
;
<<
endmsg
;
// then get production vertex (check against null)
// then get production vertex (check against null)
HepMC
::
GenVertex
*
p_child_vtx
=
p_child
->
production_vertex
();
auto
p_child_vtx
=
p_child
->
production_vertex
();
if
(
p_child_vtx
==
NULL
)
if
(
!
p_child_vtx
)
{
{
log
<<
MSG
::
DEBUG
<<
"GenVertex pointer null: jump to next particle"
<<
endmsg
;
log
<<
MSG
::
DEBUG
<<
"GenVertex pointer null: jump to next particle"
<<
endmsg
;
continue
;
continue
;
...
@@ -131,6 +131,16 @@ int TrigInDetTrackTruth::updateFamilyTree()
...
@@ -131,6 +131,16 @@ int TrigInDetTrackTruth::updateFamilyTree()
/* find mother: there should be only one for final state particles
/* find mother: there should be only one for final state particles
(particles which can leave energy deposits in detectors) */
(particles which can leave energy deposits in detectors) */
#ifdef HEPMC3
// check a mother was found
if
(
p_child_vtx
->
particles_in
().
size
()
==
0
)
{
log
<<
MSG
::
DEBUG
<<
"Mother not found: go to next particle"
<<
endmsg
;
continue
;
}
auto
p_mum
=
p_child_vtx
->
particles_in
().
begin
();
#else
HepMC
::
GenVertex
::
particles_in_const_iterator
p_mum
=
p_child_vtx
->
particles_in_const_begin
();
HepMC
::
GenVertex
::
particles_in_const_iterator
p_mum
=
p_child_vtx
->
particles_in_const_begin
();
// check a mother was found
// check a mother was found
...
@@ -139,6 +149,7 @@ int TrigInDetTrackTruth::updateFamilyTree()
...
@@ -139,6 +149,7 @@ int TrigInDetTrackTruth::updateFamilyTree()
log
<<
MSG
::
DEBUG
<<
"Mother not found: go to next particle"
<<
endmsg
;
log
<<
MSG
::
DEBUG
<<
"Mother not found: go to next particle"
<<
endmsg
;
continue
;
continue
;
}
}
#endif
log
<<
MSG
::
DEBUG
<<
"Mother GenParticle ("
<<
*
p_mum
<<
") found; PDG id="
log
<<
MSG
::
DEBUG
<<
"Mother GenParticle ("
<<
*
p_mum
<<
") found; PDG id="
<<
(
*
p_mum
)
->
pdg_id
()
<<
"; status="
<<
(
*
p_mum
)
->
status
()
<<
(
*
p_mum
)
->
pdg_id
()
<<
"; status="
<<
(
*
p_mum
)
->
status
()
<<
"; pT="
<<
(
*
p_mum
)
->
momentum
().
perp
()
<<
"; pT="
<<
(
*
p_mum
)
->
momentum
().
perp
()
...
@@ -152,7 +163,7 @@ int TrigInDetTrackTruth::updateFamilyTree()
...
@@ -152,7 +163,7 @@ int TrigInDetTrackTruth::updateFamilyTree()
{
{
log
<<
MSG
::
DEBUG
<<
"* Trying daughter index="
<<
child
log
<<
MSG
::
DEBUG
<<
"* Trying daughter index="
<<
child
<<
" and mother index="
<<
mum
<<
endmsg
;
<<
" and mother index="
<<
mum
<<
endmsg
;
const
HepMC
::
GenParticle
*
p2
=
*
it2
;
auto
p2
=
*
it2
;
if
(
*
p_mum
==
p2
)
if
(
*
p_mum
==
p2
)
{
// mother also matches track
{
// mother also matches track
m_family_tree
.
push_back
(
std
::
pair
<
unsigned
int
,
unsigned
int
>
(
mum
,
child
)
);
m_family_tree
.
push_back
(
std
::
pair
<
unsigned
int
,
unsigned
int
>
(
mum
,
child
)
);
...
...
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