CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 68 of file MultiVertexReconstructor.cc.

Referenced by clone().

MultiVertexReconstructor::MultiVertexReconstructor ( const MultiVertexReconstructor o)

Definition at line 85 of file MultiVertexReconstructor.cc.

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

Definition at line 75 of file MultiVertexReconstructor.cc.

References theOldReconstructor.

76 {
77  delete theOldReconstructor;
78 }
VertexReconstructor * theOldReconstructor

Member Function Documentation

MultiVertexReconstructor * MultiVertexReconstructor::clone ( void  ) const
virtual

Implements VertexReconstructor.

Definition at line 80 of file MultiVertexReconstructor.cc.

References MultiVertexReconstructor().

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

Definition at line 195 of file MultiVertexReconstructor.cc.

References theOldReconstructor.

196 {
197  return theOldReconstructor;
198 }
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 91 of file MultiVertexReconstructor.cc.

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

94 {
95  return vertices ( trks );
96 }
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 107 of file MultiVertexReconstructor.cc.

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

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

Definition at line 142 of file MultiVertexReconstructor.cc.

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

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

References vertices().

102 {
103  return vertices ( trks, primaries );
104 }
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().