Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
acts-framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
acts
acts-framework
Commits
fd9cfdc8
Commit
fd9cfdc8
authored
6 years ago
by
Moritz Kiehn
Browse files
Options
Downloads
Patches
Plain Diff
gsoc: add fast simulation
parent
42c692c6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Examples/Gsoc2019/CMakeLists.txt
+4
-1
4 additions, 1 deletion
Examples/Gsoc2019/CMakeLists.txt
Examples/Gsoc2019/Reconstruction.cpp
+70
-3
70 additions, 3 deletions
Examples/Gsoc2019/Reconstruction.cpp
with
74 additions
and
4 deletions
Examples/Gsoc2019/CMakeLists.txt
+
4
−
1
View file @
fd9cfdc8
...
@@ -3,8 +3,11 @@ add_executable(
...
@@ -3,8 +3,11 @@ add_executable(
target_link_libraries
(
target_link_libraries
(
ACTFWGsoc2019Reconstruction
ACTFWGsoc2019Reconstruction
PRIVATE ACTFramework ACTFWReconstruction ACTFWExamplesCommon
PRIVATE ACTFramework ACTFWReconstruction ACTFWExamplesCommon
ActsFrameworkGenerators
ActsCore
ActsFrameworkGenerators
ACTFWGenericDetector
ACTFWGenericDetector
ACTFWFatras
FatrasCore
ActsCore
Boost::program_options
)
Boost::program_options
)
install
(
install
(
TARGETS ACTFWGsoc2019Reconstruction
TARGETS ACTFWGsoc2019Reconstruction
...
...
This diff is collapsed.
Click to expand it.
Examples/Gsoc2019/Reconstruction.cpp
+
70
−
3
View file @
fd9cfdc8
...
@@ -8,15 +8,31 @@
...
@@ -8,15 +8,31 @@
#include
<cstdlib>
#include
<cstdlib>
#include
<memory>
#include
<memory>
#include
<vector>
#include
<boost/program_options.hpp>
#include
<boost/program_options.hpp>
#include
<Acts/Detector/TrackingGeometry.hpp>
#include
<Acts/Detector/TrackingGeometry.hpp>
#include
<Acts/Extrapolator/Navigator.hpp>
#include
<Acts/MagneticField/ConstantBField.hpp>
#include
<Acts/MagneticField/ConstantBField.hpp>
#include
<Acts/Propagator/EigenStepper.hpp>
#include
<Acts/Propagator/Propagator.hpp>
#include
<Acts/Propagator/StraightLineStepper.hpp>
#include
<Acts/Utilities/Units.hpp>
#include
<Acts/Utilities/Units.hpp>
#include
<Fatras/Kernel/Interactor.hpp>
#include
<Fatras/Kernel/SelectorList.hpp>
#include
<Fatras/Kernel/Simulator.hpp>
#include
<Fatras/Selectors/ChargeSelectors.hpp>
#include
<Fatras/Selectors/KinematicCasts.hpp>
#include
<Fatras/Selectors/SelectorHelpers.hpp>
#include
"ACTFW/Barcode/BarcodeSvc.hpp"
#include
"ACTFW/Barcode/BarcodeSvc.hpp"
#include
"ACTFW/Common/CommonOptions.hpp"
#include
"ACTFW/Common/CommonOptions.hpp"
#include
"ACTFW/EventData/SimHit.hpp"
#include
"ACTFW/EventData/SimParticle.hpp"
#include
"ACTFW/EventData/SimVertex.hpp"
#include
"ACTFW/Fatras/FatrasAlgorithm.hpp"
#include
"ACTFW/Fatras/FatrasOptions.hpp"
#include
"ACTFW/Framework/Sequencer.hpp"
#include
"ACTFW/Framework/Sequencer.hpp"
#include
"ACTFW/GenericDetector/BuildGenericDetector.hpp"
#include
"ACTFW/GenericDetector/BuildGenericDetector.hpp"
#include
"ACTFW/Options/ParticleGunOptions.hpp"
#include
"ACTFW/Options/ParticleGunOptions.hpp"
...
@@ -27,6 +43,48 @@
...
@@ -27,6 +43,48 @@
using
namespace
boost
::
program_options
;
using
namespace
boost
::
program_options
;
using
namespace
FW
;
using
namespace
FW
;
// data type definitions
using
TruthParticle
=
Data
::
SimParticle
;
using
TruthHit
=
Data
::
SimHit
<
Data
::
SimParticle
>
;
using
TruthHitCreator
=
Data
::
SimHitCreator
;
using
TruthEvent
=
std
::
vector
<
Data
::
SimVertex
<
TruthParticle
>>
;
// type definitions for the propagation and simulation
// for charge particles
using
MagneticField
=
Acts
::
ConstantBField
;
using
ChargedStepper
=
Acts
::
EigenStepper
<
MagneticField
>
;
using
ChargedPropagator
=
Acts
::
Propagator
<
ChargedStepper
,
Acts
::
Navigator
>
;
using
ChargedInteractor
=
Fatras
::
Interactor
<
RandomEngine
,
TruthParticle
,
TruthHit
,
TruthHitCreator
>
;
// for neutral particles
using
NeutralStepper
=
Acts
::
StraightLineStepper
;
using
NeutralPropagator
=
Acts
::
Propagator
<
NeutralStepper
,
Acts
::
Navigator
>
;
using
NeutralInteractor
=
Fatras
::
Interactor
<
RandomEngine
,
TruthParticle
,
TruthHit
,
TruthHitCreator
>
;
// the simulator kernel
using
Simulator
=
Fatras
::
Simulator
<
ChargedPropagator
,
Fatras
::
SelectorListOR
<>
,
ChargedInteractor
,
NeutralPropagator
,
Fatras
::
SelectorListOR
<>
,
NeutralInteractor
>
;
// the combined simulation algorithm
using
SimulationAlgorithm
=
FatrasAlgorithm
<
Simulator
,
TruthEvent
,
TruthHit
>
;
SimulationAlgorithm
::
Config
buildSimulationConfig
(
std
::
shared_ptr
<
const
Acts
::
TrackingGeometry
>&
geo
,
Acts
::
ConstantBField
&&
magneticField
)
{
using
namespace
Acts
;
ChargedStepper
chargedStepper
(
std
::
move
(
magneticField
));
ChargedPropagator
chargedProp
(
std
::
move
(
chargedStepper
),
Navigator
(
geo
));
NeutralPropagator
neutralProp
(
NeutralStepper
{},
Navigator
(
geo
));
Simulator
simulator
(
std
::
move
(
chargedProp
),
std
::
move
(
neutralProp
));
return
SimulationAlgorithm
::
Config
(
std
::
move
(
simulator
));
}
int
int
main
(
int
argc
,
char
*
argv
[])
main
(
int
argc
,
char
*
argv
[])
{
{
...
@@ -60,9 +118,9 @@ main(int argc, char* argv[])
...
@@ -60,9 +118,9 @@ main(int argc, char* argv[])
auto
barcode
=
std
::
make_shared
<
BarcodeSvc
>
(
auto
barcode
=
std
::
make_shared
<
BarcodeSvc
>
(
BarcodeSvc
::
Config
{},
Acts
::
getDefaultLogger
(
"BarcodeSvc"
,
logLevel
));
BarcodeSvc
::
Config
{},
Acts
::
getDefaultLogger
(
"BarcodeSvc"
,
logLevel
));
//
Setup geometry.
Always use the generic (TrackML) detector
// Always use the generic (TrackML) detector
auto
geo
=
Generic
::
buildGenericDetector
(
logLevel
);
std
::
shared_ptr
<
const
Acts
::
TrackingGeometry
>
geo
(
Generic
::
buildGenericDetector
(
logLevel
));
// Always use a constant magnetic field
// Always use a constant magnetic field
Acts
::
ConstantBField
bfield
(
0.0
,
0.0
,
2.0
*
Acts
::
units
::
_T
);
Acts
::
ConstantBField
bfield
(
0.0
,
0.0
,
2.0
*
Acts
::
units
::
_T
);
...
@@ -73,6 +131,15 @@ main(int argc, char* argv[])
...
@@ -73,6 +131,15 @@ main(int argc, char* argv[])
evgen
.
barcodeSvc
=
barcode
;
evgen
.
barcodeSvc
=
barcode
;
seq
.
addReaders
({
std
::
make_shared
<
EventGenerator
>
(
evgen
,
logLevel
)});
seq
.
addReaders
({
std
::
make_shared
<
EventGenerator
>
(
evgen
,
logLevel
)});
// Setup fast simulation
auto
sim
=
buildSimulationConfig
(
geo
,
std
::
move
(
bfield
));
sim
.
randomNumberSvc
=
rng
;
sim
.
inputEventCollection
=
evgen
.
output
;
sim
.
simulatedEventCollection
=
"simulated_particles"
;
sim
.
simulatedHitCollection
=
"simulated_hits"
;
seq
.
appendEventAlgorithms
(
{
std
::
make_shared
<
SimulationAlgorithm
>
(
std
::
move
(
sim
),
logLevel
)});
// Add the empty reconstruction algorithm
// Add the empty reconstruction algorithm
EmptyReconstructionAlgorithm
::
Config
emptyReco
;
EmptyReconstructionAlgorithm
::
Config
emptyReco
;
seq
.
appendEventAlgorithms
(
seq
.
appendEventAlgorithms
(
...
...
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