9 template <
unsigned int N>
14 : theLinP(linP.
clone()),
16 theSmoother(smoother.
clone()),
17 theLTrackFactory(ltsf.
clone()) {
21 template <
unsigned int N>
28 theLinP(linP.
clone()),
30 theSmoother(smoother.
clone()),
31 theLTrackFactory(ltsf.
clone()) {
35 template <
unsigned int N>
38 theLinP =
original.linearizationPointFinder()->clone();
39 theUpdator =
original.vertexUpdator()->clone();
40 theSmoother =
original.vertexSmoother()->clone();
43 theLTrackFactory =
original.linearizedTrackStateFactory()->clone();
46 template <
unsigned int N>
51 delete theLTrackFactory;
54 template <
unsigned int N>
56 theMaxShift = thePSet.getParameter<
double>(
"maxDistance");
57 theMaxStep = thePSet.getParameter<
int>(
"maxNbrOfIterations");
60 template <
unsigned int N>
62 thePSet.addParameter<
double>(
"maxDistance", 0.01);
63 thePSet.addParameter<
int>(
"maxNbrOfIterations", 10);
67 template <
unsigned int N>
71 if (!insideTrackerBounds(linP))
75 ROOT::Math::SMatrixIdentity
id;
79 std::vector<RefCountedVertexTrack> vtContainer = linearizeTracks(
tracks,
state);
80 return fit(vtContainer,
state,
false);
83 template <
unsigned int N>
90 template <
unsigned int N>
94 ROOT::Math::SMatrixIdentity
id;
104 template <
unsigned int N>
108 ROOT::Math::SMatrixIdentity
id;
112 std::vector<RefCountedVertexTrack> vtContainer = linearizeTracks(
tracks,
state);
113 return fit(vtContainer,
state,
false);
120 template <
unsigned int N>
124 std::vector<RefCountedVertexTrack> vtContainer;
129 if (!insideTrackerBounds(linP))
131 ROOT::Math::SMatrixIdentity
id;
135 vtContainer = linearizeTracks(
tracks, lpState);
138 vtContainer = linearizeTracks(
tracks, beamSpotState);
141 return fit(vtContainer, beamSpotState,
true);
149 template <
unsigned int N>
154 std::vector<RefCountedVertexTrack> vtContainer = linearizeTracks(
tracks,
state);
155 return fit(vtContainer,
state,
true);
162 template <
unsigned int N>
172 template <
unsigned int N>
176 std::vector<RefCountedVertexTrack> finalTracks;
177 finalTracks.reserve(
tracks.size());
178 for (vector<reco::TransientTrack>::const_iterator
i =
tracks.begin();
i !=
tracks.end();
i++) {
181 finalTracks.push_back(vTrData);
190 template <
unsigned int N>
194 std::vector<RefCountedVertexTrack> finalTracks;
195 finalTracks.reserve(
tracks.size());
196 for (
typename std::vector<RefCountedVertexTrack>::const_iterator
i =
tracks.begin();
i !=
tracks.end();
i++) {
202 finalTracks.push_back(vTrData);
209 template <
unsigned int N>
212 bool withPrior)
const {
213 std::vector<RefCountedVertexTrack> initialTracks;
217 CachingVertex<N> returnVertex(priorVertexPosition, priorVertexError, initialTracks, 0);
220 priorVertexPosition, priorVertexError, priorVertexPosition, priorVertexError, initialTracks, 0);
223 std::vector<RefCountedVertexTrack> globalVTracks =
tracks;
226 bool validVertex =
true;
237 for (
typename std::vector<RefCountedVertexTrack>::const_iterator
i = globalVTracks.begin();
238 i != globalVTracks.end();
240 fVertex = theUpdator->add(fVertex, *
i);
245 validVertex = fVertex.
isValid();
247 if (validVertex && hasNan(fVertex.
position())) {
248 LogDebug(
"RecoVertex/SequentialVertexFitter") <<
"Fitted position is NaN.\n";
252 if (validVertex && !insideTrackerBounds(fVertex.
position())) {
253 LogDebug(
"RecoVertex/SequentialVertexFitter") <<
"Fitted position is out of tracker bounds.\n";
260 ROOT::Math::SMatrixIdentity
id;
266 previousPosition = newPosition;
269 returnVertex = fVertex;
270 globalVTracks.clear();
272 }
while ((
step != theMaxStep) && (((previousPosition - newPosition).
transverse() > theMaxShift) || (!validVertex)));
275 LogDebug(
"RecoVertex/SequentialVertexFitter")
276 <<
"Fitted position is invalid (out of tracker bounds or has NaN). Returned vertex is invalid\n";
280 if (
step >= theMaxStep) {
281 LogDebug(
"RecoVertex/SequentialVertexFitter")
282 <<
"The maximum number of steps has been exceeded. Returned vertex is invalid\n";
287 returnVertex = theSmoother->smooth(returnVertex);
CachingVertex< N > fit(const std::vector< RefCountedVertexTrack > &tracks, const VertexState priorVertex, bool withPrior) const
VertexState const & vertexState() const
Global3DPoint GlobalPoint
~SequentialVertexFitter() override
std::vector< RefCountedVertexTrack > reLinearizeTracks(const std::vector< RefCountedVertexTrack > &tracks, const VertexState state) const
T transverse() const
Another name for perp()
CachingVertex< N > vertex(const std::vector< reco::TransientTrack > &tracks) const override
GlobalError error() const
std::vector< RefCountedVertexTrack > linearizeTracks(const std::vector< reco::TransientTrack > &tracks, const VertexState state) const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
void setDefaultParameters()
GlobalPoint position() const
GlobalPoint position() const