13 const float TrackerBoundsRadius = 112;
14 const float TrackerBoundsHalfLength = 273.5;
16 return ((
point.transverse() < TrackerBoundsRadius) && (
abs(
point.z()) < TrackerBoundsHalfLength));
20 template <
unsigned int N>
25 : theLinP(linP.
clone()),
27 theSmoother(smoother.
clone()),
28 theLTrackFactory(ltsf.
clone()) {
32 template <
unsigned int N>
39 theLinP(linP.
clone()),
41 theSmoother(smoother.
clone()),
42 theLTrackFactory(ltsf.
clone()) {
46 template <
unsigned int N>
49 theLinP =
original.linearizationPointFinder()->clone();
50 theUpdator =
original.vertexUpdator()->clone();
51 theSmoother =
original.vertexSmoother()->clone();
54 theLTrackFactory =
original.linearizedTrackStateFactory()->clone();
57 template <
unsigned int N>
62 delete theLTrackFactory;
65 template <
unsigned int N>
67 theMaxShift = thePSet.getParameter<
double>(
"maxDistance");
68 theMaxStep = thePSet.getParameter<
int>(
"maxNbrOfIterations");
71 template <
unsigned int N>
73 thePSet.addParameter<
double>(
"maxDistance", 0.01);
74 thePSet.addParameter<
int>(
"maxNbrOfIterations", 10);
78 template <
unsigned int N>
82 if (!insideTrackerBounds(linP))
86 ROOT::Math::SMatrixIdentity
id;
90 std::vector<RefCountedVertexTrack> vtContainer = linearizeTracks(
tracks, state);
91 return fit(vtContainer, state,
false);
94 template <
unsigned int N>
101 template <
unsigned int N>
105 ROOT::Math::SMatrixIdentity
id;
115 template <
unsigned int N>
119 ROOT::Math::SMatrixIdentity
id;
123 std::vector<RefCountedVertexTrack> vtContainer = linearizeTracks(
tracks, state);
124 return fit(vtContainer, state,
false);
131 template <
unsigned int N>
135 std::vector<RefCountedVertexTrack> vtContainer;
140 if (!insideTrackerBounds(linP))
142 ROOT::Math::SMatrixIdentity
id;
146 vtContainer = linearizeTracks(
tracks, lpState);
149 vtContainer = linearizeTracks(
tracks, beamSpotState);
152 return fit(vtContainer, beamSpotState,
true);
160 template <
unsigned int N>
165 std::vector<RefCountedVertexTrack> vtContainer = linearizeTracks(
tracks, state);
166 return fit(vtContainer, state,
true);
173 template <
unsigned int N>
183 template <
unsigned int N>
185 const std::vector<reco::TransientTrack>&
tracks,
const VertexState state)
const {
187 std::vector<RefCountedVertexTrack> finalTracks;
188 finalTracks.reserve(
tracks.size());
189 for (vector<reco::TransientTrack>::const_iterator
i =
tracks.begin();
i !=
tracks.end();
i++) {
192 finalTracks.push_back(vTrData);
201 template <
unsigned int N>
203 const std::vector<RefCountedVertexTrack>&
tracks,
const VertexState state)
const {
205 std::vector<RefCountedVertexTrack> finalTracks;
206 finalTracks.reserve(
tracks.size());
207 for (
typename std::vector<RefCountedVertexTrack>::const_iterator
i =
tracks.begin();
i !=
tracks.end();
i++) {
213 finalTracks.push_back(vTrData);
220 template <
unsigned int N>
223 bool withPrior)
const {
224 std::vector<RefCountedVertexTrack> initialTracks;
228 CachingVertex<N> returnVertex(priorVertexPosition, priorVertexError, initialTracks, 0);
231 priorVertexPosition, priorVertexError, priorVertexPosition, priorVertexError, initialTracks, 0);
234 std::vector<RefCountedVertexTrack> globalVTracks =
tracks;
237 bool validVertex =
true;
248 for (
typename std::vector<RefCountedVertexTrack>::const_iterator
i = globalVTracks.begin();
249 i != globalVTracks.end();
251 fVertex = theUpdator->add(fVertex, *
i);
256 validVertex = fVertex.
isValid();
258 if (validVertex && hasNan(fVertex.
position())) {
259 LogDebug(
"RecoVertex/SequentialVertexFitter") <<
"Fitted position is NaN.\n";
263 if (validVertex && !insideTrackerBounds(fVertex.
position())) {
264 LogDebug(
"RecoVertex/SequentialVertexFitter") <<
"Fitted position is out of tracker bounds.\n";
271 ROOT::Math::SMatrixIdentity
id;
277 previousPosition = newPosition;
280 returnVertex = fVertex;
281 globalVTracks.clear();
283 }
while ((
step != theMaxStep) && (((previousPosition - newPosition).
transverse() > theMaxShift) || (!validVertex)));
286 LogDebug(
"RecoVertex/SequentialVertexFitter")
287 <<
"Fitted position is invalid (out of tracker bounds or has NaN). Returned vertex is invalid\n";
291 if (
step >= theMaxStep) {
292 LogDebug(
"RecoVertex/SequentialVertexFitter")
293 <<
"The maximum number of steps has been exceeded. Returned vertex is invalid\n";
298 returnVertex = theSmoother->smooth(returnVertex);