Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Project Juggler
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
21
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
EIC
Project Juggler
Merge requests
!322
Require interaction vertex inside box
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Require interaction vertex inside box
track-truth-init-vertex-inside-box
into
master
Overview
0
Commits
3
Pipelines
0
Changes
1
Merged
Wouter Deconinck
requested to merge
track-truth-init-vertex-inside-box
into
master
3 years ago
Overview
0
Commits
3
Pipelines
0
Changes
1
Expand
👍
0
👎
0
Merge request reports
Compare
master
version 4
6df14d4f
3 years ago
version 3
86e870d8
3 years ago
version 2
ac23733e
3 years ago
version 1
7c180bdb
3 years ago
master (base)
and
latest version
latest version
b9304452
3 commits,
3 years ago
version 4
6df14d4f
3 commits,
3 years ago
version 3
86e870d8
2 commits,
3 years ago
version 2
ac23733e
2 commits,
3 years ago
version 1
7c180bdb
1 commit,
3 years ago
1 file
+
38
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
JugTrack/src/components/TrackParamTruthInit.cpp
+
38
−
9
Options
#include
<cmath>
// Gaudi
#include
"Gaudi/Property.h"
#include
"GaudiAlg/GaudiAlgorithm.h"
#include
"GaudiKernel/ToolHandle.h"
#include
"GaudiAlg/Transformer.h"
#include
"GaudiAlg/GaudiTool.h"
#include
"GaudiKernel/PhysicalConstants.h"
#include
"GaudiKernel/RndmGenerators.h"
#include
"Gaudi
/Property
.h"
#include
"Gaudi
Kernel/ToolHandle
.h"
#include
"JugBase/DataHandle.h"
#include
"JugBase/IGeoSvc.h"
@@ -45,6 +46,12 @@ namespace Jug::Reco {
this
};
DataHandle
<
TrackParametersContainer
>
m_outputInitialTrackParameters
{
"outputInitialTrackParameters"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
// selection settings
Gaudi
::
Property
<
double
>
m_maxVertexX
{
this
,
"maxVertexX"
,
80.
*
Gaudi
::
Units
::
mm
};
Gaudi
::
Property
<
double
>
m_maxVertexY
{
this
,
"maxVertexY"
,
80.
*
Gaudi
::
Units
::
mm
};
Gaudi
::
Property
<
double
>
m_maxVertexZ
{
this
,
"maxVertexZ"
,
200.
*
Gaudi
::
Units
::
mm
};
Gaudi
::
Property
<
double
>
m_minMomentum
{
this
,
"minMomentum"
,
100.
*
Gaudi
::
Units
::
MeV
};
SmartIF
<
IParticleSvc
>
m_pidSvc
;
@@ -81,29 +88,51 @@ namespace Jug::Reco {
for
(
const
auto
&
part
:
*
mcparts
)
{
// genStatus = 1 means thrown G4Primary
// genStatus = 1 means thrown G4Primary
, but dd4gun uses genStatus == 0
if
(
part
.
genStatus
()
>
1
)
{
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"ignoring particle with genStatus = "
<<
part
.
genStatus
()
<<
endmsg
;
}
continue
;
}
using
Acts
::
UnitConstants
::
GeV
;
using
Acts
::
UnitConstants
::
MeV
;
using
Acts
::
UnitConstants
::
mm
;
using
Acts
::
UnitConstants
::
um
;
using
Acts
::
UnitConstants
::
ns
;
const
double
p
=
part
.
ps
().
mag
()
*
GeV
;
// require close to interaction vertex
if
(
abs
(
part
.
vs
().
x
)
*
Gaudi
::
Units
::
mm
>
m_maxVertexX
||
abs
(
part
.
vs
().
y
)
*
Gaudi
::
Units
::
mm
>
m_maxVertexY
||
abs
(
part
.
vs
().
z
)
*
Gaudi
::
Units
::
mm
>
m_maxVertexZ
)
{
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"ignoring particle with vs = "
<<
part
.
vs
()
<<
" mm"
<<
endmsg
;
}
continue
;
}
// require minimum momentum
if
(
part
.
ps
().
mag
()
*
Gaudi
::
Units
::
GeV
<
m_minMomentum
)
{
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"ignoring particle with p = "
<<
part
.
ps
().
mag
()
<<
" GeV"
<<
endmsg
;
}
continue
;
}
// get the particle charge
// note that we cannot trust the mcparticles charge, as DD4hep
// sets this value to zero! let's lookup by PDGID instead
const
double
charge
=
m_pidSvc
->
particle
(
part
.
pdgID
()).
charge
;
if
(
abs
(
charge
)
<
std
::
numeric_limits
<
double
>::
epsilon
())
{
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"ignoring neutral particle"
<<
endmsg
;
}
continue
;
}
using
Acts
::
UnitConstants
::
GeV
;
using
Acts
::
UnitConstants
::
MeV
;
using
Acts
::
UnitConstants
::
mm
;
using
Acts
::
UnitConstants
::
um
;
using
Acts
::
UnitConstants
::
ns
;
const
double
p
=
part
.
ps
().
mag
()
*
GeV
;
// build some track cov matrix
Acts
::
BoundSymMatrix
cov
=
Acts
::
BoundSymMatrix
::
Zero
();
cov
(
Acts
::
eBoundLoc0
,
Acts
::
eBoundLoc0
)
=
1000
*
um
*
1000
*
um
;
Loading