8#include <tracking/trackFindingCDC/testFixtures/TrackFindingCDCTestWithSimpleSimulation.h>
10#include <tracking/trackFindingCDC/hough/perigee/SimpleRLTaggedWireHitHoughTree.h>
11#include <tracking/trackFindingCDC/hough/perigee/SimpleSegmentHoughTree.h>
12#include <tracking/trackFindingCDC/hough/perigee/StandardBinSpec.h>
14#include <tracking/trackFindingCDC/hough/algorithms/InPhi0ImpactBox.h>
19using namespace TrackFindingCDC;
20using namespace PerigeeBinSpec;
26 std::string svgFileName =
"phi0_impact_on_hits.svg";
28 Helix lowerHelix(0.00, 2.52033, -20, 0, 0);
29 Helix higherHelix(0.00, 3.0718, 20, 0, 0);
31 simulate({lowerHelix, higherHelix});
32 saveDisplay(svgFileName);
34 using SimpleRLTaggedWireHitHoughTree =
35 SimpleRLTaggedWireHitHoughTree<InPhi0ImpactBox, phi0Divisions, impactDivisions>;
37 SimpleRLTaggedWireHitHoughTree houghTree(maxLevel);
40 houghTree.assignArray<DiscretePhi0>(phi0BinsSpec.constructArray(), phi0BinsSpec.getNOverlap());
42 houghTree.assignArray<ContinuousImpact>({{minImpact, maxImpact}}, impactBinsSpec.getOverlap());
43 houghTree.initialize();
46 std::vector< std::pair<HoughBox, std::vector<CDCRLWireHit> > > candidates;
51 houghTree.seed(m_axialWireHits);
53 const double minWeight = 30.0;
54 candidates = houghTree.find(minWeight);
57 ASSERT_EQ(m_mcTracks.size(), candidates.size());
60 for (
size_t iCand = 0; iCand < candidates.size(); ++iCand) {
61 EXPECT_GE(candidates[iCand].second.size(), 30);
65 std::size_t nNodes = houghTree.getTree()->getNNodes();
66 B2INFO(
"Tree generated " << nNodes <<
" nodes");
72 for (std::pair<HoughBox, std::vector<CDCRLWireHit> >& candidate : candidates) {
73 const HoughBox& houghBox = candidate.first;
74 const std::vector<CDCRLWireHit>& taggedHits = candidate.second;
76 B2DEBUG(100,
"Candidate");
77 B2DEBUG(100,
"size " << taggedHits.size());
78 B2DEBUG(100,
"Phi0 " << houghBox.getLowerBound<DiscretePhi0>()->phi());
79 B2DEBUG(100,
"Impact " << houghBox.getLowerBound<ContinuousImpact>());
81 B2DEBUG(100,
"Tags of the hits");
84 "rl = " <<
static_cast<int>(rlTaggedWireHit.getRLInfo()) <<
" " <<
85 "dl = " << rlTaggedWireHit.getRefDriftLength());
89 const CDCWireHit& wireHit = rlTaggedWireHit.getWireHit();
90 std::string color =
"blue";
91 if (rlTaggedWireHit.getRLInfo() == ERightLeft::c_Right) {
93 }
else if (rlTaggedWireHit.getRLInfo() == ERightLeft::c_Left) {
98 draw(wireHit, strokeAttr);
102 saveDisplay(svgFileName);
112 std::string svgFileName =
"phi0_impact_on_segments.svg";
114 Helix lowerHelix(0.00, 2.52033, -20, 0, 0);
115 Helix higherHelix(0.00, 3.0718, 20, 0, 0);
117 simulate({lowerHelix, higherHelix});
118 saveDisplay(svgFileName);
120 using SimpleSegmentPhi0ImpactHoughTree =
121 SimpleSegmentHoughTree<InPhi0ImpactBox, phi0Divisions, impactDivisions>;
122 SimpleSegmentPhi0ImpactHoughTree houghTree(maxLevel);
124 using HoughBox = SimpleSegmentPhi0ImpactHoughTree::HoughBox;
127 houghTree.assignArray<DiscretePhi0>(phi0BinsSpec.constructArray(), phi0BinsSpec.getNOverlap());
129 houghTree.assignArray<ContinuousImpact>({{minImpact, maxImpact}}, impactBinsSpec.getOverlap());
130 houghTree.initialize();
133 std::vector< std::pair<HoughBox, std::vector<const CDCSegment2D*> > > candidates;
140 houghTree.seed(m_mcAxialSegment2Ds);
142 const double minWeight = 40.0;
143 candidates = houghTree.find(minWeight);
146 ASSERT_EQ(m_mcTracks.size(), candidates.size());
150 for (
size_t iCand = 0; iCand < candidates.size(); ++iCand) {
151 EXPECT_GE(candidates[iCand].second.size(), 4);
156 std::size_t nNodes = houghTree.getTree()->getNNodes();
157 B2INFO(
"Tree generated " << nNodes <<
" nodes");
162 for (std::pair<HoughBox, std::vector<const CDCSegment2D*> >& candidate : candidates) {
163 const HoughBox& houghBox = candidate.first;
164 const std::vector<const CDCSegment2D*>& segments = candidate.second;
166 B2DEBUG(100,
"Candidate");
167 B2DEBUG(100,
"size " << segments.size());
168 B2DEBUG(100,
"Phi0 " << houghBox.getLowerBound<DiscretePhi0>()->phi());
169 B2DEBUG(100,
"Impact " << houghBox.getLowerBound<ContinuousImpact>());
173 draw(*segment2D, strokeAttr);
177 saveDisplay(svgFileName);
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
A reconstructed sequence of two dimensional hits in one super layer.
Class representing a hit wire in the central drift chamber.
PrimitivePlotter::AttributeMap AttributeMap
Forward the Attribute map from the primitive plotter.
typename AInBox::HoughBox HoughBox
Class to capture the time a repeated execution took.
void printSummary() const
Print a summary of the collected time to the console.
Abstract base class for different kinds of events.