Skip to content

Commit

Permalink
rename VertexFindingAlgorithm to IterativeVertexFinderAlgorithm and F…
Browse files Browse the repository at this point in the history
…ullExampleAMVFAlgorithm to AdaptiveMultiVertexFinderAlgorithm
  • Loading branch information
baschlag committed Jun 3, 2020
1 parent eb0a745 commit 86245e9
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 45 deletions.
4 changes: 2 additions & 2 deletions Examples/Algorithms/Vertexing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
add_library(
ActsExamplesVertexing SHARED
src/VertexFitAlgorithm.cpp
src/VertexFindingAlgorithm.cpp
src/FullExampleAMVFAlgorithm.cpp
src/IterativeVertexFinderAlgorithm.cpp
src/AdaptiveMultiVertexFinderAlgorithm.cpp
src/TutorialAMVFAlgorithm.cpp)
target_include_directories(
ActsExamplesVertexing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@

namespace FWE {

class FullExampleAMVFAlgorithm : public FW::BareAlgorithm {
class AdaptiveMultiVertexFinderAlgorithm : public FW::BareAlgorithm {
public:
struct Config {
/// Input track collection
std::string trackCollection;
};

/// Constructor
FullExampleAMVFAlgorithm(const Config& cfg,
Acts::Logging::Level level = Acts::Logging::INFO);
AdaptiveMultiVertexFinderAlgorithm(
const Config& cfg, Acts::Logging::Level level = Acts::Logging::INFO);

/// Framework execute method
/// @param [in] context is the Algorithm context for event consistency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace FWE {

class VertexFindingAlgorithm : public FW::BareAlgorithm {
class IterativeVertexFinderAlgorithm : public FW::BareAlgorithm {
public:
struct Config {
/// Input track collection
Expand All @@ -33,8 +33,8 @@ class VertexFindingAlgorithm : public FW::BareAlgorithm {
};

/// Constructor
VertexFindingAlgorithm(const Config& cfg,
Acts::Logging::Level level = Acts::Logging::INFO);
IterativeVertexFinderAlgorithm(
const Config& cfg, Acts::Logging::Level level = Acts::Logging::INFO);

/// Framework execute method
/// @param [in] context is the Algorithm context for event consistency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
// 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/FullExampleAMVFAlgorithm.hpp"
#include "ACTFW/Vertexing/AdaptiveMultiVertexFinderAlgorithm.hpp"

#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/MagneticField/MagneticFieldContext.hpp"
#include "ACTFW/Framework/RandomNumbers.hpp"
#include "ACTFW/TruthTracking/VertexAndTracks.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/MagneticField/ConstantBField.hpp"
#include "Acts/MagneticField/MagneticFieldContext.hpp"
#include "Acts/Propagator/EigenStepper.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/Surfaces/PerigeeSurface.hpp"
Expand All @@ -30,13 +30,13 @@
#include "Acts/Vertexing/VertexFinderConcept.hpp"
#include "Acts/Vertexing/VertexingOptions.hpp"

FWE::FullExampleAMVFAlgorithm::FullExampleAMVFAlgorithm(
FWE::AdaptiveMultiVertexFinderAlgorithm::AdaptiveMultiVertexFinderAlgorithm(
const Config& cfg, Acts::Logging::Level level)
: FW::BareAlgorithm("AMVF Algorithm", level), m_cfg(cfg) {}

/// @brief Algorithm that receives all selected tracks from an event
/// and finds and fits its vertices
FW::ProcessCode FWE::FullExampleAMVFAlgorithm::execute(
FW::ProcessCode FWE::AdaptiveMultiVertexFinderAlgorithm::execute(
const FW::AlgorithmContext& ctx) const {
//////////////////////////////////////////////
/* Full tutorial example code for reference */
Expand Down Expand Up @@ -128,7 +128,7 @@ FW::ProcessCode FWE::FullExampleAMVFAlgorithm::execute(
}

std::vector<Acts::BoundParameters>
FWE::FullExampleAMVFAlgorithm::getInputTrackCollection(
FWE::AdaptiveMultiVertexFinderAlgorithm::getInputTrackCollection(
const FW::AlgorithmContext& ctx) const {
// Setup containers
const auto& input = ctx.eventStore.get<std::vector<FW::VertexAndTracks>>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// 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 "ACTFW/Vertexing/IterativeVertexFinderAlgorithm.hpp"

#include <Acts/Geometry/GeometryContext.hpp>
#include <Acts/MagneticField/MagneticFieldContext.hpp>
Expand All @@ -32,13 +32,13 @@
#include "Acts/Vertexing/VertexingOptions.hpp"
#include "Acts/Vertexing/ZScanVertexFinder.hpp"

FWE::VertexFindingAlgorithm::VertexFindingAlgorithm(const Config& cfg,
Acts::Logging::Level level)
FWE::IterativeVertexFinderAlgorithm::IterativeVertexFinderAlgorithm(
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(
FW::ProcessCode FWE::IterativeVertexFinderAlgorithm::execute(
const FW::AlgorithmContext& ctx) const {
using MagneticField = Acts::ConstantBField;
using Stepper = Acts::EigenStepper<MagneticField>;
Expand Down
18 changes: 9 additions & 9 deletions Examples/Algorithms/Vertexing/src/TutorialAMVFAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

#include "ACTFW/Vertexing/TutorialAMVFAlgorithm.hpp"

#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/MagneticField/MagneticFieldContext.hpp"
#include "ACTFW/Framework/RandomNumbers.hpp"
#include "ACTFW/TruthTracking/VertexAndTracks.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/MagneticField/ConstantBField.hpp"
#include "Acts/MagneticField/MagneticFieldContext.hpp"
#include "Acts/Propagator/EigenStepper.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/Surfaces/PerigeeSurface.hpp"
Expand Down Expand Up @@ -56,13 +56,13 @@ FW::ProcessCode FWE::TutorialAMVFAlgorithm::execute(
/*** or in the Acts repository in docs/howto/setup_and_run_vertexing.md ***/
//////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////
/* Add the tutorial example code here */
/////////////////////////////////////////////
/////////////////////////////////////////////
/* For the full tutorial code please refer */
/* to FullExampleAMVFAlgorithm.cpp */
/////////////////////////////////////////////
///////////////////////////////////////////////
/* Add the tutorial example code here */
///////////////////////////////////////////////
///////////////////////////////////////////////
/* For the full tutorial code please refer */
/* to AdaptiveMultiVertexFinderAlgorithm.cpp */
///////////////////////////////////////////////

//* Do not change the code below this line *//
return FW::ProcessCode::SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "ACTFW/TruthTracking/TrackSelector.hpp"
#include "ACTFW/TruthTracking/TruthVerticesToTracks.hpp"
#include "ACTFW/Utilities/Paths.hpp"
#include "ACTFW/Vertexing/FullExampleAMVFAlgorithm.hpp"
#include "ACTFW/Vertexing/AdaptiveMultiVertexFinderAlgorithm.hpp"
#include "Acts/EventData/TrackParameters.hpp"

using namespace Acts::UnitLiterals;
Expand Down Expand Up @@ -86,10 +86,11 @@ int main(int argc, char* argv[]) {
std::make_shared<TrackSelector>(selectorConfig, logLevel));

// Add the finding algorithm
FWE::FullExampleAMVFAlgorithm::Config vertexFindingCfg;
FWE::AdaptiveMultiVertexFinderAlgorithm::Config vertexFindingCfg;
vertexFindingCfg.trackCollection = selectorConfig.output;
sequencer.addAlgorithm(std::make_shared<FWE::FullExampleAMVFAlgorithm>(
vertexFindingCfg, logLevel));
sequencer.addAlgorithm(
std::make_shared<FWE::AdaptiveMultiVertexFinderAlgorithm>(
vertexFindingCfg, logLevel));

return sequencer.run();
}
12 changes: 6 additions & 6 deletions Examples/Run/Vertexing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ set(_common_libraries
Boost::program_options)

# Finder example
add_executable(ActsRecVertexFinder VertexFinderExample.cpp)
target_link_libraries(ActsRecVertexFinder PRIVATE ${_common_libraries})
add_executable(ActsRecIterativeVertexFinder IterativeVertexFinderExample.cpp)
target_link_libraries(ActsRecIterativeVertexFinder PRIVATE ${_common_libraries})

# Fitter example
add_executable(ActsRecVertexFitter VertexFitterExample.cpp)
Expand All @@ -31,15 +31,15 @@ add_executable(ActsTutorialAMVF TutorialAMVFExample.cpp)
target_link_libraries(ActsTutorialAMVF PRIVATE ${_common_libraries})

# Full AMVF example
add_executable(ActsAdaptiveMultiVertexFinderExample FullAMVFExample.cpp)
target_link_libraries(ActsAdaptiveMultiVertexFinderExample PRIVATE ${_common_libraries})
add_executable(ActsRecAdaptiveMultiVertexFinder AdaptiveMultiVertexFinderExample.cpp)
target_link_libraries(ActsRecAdaptiveMultiVertexFinder PRIVATE ${_common_libraries})

install(
TARGETS
ActsRecVertexFitter
ActsRecVertexFinder
ActsRecIterativeVertexFinder
ActsRecVertexWriter
ActsRecVertexReader
ActsRecAdaptiveMultiVertexFinder
ActsTutorialAMVF
ActsAdaptiveMultiVertexFinderExample
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "ACTFW/TruthTracking/TrackSelector.hpp"
#include "ACTFW/TruthTracking/TruthVerticesToTracks.hpp"
#include "ACTFW/Utilities/Paths.hpp"
#include "ACTFW/Vertexing/VertexFindingAlgorithm.hpp"
#include "ACTFW/Vertexing/IterativeVertexFinderAlgorithm.hpp"
#include "Acts/EventData/TrackParameters.hpp"

using namespace Acts::UnitLiterals;
Expand Down Expand Up @@ -86,10 +86,10 @@ int main(int argc, char* argv[]) {
std::make_shared<TrackSelector>(selectorConfig, logLevel));

// Add the finding algorithm
FWE::VertexFindingAlgorithm::Config vertexFindingCfg;
FWE::IterativeVertexFinderAlgorithm::Config vertexFindingCfg;
vertexFindingCfg.trackCollection = selectorConfig.output;
vertexFindingCfg.bField = trkConvConfig.bField;
sequencer.addAlgorithm(std::make_shared<FWE::VertexFindingAlgorithm>(
sequencer.addAlgorithm(std::make_shared<FWE::IterativeVertexFinderAlgorithm>(
vertexFindingCfg, logLevel));

return sequencer.run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
// 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 <Acts/EventData/TrackParameters.hpp>
#include <boost/program_options.hpp>
#include <memory>
#include "Acts/EventData/TrackParameters.hpp"

#include "ACTFW/Framework/Sequencer.hpp"
#include "ACTFW/Io/Root/RootVertexAndTracksReader.hpp"
#include "ACTFW/Options/CommonOptions.hpp"
#include "ACTFW/Utilities/Paths.hpp"
#include "ACTFW/Vertexing/VertexFindingAlgorithm.hpp"
#include "ACTFW/Vertexing/IterativeVertexFinderAlgorithm.hpp"

using namespace FW;

Expand Down Expand Up @@ -53,7 +53,7 @@ int main(int argc, char* argv[]) {
Acts::Vector3D bField(0., 0., 2. * Acts::units::_T);

// Add the finding algorithm
FWE::VertexFindingAlgorithm::Config vertexFindingCfg;
FWE::IterativeVertexFinderAlgorithm::Config vertexFindingCfg;
vertexFindingCfg.trackCollection = vtxAndTracksReaderCfg.outputCollection;
vertexFindingCfg.bField = bField;

Expand All @@ -63,7 +63,7 @@ int main(int argc, char* argv[]) {
sequencer.addReader(std::make_shared<RootVertexAndTracksReader>(
vtxAndTracksReaderCfg, logLevel));

sequencer.addAlgorithm(std::make_shared<FWE::VertexFindingAlgorithm>(
sequencer.addAlgorithm(std::make_shared<FWE::IterativeVertexFinderAlgorithm>(
vertexFindingCfg, logLevel));

return sequencer.run();
Expand Down
2 changes: 1 addition & 1 deletion docs/howto/setup_and_run_vertexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if (res.ok()) {
ACTS_ERROR("Error in vertex finder: " << res.error().message());
}
```
For reference, the full tutorial code can also be found in a file called ```FullExampleAMVFAlgorithm.cpp``` in the same directory as ```ExampleAMVFAlgorithm.cpp```.
For reference, the full tutorial code can also be found in a file called ```AdaptiveMultiVertexFinderAlgorithm.cpp``` in the same directory as ```ExampleAMVFAlgorithm.cpp```.
## Running the example algorithm
In your build directory, recompile and run the example on three pileup-50 pythia events to get your first ACTS vertices:
```
Expand Down

0 comments on commit 86245e9

Please sign in to comment.