LDMX Software
TrackingGeometryUser.h
1#pragma once
2
3#include <memory>
4#include <string>
5#include <vector>
6
7#include "Acts/MagneticField/MagneticFieldProvider.hpp"
8#include "Framework/Configure/Parameters.h"
10#include "Tracking/Sim/BFieldXYZUtils.h"
11#include "Tracking/geo/CalibrationContext.h"
12#include "Tracking/geo/GeometryContext.h"
13#include "Tracking/geo/MagneticFieldContext.h"
14#include "Tracking/geo/TrackersTrackingGeometry.h"
15
16namespace tracking::reco {
23 public:
24 TrackingGeometryUser(const std::string& name, framework::Process& p);
25
26 protected:
27 const Acts::GeometryContext& geometryContext();
28 const Acts::MagneticFieldContext& magneticFieldContext();
29 const Acts::CalibrationContext& calibrationContext();
30 const geo::TrackersTrackingGeometry& geometry();
31
42 void loadBField(const std::string& path,
43 const std::vector<double>& map_offset = {0., 0., 0.});
44
46 void loadBField(const std::vector<double>& map_offset = {0., 0., 0.});
47
49 std::shared_ptr<Acts::MagneticFieldProvider> bField() const {
50 return b_field_;
51 }
52
53 private:
54 std::shared_ptr<Acts::MagneticFieldProvider> b_field_{nullptr};
55
65 template <typename ConditionType>
66 const ConditionType& getNamedCondition() {
67 return getCondition<ConditionType>(ConditionType::NAME);
68 }
69};
70
71} // namespace tracking::reco
Base classes for all user event processing components to extend.
const T & getCondition(const std::string &condition_name)
Access a conditions object for the current event.
Class which represents the process under execution.
Definition Process.h:37
Base class for a module which produces a data product.
a helper base class providing some methods to shorten access to common conditions used within the tra...
const ConditionType & getNamedCondition()
Templated condition access code for our conditions with static names.
std::shared_ptr< Acts::MagneticFieldProvider > bField() const
Return the loaded B-field provider.
void loadBField(const std::string &path, const std::vector< double > &map_offset={0., 0., 0.})
Load the interpolated B-field map from path and cache it.