Skip to content
Snippets Groups Projects
Commit 13446d51 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

modified: ../Algorithms/CMakeLists.txt

	modified:   ../Algorithms/Digitization/CMakeLists.txt
	modified:   ../Algorithms/Fitting/CMakeLists.txt
	modified:   ../Algorithms/GeneratorsPythia8/CMakeLists.txt
	modified:   ../Algorithms/Vertexing/CMakeLists.txt
	deleted:    ../Algorithms/Vertexing/include/ACTFW/Vertexing/VertexFindingAlgorithm.hpp
	deleted:    ../Algorithms/Vertexing/src/VertexFindingAlgorithm.cpp
	modified:   ../CMakeLists.txt
	modified:   ../Detectors/CMakeLists.txt
	modified:   ../Detectors/DD4hepDetector/src/DD4hepDetector.cpp
	modified:   ../Io/Root/CMakeLists.txt
	modified:   ../Run/CMakeLists.txt
	modified:   ../Run/Reconstruction/CMakeLists.txt
parent 30b6260f
Branches
No related tags found
No related merge requests found
add_subdirectory(Digitization)
add_subdirectory(Fatras)
add_subdirectory(Geant4)
add_subdirectory(Geant4DD4hep)
add_subdirectory(Generators)
add_subdirectory(GeneratorsPythia8)
#add_subdirectory(Fatras)
#add_subdirectory_if(Geant4 ACTS_BUILD_EXAMPLES_GEANT4)
#add_subdirectory_if(Geant4DD4hep ACTS_BUILD_EXAMPLES_DD4HEP AND ACTS_BUILD_EXAMPLES_GEANT4)
#add_subdirectory(Generators)
#add_subdirectory_if(GeneratorsPythia8 ACTS_BUILD_EXAMPLES_PYTHIA8)
add_subdirectory(MaterialMapping)
add_subdirectory(Printers)
#add_subdirectory(Printers)
add_subdirectory(Propagation)
add_subdirectory(TruthTracking)
add_subdirectory(Vertexing)
#add_subdirectory(Vertexing)
add_subdirectory(Fitting)
add_subdirectory(TrackFinding)
find_package(Acts REQUIRED COMPONENTS DigitizationPlugin IdentificationPlugin)
add_library(
ActsExamplesDigitization SHARED
src/DigitizationAlgorithm.cpp
......
add_library(
ActsExamplesFitting SHARED
src/FittingAlgorithm.cpp
#src/FittingAlgorithmFitterFunction.cpp
)
src/FittingAlgorithmFitterFunction.cpp)
target_include_directories(
ActsExamplesFitting
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
......
......@@ -12,7 +12,7 @@ target_link_libraries(
ActsExamplesFramework ActsExamplesGenerators
Boost::program_options
PRIVATE
-L/home/whit/lib pythia8)
Pythia8)
install(
TARGETS ActsExamplesGeneratorsPythia8
......
add_library(
ActsExamplesVertexing SHARED
src/VertexFitAlgorithm.cpp
src/VertexFindingAlgorithm.cpp)
src/IterativeVertexFinderAlgorithm.cpp
src/AdaptiveMultiVertexFinderAlgorithm.cpp
src/TutorialAMVFAlgorithm.cpp)
target_include_directories(
ActsExamplesVertexing
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
......
// This file is part of the Acts project.
//
// Copyright (C) 2016-2019 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include <memory>
#include "ACTFW/EventData/SimVertex.hpp"
#include "ACTFW/Framework/BareAlgorithm.hpp"
#include "ACTFW/Framework/ProcessCode.hpp"
#include "ACTFW/Framework/WhiteBoard.hpp"
#include "Acts/MagneticField/ConstantBField.hpp"
#include "Acts/Propagator/EigenStepper.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/Vertexing/FullBilloirVertexFitter.hpp"
#include "Acts/Vertexing/IterativeVertexFinder.hpp"
namespace FWE {
class VertexFindingAlgorithm : public FW::BareAlgorithm {
public:
struct Config {
/// Input track collection
std::string trackCollection;
/// The magnetic field
Acts::Vector3D bField;
};
/// Constructor
VertexFindingAlgorithm(const Config& cfg,
Acts::Logging::Level level = Acts::Logging::INFO);
/// Framework execute method
/// @param [in] context is the Algorithm context for event consistency
FW::ProcessCode execute(
const FW::AlgorithmContext& context) const final override;
private:
/// The config class
Config m_cfg;
};
} // namespace FWE
\ No newline at end of file
// This file is part of the Acts project.
//
// Copyright (C) 2019 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include "ACTFW/Vertexing/VertexFindingAlgorithm.hpp"
#include <Acts/Geometry/GeometryContext.hpp>
#include <Acts/MagneticField/MagneticFieldContext.hpp>
#include <iostream>
#include "ACTFW/Framework/RandomNumbers.hpp"
#include "ACTFW/TruthTracking/VertexAndTracks.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/MagneticField/ConstantBField.hpp"
#include "Acts/Propagator/EigenStepper.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/Surfaces/PerigeeSurface.hpp"
#include "Acts/Utilities/Definitions.hpp"
#include "Acts/Utilities/Helpers.hpp"
#include "Acts/Utilities/Units.hpp"
#include "Acts/Vertexing/FullBilloirVertexFitter.hpp"
#include "Acts/Vertexing/HelicalTrackLinearizer.hpp"
#include "Acts/Vertexing/ImpactPointEstimator.hpp"
#include "Acts/Vertexing/IterativeVertexFinder.hpp"
#include "Acts/Vertexing/LinearizedTrack.hpp"
#include "Acts/Vertexing/Vertex.hpp"
#include "Acts/Vertexing/VertexFinderConcept.hpp"
#include "Acts/Vertexing/VertexingOptions.hpp"
#include "Acts/Vertexing/ZScanVertexFinder.hpp"
FWE::VertexFindingAlgorithm::VertexFindingAlgorithm(const Config& cfg,
Acts::Logging::Level level)
: FW::BareAlgorithm("VertexFinding", level), m_cfg(cfg) {}
/// @brief Algorithm that receives all selected tracks from an event
/// and finds and fits its vertices
FW::ProcessCode FWE::VertexFindingAlgorithm::execute(
const FW::AlgorithmContext& ctx) const {
using MagneticField = Acts::ConstantBField;
using Stepper = Acts::EigenStepper<MagneticField>;
using Propagator = Acts::Propagator<Stepper>;
using PropagatorOptions = Acts::PropagatorOptions<>;
using TrackParameters = Acts::BoundParameters;
using Linearizer = Acts::HelicalTrackLinearizer<Propagator>;
using VertexFitter =
Acts::FullBilloirVertexFitter<TrackParameters, Linearizer>;
using ImpactPointEstimator =
Acts::ImpactPointEstimator<TrackParameters, Propagator>;
using VertexSeeder = Acts::ZScanVertexFinder<VertexFitter>;
using VertexFinder = Acts::IterativeVertexFinder<VertexFitter, VertexSeeder>;
using VertexFinderOptions = Acts::VertexingOptions<TrackParameters>;
static_assert(Acts::VertexFinderConcept<VertexSeeder>,
"VertexSeeder does not fulfill vertex finder concept.");
static_assert(Acts::VertexFinderConcept<VertexFinder>,
"VertexFinder does not fulfill vertex finder concept.");
// Set up the magnetic field
MagneticField bField(m_cfg.bField);
// Set up propagator with void navigator
auto propagator = std::make_shared<Propagator>(Stepper(bField));
PropagatorOptions propagatorOpts(ctx.geoContext, ctx.magFieldContext);
// Setup the vertex fitter
VertexFitter::Config vertexFitterCfg;
VertexFitter vertexFitter(std::move(vertexFitterCfg));
// Setup the track linearizer
Linearizer::Config linearizerCfg(bField, propagator);
Linearizer linearizer(std::move(linearizerCfg));
// Setup the seed finder
ImpactPointEstimator::Config ipEstCfg(bField, propagator);
ImpactPointEstimator ipEst(std::move(ipEstCfg));
VertexSeeder::Config seederCfg(ipEst);
VertexSeeder seeder(std::move(seederCfg));
// Set up the actual vertex finder
VertexFinder::Config finderCfg(std::move(vertexFitter), std::move(linearizer),
std::move(seeder), ipEst);
finderCfg.maxVertices = 200;
finderCfg.reassignTracksAfterFirstFit = true;
VertexFinder finder(finderCfg);
VertexFinder::State state;
VertexFinderOptions finderOpts(ctx.geoContext, ctx.magFieldContext);
// Setup containers
const auto& input = ctx.eventStore.get<std::vector<FW::VertexAndTracks>>(
m_cfg.trackCollection);
std::vector<Acts::BoundParameters> inputTrackCollection;
int counte = 0;
for (auto& bla : input) {
counte += bla.tracks.size();
}
ACTS_INFO("Truth vertices in event: " << input.size());
for (auto& vertexAndTracks : input) {
ACTS_INFO("\t True vertex at ("
<< vertexAndTracks.vertex.position().x() << ","
<< vertexAndTracks.vertex.position().y() << ","
<< vertexAndTracks.vertex.position().z() << ") with "
<< vertexAndTracks.tracks.size() << " tracks.");
inputTrackCollection.insert(inputTrackCollection.end(),
vertexAndTracks.tracks.begin(),
vertexAndTracks.tracks.end());
}
std::vector<const Acts::BoundParameters*> inputTrackPtrCollection;
for (const auto& trk : inputTrackCollection) {
inputTrackPtrCollection.push_back(&trk);
}
// Find vertices
auto res = finder.find(inputTrackPtrCollection, finderOpts, state);
if (res.ok()) {
// Retrieve vertices found by vertex finder
auto vertexCollection = *res;
ACTS_INFO("Found " << vertexCollection.size() << " vertices in event.");
unsigned int count = 0;
for (const auto& vtx : vertexCollection) {
ACTS_INFO("\t" << ++count << ". vertex at "
<< "(" << vtx.position().x() << "," << vtx.position().y()
<< "," << vtx.position().z() << ") with "
<< vtx.tracks().size() << " tracks.");
}
} else {
ACTS_ERROR("Error in vertex finder.");
}
return FW::ProcessCode::SUCCESS;
}
......@@ -25,7 +25,7 @@ find_package(Threads)
add_subdirectory(thirdparty/dfelibs)
#add_subdirectory(Algorithms)
add_subdirectory(Algorithms)
add_subdirectory(Detectors)
add_subdirectory(Framework)
add_subdirectory(Io)
......
add_subdirectory(Common)
#add_subdirectory(ContextualDetector)
#add_subdirectory(DD4hepDetector)
add_subdirectory(DD4hepDetector)
#add_subdirectory(EmptyDetector)
#add_subdirectory(GenericDetector)
#add_subdirectory(MagneticField)
add_subdirectory(GenericDetector)
add_subdirectory(MagneticField)
#add_subdirectory(TGeoDetector)
......@@ -21,6 +21,7 @@ void DD4hepDetector::addOptions(
FW::Options::addDD4hepOptions(opt);
}
auto DD4hepDetector::finalize(
const boost::program_options::variables_map &vm,
std::shared_ptr<const Acts::IMaterialDecorator> mdecorator)
......
......@@ -9,9 +9,9 @@ add_library(
src/RootPropagationStepsWriter.cpp
src/RootSimHitWriter.cpp
src/RootTrackParameterWriter.cpp
#src/RootVertexAndTracksWriter.cpp
#src/RootVertexAndTracksReader.cpp
#src/RootTrajectoryWriter.cpp
src/RootVertexAndTracksWriter.cpp
src/RootVertexAndTracksReader.cpp
src/RootTrajectoryWriter.cpp
)
target_include_directories(
ActsExamplesIoRoot
......@@ -21,7 +21,7 @@ target_link_libraries(
PUBLIC
ActsCore ActsDigitizationPlugin ActsIdentificationPlugin
ActsExamplesFramework
#ActsExamplesPropagation ActsExamplesTruthTracking
ActsExamplesPropagation ActsExamplesTruthTracking
Threads::Threads
PRIVATE ROOT::Core ROOT::Hist ROOT::Tree)
......
......@@ -13,5 +13,5 @@ add_subdirectory(HelloWorld)
#add_subdirectory(Misc)
#add_subdirectory(Propagation)
#add_subdirectory(ReadCsv)
#add_subdirectory(Reconstruction)
add_subdirectory(Reconstruction)
#add_subdirectory(Vertexing)
......@@ -25,6 +25,7 @@ add_executable(
target_link_libraries(
ActsRecCKFTracks
PRIVATE
ActsExamplesTruthTracking
ActsExamplesFramework
ActsExamplesCommon
ActsExamplesDigitization
......@@ -39,3 +40,24 @@ install(
ActsRecCKFTracks
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
add_executable(
SolidRecTracks
SolidRecTracks.cpp)
target_link_libraries(
SolidRecTracks
PRIVATE
ActsExamplesTruthTracking
ActsExamplesFramework
ActsExamplesCommon
ActsExamplesDigitization
ActsExamplesTrackFinding
ActsExamplesDetectorGeneric
ActsExamplesMagneticField
ActsExamplesIoCsv
ActsExamplesIoPerformance)
install(
TARGETS
SolidRecTracks
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment