CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MultiVertexReconstructor Class Reference

#include <MultiVertexReconstructor.h>

Inheritance diagram for MultiVertexReconstructor:
VertexReconstructor

Public Member Functions

MultiVertexReconstructorclone () const
 
 MultiVertexReconstructor (const VertexReconstructor &, const AnnealingSchedule &s=DefaultMVFAnnealing(), float revive=-1.)
 
 MultiVertexReconstructor (const MultiVertexReconstructor &)
 
VertexReconstructorreconstructor () const
 
std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &, const reco::BeamSpot &) const
 
std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &) const
 
std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &, const std::vector< reco::TransientTrack > &primaries) const
 
std::vector< TransientVertexvertices (const std::vector< reco::TransientTrack > &, const std::vector< reco::TransientTrack > &primaries, const reco::BeamSpot &spot) const
 
 ~MultiVertexReconstructor ()
 
- Public Member Functions inherited from VertexReconstructor
 VertexReconstructor ()
 
virtual ~VertexReconstructor ()
 

Private Attributes

MultiVertexFitter theFitter
 
VertexReconstructortheOldReconstructor
 

Detailed Description

Class that wraps the MultiVertexFitter, together with a user-supplied VertexReconstructor into a VertexReconstructor.

Definition at line 12 of file MultiVertexReconstructor.h.

Constructor & Destructor Documentation

MultiVertexReconstructor::MultiVertexReconstructor ( const VertexReconstructor o,
const AnnealingSchedule s = DefaultMVFAnnealing(),
float  revive = -1. 
)

Definition at line 70 of file MultiVertexReconstructor.cc.

Referenced by clone().

MultiVertexReconstructor::MultiVertexReconstructor ( const MultiVertexReconstructor o)

Definition at line 87 of file MultiVertexReconstructor.cc.

88  :
90  theFitter ( o.theFitter )
91 {}
virtual VertexReconstructor * clone() const =0
VertexReconstructor * theOldReconstructor
MultiVertexReconstructor::~MultiVertexReconstructor ( )

Definition at line 77 of file MultiVertexReconstructor.cc.

References theOldReconstructor.

78 {
79  delete theOldReconstructor;
80 }
VertexReconstructor * theOldReconstructor

Member Function Documentation

MultiVertexReconstructor * MultiVertexReconstructor::clone ( void  ) const
virtual

Implements VertexReconstructor.

Definition at line 82 of file MultiVertexReconstructor.cc.

References MultiVertexReconstructor().

83 {
84  return new MultiVertexReconstructor ( * this );
85 }
MultiVertexReconstructor(const VertexReconstructor &, const AnnealingSchedule &s=DefaultMVFAnnealing(), float revive=-1.)
VertexReconstructor * MultiVertexReconstructor::reconstructor ( ) const

Definition at line 197 of file MultiVertexReconstructor.cc.

References theOldReconstructor.

198 {
199  return theOldReconstructor;
200 }
VertexReconstructor * theOldReconstructor
vector< TransientVertex > MultiVertexReconstructor::vertices ( const std::vector< reco::TransientTrack > &  t,
const reco::BeamSpot  
) const
virtual

Reconstruct vertices, exploiting the beamspot constraint for the primary vertex

Reimplemented from VertexReconstructor.

Definition at line 93 of file MultiVertexReconstructor.cc.

Referenced by vertices(), and ConfigurableMultiVertexFitter::vertices().

96 {
97  return vertices ( trks );
98 }
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &, const reco::BeamSpot &) const
vector< TransientVertex > MultiVertexReconstructor::vertices ( const std::vector< reco::TransientTrack > &  ) const
virtual

Reconstruct vertices

Implements VertexReconstructor.

Definition at line 109 of file MultiVertexReconstructor.cc.

References gather_cfg::cout, mps_fire::i, theFitter, theOldReconstructor, tmp, verbose, VertexReconstructor::vertices(), and MultiVertexFitter::vertices().

111 {
112  /*
113  cout << "[MultiVertexReconstructor] input trks: ";
114  for ( vector< reco::TransientTrack >::const_iterator i=trks.begin();
115  i!=trks.end() ; ++i )
116  {
117  cout << i->id() << " ";
118  }
119  cout << endl;*/
120  vector < TransientVertex > tmp = theOldReconstructor->vertices ( trks );
121  if ( verbose() )
122  {
123  cout << "[MultiVertexReconstructor] non-freezing seeder found " << tmp.size()
124  << " vertices from " << trks.size() << " tracks." << endl;
125  }
126  vector < vector < TrackAndWeight > > rc = recover ( tmp, trks );
127  vector < CachingVertex<5> > cvts = theFitter.vertices ( rc );
128  vector < TransientVertex > ret;
129  for ( vector< CachingVertex<5> >::const_iterator i=cvts.begin();
130  i!=cvts.end() ; ++i )
131  {
132  ret.push_back ( *i );
133  };
134 
135  if ( verbose() )
136  {
137  cout << "[MultiVertexReconstructor] input " << tmp.size()
138  << " vertices, output " << ret.size() << " vertices."
139  << endl;
140  };
141  return ret;
142 }
std::vector< CachingVertex< 5 > > vertices(const std::vector< std::vector< reco::TransientTrack > > &, const std::vector< reco::TransientTrack > &primaries=std::vector< reco::TransientTrack >())
bool verbose
VertexReconstructor * theOldReconstructor
virtual std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &) const =0
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
vector< TransientVertex > MultiVertexReconstructor::vertices ( const std::vector< reco::TransientTrack > &  trks,
const std::vector< reco::TransientTrack > &  primaries 
) const

Definition at line 144 of file MultiVertexReconstructor.cc.

References gather_cfg::cout, mps_fire::i, theFitter, theOldReconstructor, tmp, pileupDistInMC::total, verbose, VertexReconstructor::vertices(), and MultiVertexFitter::vertices().

147 {
148  /*
149  cout << "[MultiVertexReconstructor] with " << primaries.size()
150  << " primaries!" << endl;
151  */
152 
153  map < reco::TransientTrack, bool > st;
154 
155  vector < reco::TransientTrack > total = trks;
156  for ( vector< reco::TransientTrack >::const_iterator i=trks.begin();
157  i!=trks.end() ; ++i )
158  {
159  st[(*i)]=true;
160  }
161 
162  // cout << "[MultiVertexReconstructor] FIXME dont just add up tracks. superpose" << endl;
163  for ( vector< reco::TransientTrack >::const_iterator i=primaries.begin();
164  i!=primaries.end() ; ++i )
165  {
166  if (!(st[(*i)]))
167  {
168  total.push_back ( *i );
169  }
170  }
171 
172  vector < TransientVertex > tmp = theOldReconstructor->vertices ( total );
173 
174  if ( verbose() )
175  {
176  cout << "[MultiVertexReconstructor] freezing seeder found " << tmp.size()
177  << " vertices from " << total.size() << " tracks." << endl;
178  }
179  vector < vector < TrackAndWeight > > rc = recover ( tmp, trks );
180  vector < CachingVertex<5> > cvts = theFitter.vertices ( rc, primaries );
181 
182  vector < TransientVertex > ret;
183  for ( vector< CachingVertex<5> >::const_iterator i=cvts.begin();
184  i!=cvts.end() ; ++i )
185  {
186  ret.push_back ( *i );
187  };
188  if ( verbose() )
189  {
190  cout << "[MultiVertexReconstructor] input " << tmp.size()
191  << " vertices, output " << ret.size() << " vertices."
192  << endl;
193  };
194  return ret;
195 }
std::vector< CachingVertex< 5 > > vertices(const std::vector< std::vector< reco::TransientTrack > > &, const std::vector< reco::TransientTrack > &primaries=std::vector< reco::TransientTrack >())
bool verbose
VertexReconstructor * theOldReconstructor
virtual std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &) const =0
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
vector< TransientVertex > MultiVertexReconstructor::vertices ( const std::vector< reco::TransientTrack > &  primaries,
const std::vector< reco::TransientTrack > &  tracks,
const reco::BeamSpot spot 
) const
virtual

Reconstruct vertices, but exploit the fact that you know that some tracks cannot come from a secondary vertex. primaries Tracks that cannot come from a secondary vertex (but can, in principle, be non-primaries, also). tracks These are the tracks that are of unknown origin. These tracks are subjected to pattern recognition. spot A beamspot constraint is mandatory in this method.

Reimplemented from VertexReconstructor.

Definition at line 100 of file MultiVertexReconstructor.cc.

References vertices().

104 {
105  return vertices ( trks, primaries );
106 }
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &, const reco::BeamSpot &) const

Member Data Documentation

MultiVertexFitter MultiVertexReconstructor::theFitter
mutableprivate

Definition at line 37 of file MultiVertexReconstructor.h.

Referenced by vertices().

VertexReconstructor* MultiVertexReconstructor::theOldReconstructor
private

Definition at line 36 of file MultiVertexReconstructor.h.

Referenced by reconstructor(), vertices(), and ~MultiVertexReconstructor().