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