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/InPhi0ImpactCurvBox.h>
19using namespace TrackFindingCDC;
20using namespace PerigeeBinSpec;
26 std::string svgFileName =
"phi0_impact_curv_on_hits.svg";
28 Helix lowerCurvHelix(0.015, 2.52033, -20, 0, 0);
29 Helix higherCurvHelix(0.027, 3.0718, 20, 0, 0);
35 simulate({lowerCurvHelix, higherCurvHelix});
36 saveDisplay(svgFileName);
38 using SimpleWireHitPhi0ImpactCurvHoughTree =
41 SimpleWireHitPhi0ImpactCurvHoughTree houghTree(maxLevel, curlCurv);
42 using HoughBox = SimpleWireHitPhi0ImpactCurvHoughTree::HoughBox;
44 const double minWeight = 70.0;
50 houghTree.initialize();
53 std::vector< std::pair<HoughBox, std::vector<CDCRLWireHit> > > candidates;
58 houghTree.seed(m_axialWireHits);
60 candidates = houghTree.find(minWeight, maxCurvAcceptance);
63 ASSERT_EQ(m_mcTracks.size(), candidates.size());
66 for (
size_t iCand = 0; iCand < candidates.size(); ++iCand) {
67 EXPECT_GE(candidates[iCand].second.size(), 30);
71 std::size_t nNodes = houghTree.getTree()->getNNodes();
72 B2INFO(
"Tree generated " << nNodes <<
" nodes");
78 for (std::pair<HoughBox, std::vector<CDCRLWireHit> >& candidate : candidates) {
79 const HoughBox& houghBox = candidate.first;
80 const std::vector<CDCRLWireHit>& taggedHits = candidate.second;
82 B2DEBUG(100,
"Candidate");
83 B2DEBUG(100,
"size " << taggedHits.size());
84 B2DEBUG(100,
"Phi0 " << houghBox.getLowerBound<
DiscretePhi0>()->phi());
85 B2DEBUG(100,
"Curv " << houghBox.getLowerBound<
DiscreteCurv>());
88 B2DEBUG(100,
"Tags of the hits");
91 "rl = " <<
static_cast<int>(rlTaggedWireHit.getRLInfo()) <<
" " <<
92 "dl = " << rlTaggedWireHit.getRefDriftLength());
96 const CDCWireHit& wireHit = rlTaggedWireHit.getWireHit();
97 std::string color =
"blue";
98 if (rlTaggedWireHit.getRLInfo() == ERightLeft::c_Right) {
100 }
else if (rlTaggedWireHit.getRLInfo() == ERightLeft::c_Left) {
105 draw(wireHit, strokeAttr);
109 saveDisplay(svgFileName);
118 std::string svgFileName =
"phi0_impact_curv_on_segments.svg";
120 Helix lowerCurvHelix(0.015, 2.52033, -20, 0, 0);
121 Helix higherCurvHelix(0.027, 3.0718, 20, 0, 0);
123 simulate({lowerCurvHelix, higherCurvHelix});
124 saveDisplay(svgFileName);
126 using SimpleSegmentPhi0ImpactCurvHoughTree =
129 SimpleSegmentPhi0ImpactCurvHoughTree houghTree(maxLevel, curlCurv);
130 using HoughBox = SimpleSegmentPhi0ImpactCurvHoughTree::HoughBox;
132 const double minWeight = 70.0;
138 houghTree.initialize();
141 std::vector< std::pair<HoughBox, std::vector<const CDCSegment2D*> > > candidates;
148 houghTree.seed(m_mcAxialSegment2Ds);
150 candidates = houghTree.find(minWeight, maxCurvAcceptance);
153 ASSERT_EQ(m_mcTracks.size(), candidates.size());
157 for (
size_t iCand = 0; iCand < candidates.size(); ++iCand) {
158 EXPECT_GE(candidates[iCand].second.size(), 4);
163 std::size_t nNodes = houghTree.getTree()->getNNodes();
164 B2INFO(
"Tree generated " << nNodes <<
" nodes");
169 for (std::pair<HoughBox, std::vector<const CDCSegment2D*> >& candidate : candidates) {
170 const HoughBox& houghBox = candidate.first;
171 const std::vector<const CDCSegment2D*>& segments = candidate.second;
173 B2DEBUG(100,
"Candidate");
174 B2DEBUG(100,
"size " << segments.size());
175 B2DEBUG(100,
"Phi0 " << houghBox.getLowerBound<
DiscretePhi0>()->phi());
176 B2DEBUG(100,
"Curv " << houghBox.getLowerBound<
DiscreteCurv>());
181 draw(*segment2D, strokeAttr);
185 saveDisplay(svgFileName);
192 std::string svgFileName =
"phi0_impact_curv_on_prepared_event_segments.svg";
194 saveDisplay(svgFileName);
196 using SimpleSegmentPhi0ImpactCurvHoughTree =
199 using HoughBox = SimpleSegmentPhi0ImpactCurvHoughTree::HoughBox;
200 SimpleSegmentPhi0ImpactCurvHoughTree houghTree(maxLevel);
209 houghTree.initialize();
210 const double minWeight = 30.0;
213 std::vector< std::pair<HoughBox, std::vector<const CDCSegment2D*> > > candidates;
219 houghTree.seed(m_mcAxialSegment2Ds);
222 candidates = houghTree.findBest(minWeight, maxCurvAcceptance);
224 ASSERT_EQ(m_mcTracks.size(), candidates.size());
227 for (
size_t iCand = 0; iCand < candidates.size(); ++iCand) {
228 EXPECT_GE(candidates[iCand].second.size(), 3);
233 std::size_t nNodes = houghTree.getTree()->getNNodes();
234 B2DEBUG(100,
"Tree generated " << nNodes <<
" nodes");
239 for (std::pair<HoughBox, std::vector<const CDCSegment2D*> >& candidate : candidates) {
240 const HoughBox& houghBox = candidate.first;
241 const std::vector<const CDCSegment2D*>& segments = candidate.second;
243 B2DEBUG(100,
"Candidate");
244 B2DEBUG(100,
"size " << segments.size());
245 B2DEBUG(100,
"Phi0 " << houghBox.getLowerBound<
DiscretePhi0>()->phi());
246 B2DEBUG(100,
"Curv " << houghBox.getLowerBound<
DiscreteCurv>());
251 draw(*segment2D, strokeAttr);
255 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.
Type to have values not based on discrete positions from an array.
DiscreteCurv::Array constructArray() const
Construct the array of discrete curve positions.
int getNOverlap() const
Getter for the overlap in discrete number of positions.
Representation for a discrete position in an array of discrete positions.
PrimitivePlotter::AttributeMap AttributeMap
Forward the Attribute map from the primitive plotter.
double getOverlap() const
Getter for the overlap in real impact to investigate the value that results from the discrete overlap...
DiscretePhi0::Array constructArray() const
Construct the array of discrete phi0 positions.
int getNOverlap() const
Getter for the overlap in discrete number of positions.
A convenience class based on a BoxDivisionHoughTree for "hit-like" classes.
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.