20void Vertexer::onProcessStart() {
28 h_delta_d0 =
new TH1F(
"h_delta_d0",
"h_delta_d0", 400, d0min, d0max);
29 h_delta_z0 =
new TH1F(
"h_delta_z0",
"h_delta_z0", 200, z0min, z0max);
30 h_delta_p =
new TH1F(
"h_delta_p",
"h_delta_p", 200, -1, 4);
32 h_delta_phi =
new TH1F(
"h_delta_phi",
"h_delta_phi", 400, -0.2, 0.2);
33 h_delta_theta =
new TH1F(
"h_delta_theta",
"h_delta_theta", 200, -0.1, 0.1);
35 h_delta_d0_vs_recoil_p =
36 new TH2F(
"h_delta_d0_vs_recoil_p",
"h_delta_d0_vs_recoil_p", 200, 0, 5,
38 h_delta_z0_vs_recoil_p =
39 new TH2F(
"h_delta_z0_vs_recoil_p",
"h_delta_z0_vs_recoil_p", 200, 0, 5,
43 new TH2F(
"h_td0_vs_rd0",
"h_td0_vs_rd0", 100, -40, 40, 100, -40, 40);
45 new TH2F(
"h_tz0_vs_rz0",
"h_tz0_vs_rz0", 100, -40, 40, 100, -40, 40);
47 gctx_ = Acts::GeometryContext();
48 bctx_ = Acts::MagneticFieldContext();
61 sp_interpolated_bField_ =
62 std::make_shared<InterpolatedMagneticField3>(loadDefaultBField(
63 field_map_, default_transformPos, default_transformBField));
66 Acts::Vector3 b_field(0., 0., -1.5 * Acts::UnitConstants::T);
67 bField_ = std::make_shared<Acts::ConstantBField>(b_field);
69 std::cout <<
"Check if nullptr::" << sp_interpolated_bField_.get()
76 auto&& stepper_const = Acts::EigenStepper<>{bField_};
77 propagator_ = std::make_shared<VoidPropagator>(stepper_const);
95 using Linearizer = Acts::HelicalTrackLinearizer;
96 Linearizer::Config linearizerConfig;
97 linearizerConfig.bField = bField_;
98 linearizerConfig.propagator = propagator_;
99 Linearizer linearizer(linearizerConfig);
102 using VertexFitter = Acts::FullBilloirVertexFitter;
108 VertexFitter::Config vertexFitterCfg;
109 VertexFitter billoirFitter(vertexFitterCfg);
121 Acts::VertexingOptions vfOptions(gctx_, bctx_);
125 const std::vector<ldmx::Track> tracks_1 =
127 const std::vector<ldmx::Track> tracks_2 =
130 ldmx_log(debug) <<
"Retrieved track collections" << std::endl
131 <<
"Track 1 size:" << tracks_1.size() << std::endl
132 <<
"Track 2 size:" << tracks_2.size() << std::endl;
134 if (tracks_1.size() < 1 || tracks_2.size() < 1)
return;
136 std::vector<Acts::BoundTrackParameters> billoir_tracks_1, billoir_tracks_2;
140 std::shared_ptr<Acts::PerigeeSurface> perigeeSurface =
141 Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3(
142 tracks_1.front().getPerigeeX(), tracks_1.front().getPerigeeY(),
143 tracks_1.front().getPerigeeZ()));
146 TaggerRecoilMonitoring(tracks_1, tracks_2);
152 for (
auto& trk : tracks_1) {
153 billoir_tracks_1.push_back(
154 tracking::sim::utils::boundTrackParameters(trk, perigeeSurface));
157 for (
auto& trk : tracks_2) {
158 billoir_tracks_2.push_back(
159 tracking::sim::utils::boundTrackParameters(trk, perigeeSurface));
163 std::vector<Acts::Vertex> fit_vertices;
165 for (
auto& b_trk_1 : billoir_tracks_1) {
166 std::vector<const Acts::BoundTrackParameters*> fit_tracks_ptr;
168 for (
auto& b_trk_2 : billoir_tracks_2) {
169 fit_tracks_ptr.push_back(&b_trk_1);
170 fit_tracks_ptr.push_back(&b_trk_2);
172 ldmx_log(debug) <<
"Calling vertex fitter" << std::endl
173 <<
"Track 1 parameters" << std::endl
174 << b_trk_1 << std::endl
175 <<
"Track 2 parameters" << std::endl
176 << b_trk_2 << std::endl;
192 ldmx_log(warn) <<
"Vertex fit failed" << std::endl;