Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
EIC
Project Juggler
Commits
0d807307
Commit
0d807307
authored
Jun 25, 2022
by
Wouter Deconinck
Browse files
Resolve "Build all algorithms to avoid stale code"
parent
e7241f07
Pipeline
#32577
passed with stages
in 6 minutes and 57 seconds
Changes
12
Pipelines
12
Hide whitespace changes
Inline
Side-by-side
JugBase/CMakeLists.txt
View file @
0d807307
...
...
@@ -5,14 +5,14 @@
# Package: JugBase
################################################################################
file
(
GLOB JugBase_sources CONFIGURE_DEPENDS src/*.cpp
)
file
(
GLOB JugBase_plugins CONFIGURE_DEPENDS src/Plugins/*.cpp
)
file
(
GLOB JugBase_utilities CONFIGURE_DEPENDS src/Utilities/*.cpp
)
gaudi_add_library
(
JugBase
SOURCES
src/ACTSLogger.cpp
src/PodioDataSvc.cpp
src/KeepDropSwitch.cpp
src/Utilities/Helpers.cpp
src/Utilities/Paths.cpp
src/Plugins/DD4hepBField.cpp
${
JugBase_sources
}
${
JugBase_plugins
}
${
JugBase_utilities
}
LINK
Gaudi::GaudiKernel Gaudi::GaudiAlgLib
podio::podioRootIO
...
...
@@ -30,16 +30,10 @@ target_include_directories(JugBase PUBLIC
target_compile_options
(
JugBase PRIVATE -Wno-suggest-override
)
file
(
GLOB JugBasePlugins_sources src/components/*.cpp
)
file
(
GLOB JugBasePlugins_sources
CONFIGURE_DEPENDS
src/components/*.cpp
)
gaudi_add_module
(
JugBasePlugins
SOURCES
src/components/EICDataSvc.cpp
src/components/GeoSvc.cpp
src/components/ParticleSvc.cpp
src/components/InputCopier.cpp
src/components/PodioInput.cpp
src/components/PodioOutput.cpp
src/components/ReadTestConsumer.cxx
${
JugBasePlugins_sources
}
LINK
Gaudi::GaudiKernel Gaudi::GaudiAlgLib
ROOT::Core ROOT::RIO ROOT::Tree
...
...
JugDigi/CMakeLists.txt
View file @
0d807307
...
...
@@ -5,14 +5,10 @@
# Package: JugDigi
################################################################################
file
(
GLOB JugDigiPlugins_sources src/components/*.cpp
)
file
(
GLOB JugDigiPlugins_sources
CONFIGURE_DEPENDS
src/components/*.cpp
)
gaudi_add_module
(
JugDigiPlugins
SOURCES
src/components/CalorimeterHitDigi.cpp
src/components/CalorimeterBirksCorr.cpp
src/components/PhotoMultiplierDigi.cpp
src/components/SiliconTrackerDigi.cpp
src/components/SimTrackerHitsCollector.cpp
${
JugDigiPlugins_sources
}
LINK
Gaudi::GaudiAlgLib Gaudi::GaudiKernel
JugBase
...
...
JugFast/CMakeLists.txt
View file @
0d807307
...
...
@@ -5,16 +5,10 @@
# Package: JugFast
################################################################################
file
(
GLOB JugFastPlugins_sources CONFIGURE_DEPENDS src/components/*.cpp
)
gaudi_add_module
(
JugFastPlugins
SOURCES
src/components/InclusiveKinematicsTruth.cpp
src/components/ClusterMerger.cpp
src/components/MatchClusters.cpp
src/components/MC2SmearedParticle.cpp
src/components/ParticlesWithTruthPID.cpp
src/components/SmearedFarForwardParticles.cpp
src/components/TruthEnergyPositionClusterMerger.cpp
src/components/TruthClustering.cpp
${
JugFastPlugins_sources
}
LINK
Gaudi::GaudiAlgLib Gaudi::GaudiKernel
JugBase
...
...
JugPID/CMakeLists.txt
View file @
0d807307
...
...
@@ -5,10 +5,10 @@
# Package: JugPID
################################################################################
file
(
GLOB JugPIDPlugins_sources CONFIGURE_DEPENDS src/components/*.cpp
)
gaudi_add_module
(
JugPIDPlugins
SOURCES
src/components/FuzzyKClusters.cpp
src/components/PhotoRingClusters.cpp
${
JugPIDPlugins_sources
}
LINK
Gaudi::GaudiAlgLib Gaudi::GaudiKernel
JugBase
...
...
JugReco/CMakeLists.txt
View file @
0d807307
...
...
@@ -5,34 +5,10 @@
# Package: JugReco
################################################################################
file
(
GLOB JugRecoPlugins_sources src/components/*.cpp
)
file
(
GLOB JugRecoPlugins_sources
CONFIGURE_DEPENDS
src/components/*.cpp
)
gaudi_add_module
(
JugRecoPlugins
SOURCES
src/components/FarForwardParticles.cpp
src/components/FarForwardParticlesOMD.cpp
src/components/TrackingHitsCollector.cpp
src/components/TrackingHitsCollector2.cpp
src/components/TrackerHitReconstruction.cpp
src/components/SimpleClustering.cpp
src/components/CalorimeterHitReco.cpp
src/components/CalorimeterHitsEtaPhiProjector.cpp
src/components/CalorimeterHitsMerger.cpp
src/components/CalorimeterIslandCluster.cpp
src/components/EnergyPositionClusterMerger.cpp
src/components/ClusterRecoCoG.cpp
src/components/ParticleCollector.cpp
src/components/ImagingPixelReco.cpp
src/components/ImagingPixelMerger.cpp
src/components/ImagingPixelDataCombiner.cpp
src/components/ImagingPixelDataSorter.cpp
src/components/ImagingTopoCluster.cpp
src/components/ImagingClusterReco.cpp
src/components/InclusiveKinematicsElectron.cpp
src/components/InclusiveKinematicsDA.cpp
src/components/InclusiveKinematicsJB.cpp
src/components/InclusiveKinematicsSigma.cpp
src/components/InclusiveKinematicseSigma.cpp
src/components/PhotoMultiplierReco.cpp
${
JugRecoPlugins_sources
}
LINK
Gaudi::GaudiAlgLib Gaudi::GaudiKernel
JugBase
...
...
JugTrack/CMakeLists.txt
View file @
0d807307
...
...
@@ -5,30 +5,10 @@
# Package: JugTrack
################################################################################
file
(
GLOB JugTrackPlugins_sources src/components/*.cpp
)
file
(
GLOB JugTrackPlugins_sources
CONFIGURE_DEPENDS
src/components/*.cpp
)
gaudi_add_module
(
JugTrackPlugins
SOURCES
src/components/ConformalXYPeakProtoTracks.cpp
src/components/FinderAlgoTemplate.cpp
src/components/ProtoTrackMatching.cpp
src/components/GenFitTrackFitter.cpp
src/components/SingleTrackSourceLinker.cpp
src/components/TrackerSourceLinker.cpp
src/components/CKFTracking.cpp
src/components/CKFTrackingFunction.cpp
src/components/TrackFindingAlgorithm.cpp
src/components/TrackFindingAlgorithmFunction.cpp
src/components/TrackFittingAlgorithm.cpp
src/components/TrackFittingFunction.cpp
src/components/TestACTSLogger.cpp
src/components/TrackParamTruthInit.cpp
src/components/TrackParamClusterInit.cpp
src/components/TrackParamVertexClusterInit.cpp
src/components/TrackParamImagingClusterInit.cpp
src/components/ParticlesFromTrackFit.cpp
#src/components/TrajectoryFromTrackFit.cpp
src/components/TruthTrackSeeding.cpp
src/components/TrackParamACTSSeeding.cpp
${
JugTrackPlugins_sources
}
LINK
Gaudi::GaudiAlgLib Gaudi::GaudiKernel
JugBase
...
...
@@ -40,8 +20,6 @@ gaudi_add_module(JugTrackPlugins
${
genfit2
}
)
target_include_directories
(
JugTrackPlugins PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_SOURCE_DIR
}
/JugBase>
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_LIST_DIR
}
>
...
...
@@ -50,9 +28,3 @@ target_include_directories(JugTrackPlugins PUBLIC
)
target_compile_options
(
JugTrackPlugins PRIVATE -Wno-suggest-override
)
#gaudi_add_test(loggerTest
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
# FRAMEWORK tests/options/testLogger.py
# )
JugTrack/src/components/ActsTrajectoryReader.cpp
deleted
100644 → 0
View file @
e7241f07
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2022 Sylvester Joosten, Whitney Armstrong
#include
<algorithm>
// Gaudi
#include
"Gaudi/Property.h"
#include
"GaudiAlg/GaudiAlgorithm.h"
#include
"GaudiAlg/GaudiTool.h"
#include
"GaudiAlg/Transformer.h"
#include
"GaudiKernel/RndmGenerators.h"
#include
"GaudiKernel/ToolHandle.h"
#include
"DDRec/CellIDPositionConverter.h"
#include
"DDRec/Surface.h"
#include
"DDRec/SurfaceManager.h"
#include
"JugBase/DataHandle.h"
#include
"JugBase/IGeoSvc.h"
#include
"Acts/EventData/MultiTrajectory.hpp"
#include
"Acts/EventData/MultiTrajectoryHelpers.hpp"
// Event Model related classes
#include
"JugTrack/IndexSourceLink.hpp"
#include
"JugTrack/Track.hpp"
#include
"JugTrack/Trajectories.hpp"
#include
"eicd/BasicParticleCollection.h"
#include
"eicd/TrackParametersCollection.h"
#include
"eicd/TrackerHitCollection.h"
#include
"Acts/Utilities/Helpers.hpp"
#include
"eicd/VectorPolar.h"
#include
<cmath>
namespace
Jug
::
Track
{
/** Read and convert the Acts trajectory information to create EICD trajectory and track
* parameter structures
*
* \ingroup tracking
*/
class
ActsTrajectoryReader
:
public
GaudiAlgorithm
{
private:
DataHandle
<
eicd
::
TrackerHitCollection
>
m_inputHits
{
"inputHits"
,
Gaudi
::
DataHandle
::
Reader
,
this
};
DataHandle
<
TrajectoriesContainer
>
m_inputTrajectories
{
"inputActsTrajectories"
,
Gaudi
::
DataHandle
::
Reader
,
this
};
DataHandle
<
eicd
::
TrajectoryCollection
>
m_outputTrajectories
{
"outputTrajectories"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
DataHandle
<
eicd
::
TrackParametersCollection
>
m_outputParameters
{
"outputParameters"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
public:
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
ActsTrajectoryReader
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
:
GaudiAlgorithm
(
name
,
svcLoc
)
{
declareProperty
(
"inputHits"
,
m_inputHits
,
""
);
declareProperty
(
"inputActsTrajectories"
,
m_inputTrajectories
,
""
);
declareProperty
(
"outputTrajectories"
,
m_outputTrajectories
,
""
);
declareProperty
(
"outputParameters"
,
m_outputParameters
,
"Acts Track Parameters"
);
}
StatusCode
initialize
()
override
{
if
(
GaudiAlgorithm
::
initialize
().
isFailure
())
return
StatusCode
::
FAILURE
;
return
StatusCode
::
SUCCESS
;
}
StatusCode
execute
()
override
{
// input
const
TrajectoriesContainer
&
acts_traj
=
*
(
m_inputTrajectories
.
get
());
const
eicd
::
TrackerHitCollection
&
hits
=
*
(
m_inputHits
.
get
());
// create output collections
auto
out_traj
=
m_outputTrajectories
.
createAndPut
();
auto
out_pars
=
m_outputParameters
.
createAndPut
();
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
std
::
size
(
*
trajectories
)
<<
" trajectories "
<<
endmsg
;
}
// Loop over the trajectories
for
(
const
auto
&
traj
:
acts_traj
)
{
// Get the entry index for the single trajectory
// The trajectory entry indices and the multiTrajectory
const
auto
&
mj
=
traj
.
multiTrajectory
();
const
auto
&
trackTips
=
traj
.
tips
();
if
(
trackTips
.
empty
())
{
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"Empty multiTrajectory."
<<
endmsg
;
}
continue
;
}
auto
&
trackTip
=
trackTips
.
front
();
// Collect the trajectory summary info
auto
trajState
=
Acts
::
MultiTrajectoryHelpers
::
trajectoryState
(
mj
,
trackTip
);
// int m_nMeasurements = trajState.nMeasurements;
// int m_nStates = trajState.nStates;
// Get the fitted track parameter
//
bool
hasFittedParams
=
false
;
if
(
traj
.
hasTrackParameters
(
trackTip
))
{
hasFittedParams
=
true
;
const
auto
&
boundParam
=
traj
.
trackParameters
(
trackTip
);
const
auto
&
parameter
=
boundParam
.
parameters
();
const
auto
&
covariance
=
*
boundParam
.
covariance
();
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"loc 0 = "
<<
parameter
[
Acts
::
eBoundLoc0
]
<<
endmsg
;
debug
()
<<
"loc 1 = "
<<
parameter
[
Acts
::
eBoundLoc1
]
<<
endmsg
;
debug
()
<<
"phi = "
<<
parameter
[
Acts
::
eBoundPhi
]
<<
endmsg
;
debug
()
<<
"theta = "
<<
parameter
[
Acts
::
eBoundTheta
]
<<
endmsg
;
debug
()
<<
"q/p = "
<<
parameter
[
Acts
::
eBoundQOverP
]
<<
endmsg
;
debug
()
<<
"p = "
<<
1.0
/
parameter
[
Acts
::
eBoundQOverP
]
<<
endmsg
;
debug
()
<<
"err phi = "
<<
sqrt
(
covariance
(
Acts
::
eBoundPhi
,
Acts
::
eBoundPhi
))
<<
endmsg
;
debug
()
<<
"err th = "
<<
sqrt
(
covariance
(
Acts
::
eBoundTheta
,
Acts
::
eBoundTheta
))
<<
endmsg
;
debug
()
<<
"err q/p = "
<<
sqrt
(
covariance
(
Acts
::
eBoundQOverP
,
Acts
::
eBoundQOverP
))
<<
endmsg
;
debug
()
<<
" chi2 = "
<<
trajState
.
chi2Sum
<<
endmsg
;
}
const
std
::
array
<
float
,
21
>
covMatrix
{
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc0
,
Acts
::
eBoundLoc0
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc1
,
Acts
::
eBoundLoc1
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundTheta
,
Acts
::
eBoundTheta
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundPhi
,
Acts
::
eBoundPhi
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundQOverP
,
Acts
::
eBoundQOverP
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundTime
,
Acts
::
eBoundTime
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc0
,
Acts
::
eBoundLoc1
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc0
,
Acts
::
eBoundTheta
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc0
,
Acts
::
eBoundPhi
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc0
,
Acts
::
eBoundQOverP
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc0
,
Acts
::
eBoundTime
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc1
,
Acts
::
eBoundTheta
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc1
,
Acts
::
eBoundPhi
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc1
,
Acts
::
eBoundQOverP
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc1
,
Acts
::
eBoundTime
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundTheta
,
Acts
::
eBoundPhi
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundTheta
,
Acts
::
eBoundQOverP
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundTheta
,
Acts
::
eBoundTime
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundPhi
,
Acts
::
eBoundQOverP
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundPhi
,
Acts
::
eBoundTime
)),
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundQOverP
,
Acts
::
eBoundTime
))};
eicd
::
TrackParameters
pars
{
0
,
// type: track head --> 0
{
parameter
[
Acts
::
eBoundLoc0
],
parameter
[
Acts
::
eBoundLoc1
]},
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundTheta
]),
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundPhi
]),
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundQOverP
]),
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundTime
]),
covMatrix
};
track_pars
->
push_back
(
pars
);
}
auto
tsize
=
trackTips
.
size
();
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"# fitted parameters : "
<<
tsize
<<
endmsg
;
}
if
(
tsize
==
0
)
continue
;
mj
.
visitBackwards
(
tsize
-
1
,
[
&
](
auto
&&
trackstate
)
{
// debug() << trackstate.hasPredicted() << endmsg;
// debug() << trackstate.predicted() << endmsg;
auto
params
=
trackstate
.
predicted
();
//<< endmsg;
double
p0
=
(
1.0
/
params
[
Acts
::
eBoundQOverP
])
/
Acts
::
UnitConstants
::
GeV
;
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"track predicted p = "
<<
p0
<<
" GeV"
<<
endmsg
;
}
if
(
std
::
abs
(
p0
)
>
500
)
{
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"skipping"
<<
endmsg
;
}
return
;
}
eicd
::
BasicParticle
p
{
{
-
1
,
0
},
eicd
::
VectorPolar
(
// 3-momentum vector
{
1.0
/
std
::
abs
(
params
[
Acts
::
eBoundQOverP
]),
params
[
Acts
::
eBoundTheta
],
params
[
Acts
::
eBoundPhi
]}),
{
0.
,
0.
,
0.
},
// vectex 3-vector
0.
,
// time
0
,
// PDG particle code
0
,
// status
static_cast
<
int16_t
>
(
std
::
copysign
(
1.
,
params
[
Acts
::
eBoundQOverP
])),
// charge
1.
// weight
};
// charge
rec_parts
->
push_back
(
p
);
});
}
// set our IDs
for
(
size_t
i
=
0
;
i
<
rec_parts
->
size
();
++
i
)
{
(
*
rec_parts
)[
i
].
ID
({
static_cast
<
int32_t
>
(
i
),
0
});
}
return
StatusCode
::
SUCCESS
;
}
};
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
DECLARE_COMPONENT
(
ActsTrajectoryReader
)
}
// namespace Jug::Track
JugTrack/src/components/HoughTransformProtoTracks.cpp
View file @
0d807307
...
...
@@ -43,11 +43,9 @@ public:
StatusCode
execute
()
override
{
// input collection
const
eicd
::
TrackerHitCollection
*
hits
=
m_inputTrackerHits
.
get
();
//
const eicd::TrackerHitCollection* hits = m_inputTrackerHits.get();
// Create output collections
auto
proto_tracks
=
m_outputProtoTracks
.
createAndPut
();
//
//auto proto_tracks = m_outputProtoTracks.createAndPut();
return
StatusCode
::
SUCCESS
;
}
...
...
JugTrack/src/components/ParticlesFromTrackFit.cpp
View file @
0d807307
...
...
@@ -43,7 +43,6 @@ namespace Jug::Reco {
*/
class
ParticlesFromTrackFit
:
public
GaudiAlgorithm
{
private:
//DataHandle<eicd::RawTrackerHitCollection> m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this};
DataHandle
<
TrajectoriesContainer
>
m_inputTrajectories
{
"inputTrajectories"
,
Gaudi
::
DataHandle
::
Reader
,
this
};
DataHandle
<
eicd
::
BasicParticleCollection
>
m_outputParticles
{
"outputParticles"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
DataHandle
<
eicd
::
TrackParametersCollection
>
m_outputTrackParameters
{
"outputTrackParameters"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
...
...
@@ -134,16 +133,17 @@ namespace Jug::Reco {
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundLoc0
,
Acts
::
eBoundLoc1
))};
const
float
timeError
{
sqrt
(
static_cast
<
float
>
(
covariance
(
Acts
::
eBoundTime
,
Acts
::
eBoundTime
)))};
eicd
::
TrackParameters
pars
{
0
,
// type: track head --> 0
loc
,
covPos
,
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundTheta
]),
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundPhi
]),
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundQOverP
]),
covMomentum
,
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundTime
]),
timeError
,
static_cast
<
float
>
(
boundParam
.
charge
())};
eicd
::
TrackParameters
pars
{
0
,
// type: track head --> 0
loc
,
covPos
,
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundTheta
]),
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundPhi
]),
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundQOverP
]),
covMomentum
,
static_cast
<
float
>
(
parameter
[
Acts
::
eBoundTime
]),
timeError
,
static_cast
<
float
>
(
boundParam
.
charge
())};
track_pars
->
push_back
(
pars
);
}
...
...
@@ -172,16 +172,17 @@ namespace Jug::Reco {
}
eicd
::
BasicParticle
p
{
eicd
::
sphericalToVector
(
1.0
/
std
::
abs
(
params
[
Acts
::
eBoundQOverP
]),
params
[
Acts
::
eBoundTheta
],
params
[
Acts
::
eBoundPhi
]),
{
0.
,
0.
,
0.
},
// vectex 3-vector
0.
,
// time
0
,
// PDG particle code
0
,
// status
static_cast
<
int16_t
>
(
std
::
copysign
(
1.
,
params
[
Acts
::
eBoundQOverP
])),
// charge
1.
// weight
};
// charge
eicd
::
sphericalToVector
(
1.0
/
std
::
abs
(
params
[
Acts
::
eBoundQOverP
]),
params
[
Acts
::
eBoundTheta
],
params
[
Acts
::
eBoundPhi
]),
// momentum 3-vector
{
0.
,
0.
,
0.
},
// vectex 3-vector
0.
,
// time
0
,
// PDG particle code
0
,
// status
static_cast
<
int16_t
>
(
std
::
copysign
(
1.
,
params
[
Acts
::
eBoundQOverP
])),
// charge
1.
// weight
};
// charge
rec_parts
->
push_back
(
p
);
});
}
...
...
JugTrack/src/components/TrackProjector.cpp
View file @
0d807307
...
...
@@ -3,8 +3,6 @@
#include
<algorithm>
// FIXME needs renaming (TrackProjector) and updating to fix and remove hardcoded numbers
// Gaudi
#include
"GaudiAlg/GaudiAlgorithm.h"
#include
"GaudiKernel/ToolHandle.h"
...
...
@@ -19,7 +17,6 @@
#include
"JugBase/DataHandle.h"
#include
"JugBase/IGeoSvc.h"
#include
"JugBase/UniqueID.h"
#include
"Acts/EventData/MultiTrajectory.hpp"
#include
"Acts/EventData/MultiTrajectoryHelpers.hpp"
...
...
@@ -29,6 +26,7 @@
#include
"eicd/TrackerHitCollection.h"
#include
"eicd/TrackParametersCollection.h"
#include
"eicd/TrajectoryCollection.h"
#include
"eicd/TrackSegmentCollection.h"
#include
"JugTrack/IndexSourceLink.hpp"
#include
"JugTrack/Track.hpp"
#include
"JugTrack/Trajectories.hpp"
...
...
@@ -41,7 +39,7 @@
#include
"Acts/Propagator/EigenStepper.hpp"
#include
"Acts/Surfaces/PerigeeSurface.hpp"
#include
"eicd/
V
ector
Polar
.h"
#include
"eicd/
v
ector
_utils
.h"
#include
<cmath>
...
...
@@ -51,18 +49,25 @@ namespace Jug::Reco {
*
* \ingroup tracking
*/
class
TrajectoryFromTrackFit
:
public
GaudiAlgorithm
,
AlgorithmIDMixin
<
int32_t
>
{
public:
DataHandle
<
TrajectoriesContainer
>
m_inputTrajectories
{
"inputTrajectories"
,
Gaudi
::
DataHandle
::
Reader
,
this
};
DataHandle
<
eicd
::
TrajectoryCollection
>
m_outputTrajectory
{
"outputTrajectoryParameters"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
class
TrackProjector
:
public
GaudiAlgorithm
{
private:
DataHandle
<
TrajectoriesContainer
>
m_inputTrajectories
{
"inputTrajectories"
,
Gaudi
::
DataHandle
::
Reader
,
this
};
DataHandle
<
eicd
::
TrackSegmentCollection
>
m_outputTrackSegments
{
"outputTrackSegments"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
Gaudi
::
Property
<
unsigned
int
>
m_firstInVolumeID
{
this
,
"firstInVolumeID"
,
0
};
Gaudi
::
Property
<
std
::
string
>
m_firstInVolumeName
{
this
,
"firstInVolumeName"
,
""
};
Gaudi
::
Property
<
float
>
m_firstSmallerThanZ
{
this
,
"firstSmallerThanZ"
,
0
};
Gaudi
::
Property
<
float
>
m_firstGreaterThanZ
{
this
,
"firstGreaterThanZ"
,
0
};
Gaudi
::
Property
<
float
>
m_firstGreaterThanR
{
this
,
"firstGreaterThanR"
,
-
1
};
public:
Acts
::
GeometryContext
m_geoContext
;
public:
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
TrajectoryFromTrackFit
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
:
GaudiAlgorithm
(
name
,
svcLoc
)
,
AlgorithmIDMixin
(
name
,
info
())
{
TrackProjector
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
:
GaudiAlgorithm
(
name
,
svcLoc
)
{
declareProperty
(
"inputTrajectories"
,
m_inputTrajectories
,
""
);
declareProperty
(
"outputTra
jectoryParameters"
,
m_outputTrajectory
,
"ACTS Trajectory Parameters
"
);
declareProperty
(
"outputTra
ckSegments"
,
m_outputTrackSegments
,
"
"
);
}
StatusCode
initialize
()
override
{
...
...
@@ -73,31 +78,31 @@ namespace Jug::Reco {
StatusCode
execute
()
override
{
// input collection
const
TrajectoriesContainer
*
trajectories
=
m_inputTrajectories
.
get
();
const
auto
*
const
trajectories
=
m_inputTrajectories
.
get
();
// create output collections
auto
tra
j_par
s
=
m_outputTra
jectory
.
createAndPut
();
auto
*
tra
ck_segment
s
=
m_outputTra
ckSegments
.
createAndPut
();
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
std
::
size
(
*
trajectories
)
<<
" trajectories "
<<
endmsg
;
}
// Loop over the trajectories
for
(
size_t
itraj
=
0
;
itraj
<
trajectories
->
size
();
++
itraj
)
{
const
auto
&
traj
=
(
*
trajectories
)[
itraj
];
for
(
const
auto
&
traj
:
*
trajectories
)
{
// Get the entry index for the single trajectory
// The trajectory entry indices and the multiTrajectory
const
auto
&
mj
=
traj
.
multiTrajectory
();
const
auto
&
trackTips
=
traj
.
tips
();
debug
()
<<
"# of elements in trackTips "
<<
trackTips
.
size
()
<<
endmsg
;
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"# of elements in trackTips "
<<
trackTips
.
size
()
<<
endmsg
;
}
// Skip empty
if
(
trackTips
.
empty
())
{
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"Empty multiTrajectory."
<<
endmsg
;
}
continue
;
}
auto
&
trackTip
=
trackTips
.
front
();
// Collect the trajectory summary info
...
...
@@ -106,34 +111,97 @@ namespace Jug::Reco {
int
m_nStates
=
trajState
.
nStates
;
int
m_nCalibrated
=
0
;
if
(
msgLevel
(
MSG
::
DEBUG
))
{
debug
()
<<
"n measurement in trajectory "
<<
m_nMeasurements
<<
endmsg
;
debug
()
<<
"n state in trajectory "
<<
m_nStates
<<
endmsg
;
debug
()
<<
"n measurement in trajectory "
<<
m_nMeasurements
<<
endmsg
;
debug
()
<<
"n state in trajectory "
<<
m_nStates
<<
endmsg
;
}
// get path length at last silicon layer
float
pathlength_at_reflayer
=
-
9999.
;
eicd
::
MutableTrackSegment
track_segment
;
// visit the track points
mj
.
visitBackwards
(
trackTip
,
[
&
](
auto
&&
trackstate
)
{
// debug() << trackstate.hasPredicted() << endmsg;
// debug() << trackstate.predicted() << endmsg;
auto
params
=
trackstate
.
predicted
();
//<< endmsg;
auto
pathlength
=
trackstate
.
pathLength
();
auto
pathLength
=
trackstate
.
pathLength
();
// get volume info
auto
geoID
=
trackstate
.
referenceSurface
().
geometryId
();
auto
volume
=
geoID
.
volume
();
auto
layer
=
geoID
.
layer
();
if
(
trackstate
.
hasCalibrated
())
{
if
(
trackstate
.
hasCalibrated
())
{