13 static const float TrackerBoundsRadius = 112;
14 static const float TrackerBoundsHalfLength = 273.5;
16 return ((point.
transverse() < TrackerBoundsRadius)
17 && (
abs(point.
z()) < TrackerBoundsHalfLength));
22 template <
unsigned int N>
27 theLinP(linP.
clone()), theUpdator(updator.
clone()),
28 theSmoother(smoother.
clone()), theLTrackFactory ( ltsf.
clone() )
33 template <
unsigned int N>
38 thePSet(pSet), theLinP(linP.
clone()), theUpdator(updator.
clone()),
39 theSmoother(smoother.
clone()), theLTrackFactory ( ltsf.
clone() )
45 template <
unsigned int N>
54 theMaxStep = original.
maxStep();
59 template <
unsigned int N>
65 delete theLTrackFactory;
69 template <
unsigned int N>
72 theMaxShift = thePSet.getParameter<
double>(
"maxDistance");
73 theMaxStep = thePSet.getParameter<
int>(
"maxNbrOfIterations");
76 template <
unsigned int N>
79 thePSet.addParameter<
double>(
"maxDistance", 0.01);
80 thePSet.addParameter<
int>(
"maxNbrOfIterations", 10);
84 template <
unsigned int N>
89 GlobalPoint linP = theLinP->getLinearizationPoint(tracks);
90 if (!insideTrackerBounds(linP)) linP =
GlobalPoint(0,0,0);
93 ROOT::Math::SMatrixIdentity
id;
97 std::vector<RefCountedVertexTrack> vtContainer = linearizeTracks(tracks, state);
98 return fit(vtContainer, state,
false);
101 template <
unsigned int N>
103 const std::vector<RefCountedVertexTrack> &
tracks,
107 return fit(tracks, state,
true );
110 template <
unsigned int N>
115 GlobalPoint linP = tracks[0]->linearizedTrack()->linearizationPoint();
116 ROOT::Math::SMatrixIdentity
id;
120 return fit(tracks, state,
false);
127 template <
unsigned int N>
133 ROOT::Math::SMatrixIdentity
id;
137 std::vector<RefCountedVertexTrack> vtContainer = linearizeTracks(tracks, state);
138 return fit(vtContainer, state,
false);
146 template <
unsigned int N>
152 std::vector<RefCountedVertexTrack> vtContainer;
154 if (tracks.size() > 1) {
156 GlobalPoint linP = theLinP->getLinearizationPoint(tracks);
157 if (!insideTrackerBounds(linP)) linP =
GlobalPoint(0,0,0);
158 ROOT::Math::SMatrixIdentity
id;
162 vtContainer = linearizeTracks(tracks, lpState);
165 vtContainer = linearizeTracks(tracks, beamSpotState);
168 return fit(vtContainer, beamSpotState,
true);
177 template <
unsigned int N>
179 const std::vector<reco::TransientTrack> &
tracks,
184 std::vector<RefCountedVertexTrack> vtContainer = linearizeTracks(tracks, state);
185 return fit(vtContainer, state,
true);
192 template <
unsigned int N>
194 const std::vector<RefCountedVertexTrack> &
tracks,
199 return fit(tracks, state,
true);
205 template <
unsigned int N>
206 vector<typename SequentialVertexFitter<N>::RefCountedVertexTrack>
208 const std::vector<reco::TransientTrack> &
tracks,
212 std::vector<RefCountedVertexTrack> finalTracks;
213 finalTracks.reserve(tracks.size());
214 for(vector<reco::TransientTrack>::const_iterator
i = tracks.begin();
215 i != tracks.end();
i++) {
217 = theLTrackFactory->linearizedTrackState(linP, *
i);
219 finalTracks.push_back(vTrData);
229 template <
unsigned int N>
230 vector<typename SequentialVertexFitter<N>::RefCountedVertexTrack>
232 const std::vector<RefCountedVertexTrack> &
tracks,
237 std::vector<RefCountedVertexTrack> finalTracks;
238 finalTracks.reserve(tracks.size());
239 for(
typename std::vector<RefCountedVertexTrack>::const_iterator
i = tracks.begin();
240 i != tracks.end();
i++) {
242 (**i).linearizedTrack()->stateWithNewLinearizationPoint(linP);
247 theVTrackFactory.vertexTrack(lTrData,state, (**i).
weight() );
248 finalTracks.push_back(vTrData);
256 template <
unsigned int N>
259 const VertexState priorVertex,
bool withPrior )
const
261 std::vector<RefCountedVertexTrack> initialTracks;
265 CachingVertex<N> returnVertex(priorVertexPosition,priorVertexError,initialTracks,0);
268 priorVertexPosition,priorVertexError,initialTracks,0);
271 std::vector<RefCountedVertexTrack> globalVTracks =
tracks;
274 bool validVertex =
true;
281 if(step != 0) globalVTracks = reLinearizeTracks(tracks,
285 for (
typename std::vector<RefCountedVertexTrack>::const_iterator
i
286 = globalVTracks.begin();
i != globalVTracks.end();
i++) {
287 fVertex = theUpdator->add(fVertex,*
i);
291 validVertex = fVertex.
isValid();
293 if (validVertex && hasNan(fVertex.
position())) {
294 LogDebug(
"RecoVertex/SequentialVertexFitter")
295 <<
"Fitted position is NaN.\n";
299 if (validVertex && !insideTrackerBounds(fVertex.
position())) {
300 LogDebug(
"RecoVertex/SequentialVertexFitter")
301 <<
"Fitted position is out of tracker bounds.\n";
308 ROOT::Math::SMatrixIdentity
id;
315 previousPosition = newPosition;
318 returnVertex = fVertex;
319 globalVTracks.clear();
321 }
while ( (step != theMaxStep) &&
322 (((previousPosition - newPosition).
transverse() > theMaxShift) ||
326 LogDebug(
"RecoVertex/SequentialVertexFitter")
327 <<
"Fitted position is invalid (out of tracker bounds or has NaN). Returned vertex is invalid\n";
331 if (step >= theMaxStep) {
332 LogDebug(
"RecoVertex/SequentialVertexFitter")
333 <<
"The maximum number of steps has been exceeded. Returned vertex is invalid\n";
338 returnVertex = theSmoother->smooth(returnVertex);
std::vector< RefCountedVertexTrack > reLinearizeTracks(const std::vector< RefCountedVertexTrack > &tracks, const VertexState state) const
VertexState vertexState() const
const VertexUpdator< N > * vertexUpdator() const
CachingVertex< N > fit(const std::vector< RefCountedVertexTrack > &tracks, const VertexState priorVertex, bool withPrior) const
Global3DPoint GlobalPoint
const AbstractLTSFactory< N > * linearizedTrackStateFactory() const
GlobalPoint position() const
virtual CachingVertex< N > vertex(const std::vector< reco::TransientTrack > &tracks) const
const VertexSmoother< N > * vertexSmoother() const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
virtual ~SequentialVertexFitter()
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
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