LDMX Software
AlignmentTestProcessor.cxx
1#include "Tracking/Reco/AlignmentTestProcessor.h"
2
3namespace tracking::reco {
4
5AlignmentTestProcessor::AlignmentTestProcessor(const std::string& name,
6 framework::Process& process)
7
8 : TrackingGeometryUser(name, process) {}
9
10AlignmentTestProcessor::~AlignmentTestProcessor() {}
11
12void AlignmentTestProcessor::configure(
13 framework::config::Parameters& parameters) {}
14
15void AlignmentTestProcessor::onNewRun(const ldmx::RunHeader& rh) {
16 // Load the tracking geometry
17 tg_ = std::make_shared<geo::TrackersTrackingGeometry>(geometry());
18
19 // Load the tracking geometry default transformations
20 test_gctx_.loadTransformations(tg_->layer_surface_map_);
21
22 std::cout << "Storing corrections to default transformations" << std::endl;
23
24 // 100um in tu
25 Acts::Vector3 deltaT{0.1, 0., 0.};
26
27 // 10 mrad in rw.
28 // rw is applied following the right-hand rule
29 // In this case, w points towards -X.
30 // Looking downstream the rotation is counterclockwise.
31
32 Acts::Vector3 deltaR{0., 0., 0.01};
33 test_gctx_.addAlignCorrection(2100, deltaT, deltaR);
34 test_gctx_.addAlignCorrection(2101, deltaT, deltaR);
35
36 // Try to correct back 2100
37 // translate, then rotate
38 test_gctx_.addAlignCorrection(2100, -deltaT, -deltaR, false);
39}
40
41void AlignmentTestProcessor::produce(framework::Event& event) {
42 std::cout << "Check propagation of alignment corrections to surfaces"
43 << std::endl;
44 std::cout << "wrapping the ldmx test geometry context" << std::endl;
45
46 Acts::GeometryContext align_gctx(&test_gctx_);
47
48 std::cout << "Loading the tracking geometry" << std::endl;
49
50 std::cout << "Layers in Tracking Geometry" << std::endl;
51 for (auto entry : tg_->layer_surface_map_) {
52 std::cout << entry.first << std::endl;
53
54 std::cout << "Dumping surfaces information" << std::endl;
55 // (entry.second)->toStream(align_gctx, std::cout);
56 (entry.second)->toStream(align_gctx);
57 }
58}
59
60void AlignmentTestProcessor::onProcessStart() {}
61
62void AlignmentTestProcessor::onProcessEnd() {}
63
64} // namespace tracking::reco
65
66DECLARE_PRODUCER_NS(tracking::reco, AlignmentTestProcessor)
#define DECLARE_PRODUCER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:54