56 auto start = std::chrono::high_resolution_clock::now();
57 auto &&stepper = Acts::EigenStepper<>{sp_interpolated_bField_};
60 propagator_ = std::make_shared<VoidPropagator>(stepper);
63 using Linearizer = Acts::HelicalTrackLinearizer;
64 Linearizer::Config linearizerConfig;
65 linearizerConfig.bField = sp_interpolated_bField_;
66 linearizerConfig.propagator = propagator_;
67 Linearizer linearizer(linearizerConfig);
70 using VertexFitter = Acts::FullBilloirVertexFitter;
72 VertexFitter::Config vertexFitterCfg;
74 VertexFitter billoirFitter(vertexFitterCfg);
83 Acts::VertexingOptions vfOptions(
gctx_, bctx_);
86 const std::vector<ldmx::Track> tracks =
90 const std::vector<ldmx::Track> seeds =
91 event.getCollection<
ldmx::Track>(
"RecoilTruthSeeds");
93 if (tracks.size() < 1)
return;
96 std::vector<Acts::BoundTrackParameters> billoir_tracks;
102 std::shared_ptr<Acts::PerigeeSurface> perigeeSurface =
103 Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3(
104 tracks.front().getPerigeeX(), tracks.front().getPerigeeY(),
105 tracks.front().getPerigeeZ()));
107 for (
unsigned int iTrack = 0; iTrack < tracks.size(); iTrack++) {
108 Acts::BoundVector paramVec;
109 paramVec << tracks.at(iTrack).getD0(), tracks.at(iTrack).getZ0(),
110 tracks.at(iTrack).getPhi(), tracks.at(iTrack).getTheta(),
111 tracks.at(iTrack).getQoP(), tracks.at(iTrack).getT();
113 Acts::BoundSquareMatrix covMat =
114 tracking::sim::utils::unpackCov(tracks.at(iTrack).getPerigeeCov());
115 auto part{Acts::GenericParticleHypothesis(Acts::ParticleHypothesis(
116 Acts::PdgParticle(tracks.at(iTrack).getPdgID())))};
117 billoir_tracks.push_back(Acts::BoundTrackParameters(
118 perigeeSurface, paramVec, std::move(covMat), part));
122 if (billoir_tracks.size() != 2) {
126 if (billoir_tracks.at(0).charge() * billoir_tracks.at(1).charge() > 0)
return;
129 double pion_mass = 139.570 * Acts::UnitConstants::MeV;
131 TLorentzVector p1, p2;
132 p1.SetXYZM(billoir_tracks.at(0).momentum()(0),
133 billoir_tracks.at(0).momentum()(1),
134 billoir_tracks.at(0).momentum()(2), pion_mass);
136 p2.SetXYZM(billoir_tracks.at(1).momentum()(0),
137 billoir_tracks.at(1).momentum()(1),
138 billoir_tracks.at(1).momentum()(2), pion_mass);
140 std::vector<TLorentzVector> pion_seeds;
142 if (seeds.size() == 2) {
143 for (
int iSeed = 0; iSeed < seeds.size(); iSeed++) {
144 std::shared_ptr<Acts::PerigeeSurface> perigeeSurface2 =
145 Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3(
146 seeds.at(iSeed).getPerigeeX(), seeds.at(iSeed).getPerigeeY(),
147 seeds.at(iSeed).getPerigeeZ()));
149 Acts::BoundVector paramVec;
150 paramVec << seeds.at(iSeed).getD0(), seeds.at(iSeed).getZ0(),
151 seeds.at(iSeed).getPhi(), seeds.at(iSeed).getTheta(),
152 seeds.at(iSeed).getQoP(), seeds.at(iSeed).getT();
154 Acts::BoundSquareMatrix covMat =
155 tracking::sim::utils::unpackCov(seeds.at(iSeed).getPerigeeCov());
157 if (seeds.at(iSeed).q() < 0) pionPdgId = -211;
159 auto part{Acts::GenericParticleHypothesis(
160 Acts::ParticleHypothesis(Acts::PdgParticle(pionPdgId)))};
161 auto boundSeedParams = Acts::BoundTrackParameters(
162 perigeeSurface, paramVec, std::move(covMat), part);
164 TLorentzVector pion4v;
165 pion4v.SetXYZM(boundSeedParams.momentum()(0),
166 boundSeedParams.momentum()(1),
167 boundSeedParams.momentum()(2), pion_mass);
169 pion_seeds.push_back(pion4v);
172 h_m_truth_->Fill((pion_seeds.at(0) + pion_seeds.at(1)).M());
175 if ((pion_seeds.size() == 2) &&
176 (pion_seeds.at(0) + pion_seeds.at(1)).M() > 0.490 &&
177 (pion_seeds.at(0) + pion_seeds.at(1)).M() < 0.510) {
179 h_m_truthFilter_->Fill((p1 + p2).M());
182 h_m_->Fill((p1 + p2).M());
184 auto end = std::chrono::high_resolution_clock::now();
187 auto diff = end - start;
188 processing_time_ += std::chrono::duration<double, std::milli>(diff).count();