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()),
26 theUpdator(updator.
clone()),
27 theSmoother(smoother.
clone()),
28 theLTrackFactory(ltsf.
clone()) {
32 template <
unsigned int N>
39 theLinP(linP.
clone()),
40 theUpdator(updator.
clone()),
41 theSmoother(smoother.
clone()),
42 theLTrackFactory(ltsf.
clone()) {
46 template <
unsigned int N>
53 theMaxStep = original.
maxStep();
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>
81 GlobalPoint linP = theLinP->getLinearizationPoint(tracks);
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>
98 return fit(tracks, state,
true);
101 template <
unsigned int N>
104 GlobalPoint linP = tracks[0]->linearizedTrack()->linearizationPoint();
105 ROOT::Math::SMatrixIdentity
id;
109 return fit(tracks, state,
false);
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;
137 if (tracks.size() > 1) {
139 GlobalPoint linP = theLinP->getLinearizationPoint(tracks);
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>
178 return fit(tracks, state,
true);
183 template <
unsigned int N>
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>
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;
245 globalVTracks = reLinearizeTracks(tracks, returnVertex.
vertexState());
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);
std::vector< RefCountedVertexTrack > reLinearizeTracks(const std::vector< RefCountedVertexTrack > &tracks, const VertexState state) const
uint16_t *__restrict__ id
const VertexUpdator< N > * vertexUpdator() const
CachingVertex< N > fit(const std::vector< RefCountedVertexTrack > &tracks, const VertexState priorVertex, bool withPrior) const
VertexState const & vertexState() const
Global3DPoint GlobalPoint
~SequentialVertexFitter() override
auto const & tracks
cannot be loose
const AbstractLTSFactory< N > * linearizedTrackStateFactory() const
GlobalPoint position() const
CachingVertex< N > vertex(const std::vector< reco::TransientTrack > &tracks) const override
const VertexSmoother< N > * vertexSmoother() const
Abs< T >::type abs(const T &t)
GlobalWeight weight() const
const edm::ParameterSet parameterSet() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
GlobalPoint position() const
virtual LinearizationPointFinder * clone() const =0
T transverse() const
Another name for perp()
const int maxStep() const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
GlobalError error() const
std::vector< RefCountedVertexTrack > linearizeTracks(const std::vector< reco::TransientTrack > &tracks, const VertexState state) const
void setDefaultParameters()
const float maxShift() const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
const LinearizationPointFinder * linearizationPointFinder() const