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 Member Functions | Private Attributes | Static Private Attributes
ConfigurableTertiaryTracksVertexFinder Class Reference

#include <ConfigurableTertiaryTracksVertexFinder.h>

Inheritance diagram for ConfigurableTertiaryTracksVertexFinder:
VertexReconstructor

Public Member Functions

virtual
ConfigurableTertiaryTracksVertexFinder
clone () const
 
 ConfigurableTertiaryTracksVertexFinder (const VertexFitter< 5 > *vf, const VertexUpdator< 5 > *vu, const VertexTrackCompatibilityEstimator< 5 > *ve)
 
AddTvTrack::TrackInfoVector getTrackInfo ()
 
virtual std::vector
< TransientVertex
vertices (const std::vector< reco::TransientTrack > &) const
 
virtual std::vector
< TransientVertex
vertices (const std::vector< reco::TransientTrack > &, const TransientVertex &pv) const
 
virtual ~ConfigurableTertiaryTracksVertexFinder ()
 
- Public Member Functions inherited from VertexReconstructor
 VertexReconstructor ()
 
virtual std::vector
< TransientVertex
vertices (const std::vector< reco::TransientTrack > &t, const reco::BeamSpot &) const
 
virtual std::vector
< TransientVertex
vertices (const std::vector< reco::TransientTrack > &primaries, const std::vector< reco::TransientTrack > &tracks, const reco::BeamSpot &spot) const
 
virtual ~VertexReconstructor ()
 

Private Member Functions

std::vector< TransientVertexreconstruct (const std::vector< reco::TransientTrack > &tracks, const TransientVertex &pv) const
 

Private Attributes

Flight2DSvFiltertheFlight2DSvFilter
 
double theK0sMassWindow
 
double theMaxDist2D
 
double theMaxInPvFrac
 
double theMaxSigOnDistTrackToB
 
double theMaxVtxMass
 
double theMinDist2D
 
double theMinSign2D
 
double theMinTrackPt
 
int theMinTracks
 
ConfigurableTrimmedVertexFindertheTKVF
 
AddTvTrack::TrackInfoVector theTrackInfoVector
 
V0SvFiltertheV0SvFilter
 

Static Private Attributes

static const bool debug = false
 

Detailed Description

Definition at line 21 of file ConfigurableTertiaryTracksVertexFinder.h.

Constructor & Destructor Documentation

ConfigurableTertiaryTracksVertexFinder::ConfigurableTertiaryTracksVertexFinder ( const VertexFitter< 5 > *  vf,
const VertexUpdator< 5 > *  vu,
const VertexTrackCompatibilityEstimator< 5 > *  ve 
)

Definition at line 16 of file ConfigurableTertiaryTracksVertexFinder.cc.

Referenced by clone().

19 {
21 
22  theMinTrackPt = 1.0;
23  theMaxVtxMass = 6.5;
24  theMaxSigOnDistTrackToB = 3.0; // this is being overwritten to 10 in AddTvTtrack (why?)
25 
26  theMaxInPvFrac = 0.65;
27 
28  // set up V0SvFilter
29  theK0sMassWindow = 0.05; // mass window around K0s
31 
32  // set up Flight2DSvFilter
33  theMaxDist2D = 2.5; // max transv. dist to beam line
34  theMinDist2D = 0.01; // min transv. dist to beam line
35  theMinSign2D = 3.0; // min transverse distance significance
36  theMinTracks = 2; // min number of tracks
39 
40  // thePrimaryVertex = new TransientVertex;
41  // FIXME this is incomplete!? -> get real primary vertex!
42 
43  //theNewTrackInfoVector = new NewTrackInfoVector;
44 
45 }
ConfigurableTertiaryTracksVertexFinder::~ConfigurableTertiaryTracksVertexFinder ( )
virtual

Member Function Documentation

virtual ConfigurableTertiaryTracksVertexFinder* ConfigurableTertiaryTracksVertexFinder::clone ( void  ) const
inlinevirtual

Implements VertexReconstructor.

Definition at line 37 of file ConfigurableTertiaryTracksVertexFinder.h.

References ConfigurableTertiaryTracksVertexFinder().

37  {
39  }
ConfigurableTertiaryTracksVertexFinder(const VertexFitter< 5 > *vf, const VertexUpdator< 5 > *vu, const VertexTrackCompatibilityEstimator< 5 > *ve)
AddTvTrack::TrackInfoVector ConfigurableTertiaryTracksVertexFinder::getTrackInfo ( )
inline
std::vector< TransientVertex > ConfigurableTertiaryTracksVertexFinder::reconstruct ( const std::vector< reco::TransientTrack > &  tracks,
const TransientVertex pv 
) const
private

Definition at line 87 of file ConfigurableTertiaryTracksVertexFinder.cc.

References gather_cfg::cout, debug, TauTagTools::filteredTracks(), AddTvTrack::getSecondaryVertices(), AddTvTrack::getTrackInfo(), TransientTrackInVertices::isInVertex(), TransientVertex::isValid(), and edm::RefVector< C, T, F >::push_back().

89 {
90  // get primary vertices;
91  std::vector<TransientVertex> primaryVertices;
92  if(pv.isValid()) { primaryVertices.push_back(pv);
93  if (debug) cout <<"[TTVF] add PV ...\n";
94  }
95 
96  VertexMass theVertexMass;
97 
98  //filter tracks in pt
99  std::vector<reco::TransientTrack> filteredTracks;
100  for (std::vector<reco::TransientTrack>::const_iterator it=tracks.begin();
101  it!=tracks.end();it++)
102  if ((*it).impactPointState().globalMomentum().perp() > theMinTrackPt)
103  filteredTracks.push_back(*it);
104 
105  if (debug) cout <<"[TTVF] tracks: " << filteredTracks.size() <<endl;
106 
107  // get vertices
108  std::vector<TransientVertex> vertices;
109  if (filteredTracks.size()>1) vertices = theTKVF->vertices(filteredTracks);
110 
111  if (debug) cout <<"[TTVF] found secondary vertices with TKVF: "<<vertices.size()<<endl;
112 
113  std::vector<TransientVertex> secondaryVertices;
114 
115  for(std::vector<TransientVertex>::const_iterator ivx=vertices.begin();
116  ivx!=vertices.end(); ivx++) {
117  TransientVertex vtx=*ivx;
118 
119  double mass=theVertexMass(vtx);
120  if (debug) cout <<"[TTVF] new svx: mass: "<<mass<<endl;
121 
122  if ((*theV0SvFilter)(vtx)) {
123  if (debug) cout <<"[TTVF] survived V0SvFilter\n";
124  if((*theFlight2DSvFilter)(vtx)) {
125  if (debug) cout <<"[TTVF] survived 2DSvFilter\n";
126  if (mass<theMaxVtxMass) {
127  if (!primaryVertices.empty()) {
128  PvSvFilter thePvSvFilter(theMaxInPvFrac,primaryVertices[0]);
129  if (thePvSvFilter(vtx)) secondaryVertices.push_back(vtx);
130  else { if (debug) cout <<"[TTVF] failed PvSvFilter\n";}
131  }
132  else secondaryVertices.push_back(vtx);
133  }
134  else {if(debug)cout<<"[TTVF] failed mass cut\n";}
135  }
136  }
137 
138  }
139 
140  if (debug) cout<<"[TTVF] remaining svx: "<<secondaryVertices.size()<<endl;
141 
142  if (primaryVertices.empty() || secondaryVertices.empty())
143  return secondaryVertices; // unable to reconstruct b-flight-trajectory
144 
145  if (debug) cout<<"[TTVF] still here ...\n";
146 
147  // find tracks not used in primaryVertex or in vertices
148  vector<TransientTrack> unusedTracks;
149  for( vector<TransientTrack>::const_iterator itT = filteredTracks.begin();
150  itT != filteredTracks.end(); itT++ )
151  if( (!TransientTrackInVertices::isInVertex((*itT),primaryVertices))
152  && (!TransientTrackInVertices::isInVertex((*itT),vertices)) )
153  unusedTracks.push_back( *itT );
154  if (debug) cout <<"[TTVF] remaining tracks: "<<unusedTracks.size()<<endl;
155 
156  // now add tracks to the SV candidate
157  AddTvTrack MyAddTVTrack( &primaryVertices, &secondaryVertices,
159  vector<TransientVertex> newVertices =
160  MyAddTVTrack.getSecondaryVertices(unusedTracks);
161 
162  // for tdr studies
163  theTrackInfoVector = MyAddTVTrack.getTrackInfo();
164 
165  //std::vector<pair<reco::TransientTrack,double> > theTrackInfo;
166  //std::vector<pair<reco::TransientTrack,double* > > theTrackInfo2;
167  //theTrackInfo = MyAddTVTrack.getTrackInfo();
168  //theTrackInfo2= MyAddTVTrack.getTrackInfo2();
169 
170  //TrackInfo = theTrackInfo;
171  //TrackInfo2= theTrackInfo2;
172 
173  if (debug) cout <<"[TTVF] vertices found: "<<newVertices.size()<<endl;
174  return newVertices;
175 
176 }
reco::TrackRefVector filteredTracks(reco::TrackRefVector theInitialTracks, double tkminPt, int tkminPixelHitsn, int tkminTrackerHitsn, double tkmaxipt, double tkmaxChi2, reco::Vertex pV)
Definition: TauTagTools.cc:77
tuple tracks
Definition: testEve_cfg.py:39
virtual std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &) const
virtual std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &tracks) const
static bool isInVertex(const reco::TransientTrack &aTrack, const TransientVertex &aVertex)
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
tuple cout
Definition: gather_cfg.py:121
bool isValid() const
std::vector< TransientVertex > ConfigurableTertiaryTracksVertexFinder::vertices ( const std::vector< reco::TransientTrack > &  ) const
virtual

Reconstruct vertices

Implements VertexReconstructor.

Definition at line 74 of file ConfigurableTertiaryTracksVertexFinder.cc.

References gather_cfg::cout, and debug.

Referenced by TertiaryTracksVertexFinder::vertices().

76 {
77  // there is no PV
79  TransientVertex dummyVertex;
80  if (debug) cout <<"[TTVF] calling with a dummy PV ...\n";
81  return this->reconstruct(tracks,dummyVertex);
82 
83 }
std::vector< TransientVertex > reconstruct(const std::vector< reco::TransientTrack > &tracks, const TransientVertex &pv) const
tuple tracks
Definition: testEve_cfg.py:39
tuple cout
Definition: gather_cfg.py:121
std::vector< TransientVertex > ConfigurableTertiaryTracksVertexFinder::vertices ( const std::vector< reco::TransientTrack > &  tracks,
const TransientVertex pv 
) const
virtual

Definition at line 59 of file ConfigurableTertiaryTracksVertexFinder.cc.

References gather_cfg::cout, debug, and TransientVertex::isValid().

61 {
62  // there is a PV
63  if (pv.isValid()) {
65  if (debug) cout <<"[TTVF] calling with a real PV ...\n";
66  return this->reconstruct(tracks,pv);
67  }
68  else return this->vertices(tracks);
69 
70 }
std::vector< TransientVertex > reconstruct(const std::vector< reco::TransientTrack > &tracks, const TransientVertex &pv) const
void setPrimaryVertex(const TransientVertex &)
tuple tracks
Definition: testEve_cfg.py:39
virtual std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &) const
tuple cout
Definition: gather_cfg.py:121
bool isValid() const

Member Data Documentation

const bool ConfigurableTertiaryTracksVertexFinder::debug = false
staticprivate

Definition at line 62 of file ConfigurableTertiaryTracksVertexFinder.h.

Flight2DSvFilter* ConfigurableTertiaryTracksVertexFinder::theFlight2DSvFilter
private

Definition at line 66 of file ConfigurableTertiaryTracksVertexFinder.h.

double ConfigurableTertiaryTracksVertexFinder::theK0sMassWindow
private

Definition at line 69 of file ConfigurableTertiaryTracksVertexFinder.h.

double ConfigurableTertiaryTracksVertexFinder::theMaxDist2D
private

Definition at line 74 of file ConfigurableTertiaryTracksVertexFinder.h.

double ConfigurableTertiaryTracksVertexFinder::theMaxInPvFrac
private

Definition at line 71 of file ConfigurableTertiaryTracksVertexFinder.h.

double ConfigurableTertiaryTracksVertexFinder::theMaxSigOnDistTrackToB
private

Definition at line 70 of file ConfigurableTertiaryTracksVertexFinder.h.

double ConfigurableTertiaryTracksVertexFinder::theMaxVtxMass
private

Definition at line 68 of file ConfigurableTertiaryTracksVertexFinder.h.

double ConfigurableTertiaryTracksVertexFinder::theMinDist2D
private

Definition at line 74 of file ConfigurableTertiaryTracksVertexFinder.h.

double ConfigurableTertiaryTracksVertexFinder::theMinSign2D
private

Definition at line 74 of file ConfigurableTertiaryTracksVertexFinder.h.

double ConfigurableTertiaryTracksVertexFinder::theMinTrackPt
private

Definition at line 68 of file ConfigurableTertiaryTracksVertexFinder.h.

int ConfigurableTertiaryTracksVertexFinder::theMinTracks
private

Definition at line 75 of file ConfigurableTertiaryTracksVertexFinder.h.

ConfigurableTrimmedVertexFinder* ConfigurableTertiaryTracksVertexFinder::theTKVF
private

Definition at line 64 of file ConfigurableTertiaryTracksVertexFinder.h.

AddTvTrack::TrackInfoVector ConfigurableTertiaryTracksVertexFinder::theTrackInfoVector
mutableprivate

Definition at line 84 of file ConfigurableTertiaryTracksVertexFinder.h.

Referenced by getTrackInfo().

V0SvFilter* ConfigurableTertiaryTracksVertexFinder::theV0SvFilter
private

Definition at line 65 of file ConfigurableTertiaryTracksVertexFinder.h.