12 #include <tracking/trackFindingCDC/fitting/CDCFitter2D.h>
14 #include <tracking/trackFindingCDC/fitting/CDCObservations2D.h>
16 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
18 #include <tracking/trackFindingCDC/fitting/EFitVariance.h>
19 #include <tracking/trackFindingCDC/fitting/EFitPos.h>
26 namespace TrackFindingCDC {
28 template <
class AFitMethod>
31 , m_useOrientation(false)
32 , m_fitVariance(EFitVariance::c_Proper)
36 template <
class AFitMethod>
39 template <
class AFitMethod>
45 template <
class AFitMethod>
49 update(result, observations2D);
53 template <
class AFitMethod>
60 template <
class AFitMethod>
63 AFitMethod::update(trajectory2D, observations2D);
66 template <
class AFitMethod>
69 return fitGeneric(track);
72 template <
class AFitMethod>
75 return fitGeneric(segment);
78 template <
class AFitMethod>
81 return fitGeneric(segment);
84 template <
class AFitMethod>
87 return fitGeneric(wireHits);
90 template <
class AFitMethod>
93 return fitGeneric(wires);
96 template <
class AFitMethod>
99 return fitGeneric(wireHits);
102 template <
class AFitMethod>
106 return fitGeneric(fromSegment, toSegment);
109 template <
class AFitMethod>
113 updateGeneric(trajectory2D, segment);
116 template <
class AFitMethod>
120 return updateGeneric(trajectory2D, axialSegmentPair);
123 template <
class AFitMethod>
124 template <
class AHits>
128 updateGeneric(result, hits);
132 template <
class AFitMethod>
133 template <
class AStartHits,
class AEndHits>
138 updateGeneric(result, startHits, endHits);
142 template <
class AFitMethod>
143 template <
class AStartHits,
class AEndHits>
145 const AStartHits& startHits,
146 const AEndHits& endHits)
const
155 if (m_useOrientation) {
156 observations2D.
setFitPos(EFitPos::c_RLDriftCircle);
161 observations2D.
setFitPos(EFitPos::c_RecoPos);
164 if (m_useOrientation) {
165 observations2D.
setFitPos(EFitPos::c_RLDriftCircle);
169 if (observations2D.
size() < 4) {
170 trajectory2D.
clear();
172 AFitMethod::update(trajectory2D, observations2D);
176 template <
class AFitMethod>
177 template <
class AHits>
179 CDCFitter2D<AFitMethod>::updateGeneric(CDCTrajectory2D& trajectory2D,
const AHits& hits)
const
181 CDCObservations2D observations2D;
185 observations2D.setFitPos(EFitPos::c_RecoPos);
186 observations2D.appendRange(hits);
188 if (m_useOrientation) {
189 observations2D.setFitPos(EFitPos::c_RLDriftCircle);
190 observations2D.appendRange(hits);
193 if (observations2D.size() < 4) {
194 trajectory2D.clear();
196 AFitMethod::update(trajectory2D, observations2D);
200 template <
class AFitMethod>
201 void CDCFitter2D<AFitMethod>::useOnlyPosition()
203 m_usePosition =
true;
204 m_useOrientation =
false;
207 template <
class AFitMethod>
208 void CDCFitter2D<AFitMethod>::useOnlyOrientation()
210 m_usePosition =
false;
211 m_useOrientation =
true;
214 template <
class AFitMethod>
217 m_usePosition =
true;
218 m_useOrientation =
true;
221 template <
class AFitMethod>
224 m_fitVariance = fitVariance;