CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFDisplacedVertexFinder.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFTracking_PFDisplacedVertexFinder_h
2 #define RecoParticleFlow_PFTracking_PFDisplacedVertexFinder_h
3 
6 
13 
16 
18 
20 
21 
23 
28 class TrackingGeometry;
29 class TrackerGeometry;
30 class MagneticField;
31 
33 
34  public:
35 
37 
39 
41 
42  typedef reco::PFDisplacedVertexSeedCollection::iterator IDVS;
43  typedef reco::PFDisplacedVertexCollection::iterator IDV;
44 
45  typedef std::pair <unsigned int, unsigned int> PFTrackHitInfo;
46  typedef std::pair <PFTrackHitInfo, PFTrackHitInfo> PFTrackHitFullInfo;
47 
49  enum FitterType {
54  };
55 
56 
58 
60  void setParameters(double transvSize, double longSize,
61  double primaryVertexCut, double tobCut,
62  double tecCut, double minAdaptWeight, bool switchOff2TrackVertex) {
63  transvSize_ = transvSize;
64  longSize_ = longSize;
65  primaryVertexCut_ = primaryVertexCut;
66  tobCut_ = tobCut;
67  tecCut_ = tecCut;
68  minAdaptWeight_ = minAdaptWeight;
69  switchOff2TrackVertex_ = switchOff2TrackVertex;
70  }
71 
73  void setDebug( bool debug ) {debug_ = debug;}
74 
76  void setEdmParameters( const MagneticField* magField,
78  edm::ESHandle<TrackerGeometry> tkerGeomHandle){
79  magField_ = magField;
80  globTkGeomHandle_ = globTkGeomHandle;
81  tkerGeomHandle_ = tkerGeomHandle;
82  }
83 
86  }
87 
90  }
91 
93  edm::Handle< reco::BeamSpot > beamSpotHandle){
94  helper_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
95  }
96 
98  sigmacut_ = ps.getParameter<double>("sigmacut");
99  t_ini_ = ps.getParameter<double>("Tini");
100  ratio_ = ps.getParameter<double>("ratio");
101  }
102 
105 
106 
108  std::auto_ptr< reco::PFDisplacedVertexCollection > transferDisplacedVertices() {return displacedVertices_;}
109 
110  const std::auto_ptr< reco::PFDisplacedVertexCollection >& displacedVertices() const {return displacedVertices_;}
111 
112 
113 
115 
116  void findDisplacedVertices();
117 
118 
119  private:
120 
122 
125 
127  void mergeSeeds(reco::PFDisplacedVertexSeedCollection&, std::vector<bool>& bLocked);
128 
131 
133  void selectAndLabelVertices(reco::PFDisplacedVertexCollection&, std::vector <bool>&);
134 
136 
138 
140 
141  double getTransvDiff(const GlobalPoint&, const GlobalPoint&) const;
142  double getLongDiff(const GlobalPoint&, const GlobalPoint&) const;
143  double getLongProj(const GlobalPoint&, const GlobalVector&) const;
144 
146 
147  unsigned commonTracks(const reco::PFDisplacedVertex&, const reco::PFDisplacedVertex&) const;
148 
149  friend std::ostream& operator<<(std::ostream&, const PFDisplacedVertexFinder&);
150 
151 
153 
155  std::auto_ptr< reco::PFDisplacedVertexCollection > displacedVertices_;
156 
158 
160 
161  double transvSize_;
162  double longSize_;
164  double tobCut_;
165  double tecCut_;
167 
169 
171 
172  double sigmacut_; //= 6;
173  double t_ini_; //= 256.;
174  double ratio_; //= 0.25;
175 
176 
178  bool debug_;
179 
182 
185 
188 
189 
191 
193 
194 };
195 
196 #endif
197 
198 
double getTransvDiff(const GlobalPoint &, const GlobalPoint &) const
T getParameter(std::string const &) const
void setVertexIdentifier(const edm::ParameterSet &ps)
Set Vertex identifier parameters.
std::vector< PFDisplacedVertex > PFDisplacedVertexCollection
collection of PFDisplacedVertex objects
std::vector< PFDisplacedVertexCandidate > PFDisplacedVertexCandidateCollection
collection of PFDisplacedVertexCandidate objects
void setTracksSelector(const edm::ParameterSet &ps)
Set Tracks selector parameters.
std::pair< unsigned int, unsigned int > PFTrackHitInfo
A block of tracks linked together.
reco::PFDisplacedVertexSeedCollection::iterator IDVS
-----— Useful Types -----— ///
void setEdmParameters(const MagneticField *magField, edm::ESHandle< GlobalTrackingGeometry > globTkGeomHandle, edm::ESHandle< TrackerGeometry > tkerGeomHandle)
Sets parameters for track extrapolation and hits study.
std::auto_ptr< reco::PFDisplacedVertexCollection > displacedVertices_
edm::ESHandle< GlobalTrackingGeometry > globTkGeomHandle_
Tracker geometry for discerning hit positions.
bool fitVertexFromSeed(const reco::PFDisplacedVertexSeed &, reco::PFDisplacedVertex &)
Fit one by one the vertex points with associated tracks to get displaced vertices.
bool rejectAndLabelVertex(reco::PFDisplacedVertex &dv)
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
Update the primary vertex information.
void findDisplacedVertices()
-----— Main function which find vertices -----— ///
bool debug_
If true, debug printouts activated.
std::pair< PFTrackHitInfo, PFTrackHitInfo > PFTrackHitFullInfo
unsigned commonTracks(const reco::PFDisplacedVertex &, const reco::PFDisplacedVertex &) const
void mergeSeeds(reco::PFDisplacedVertexSeedCollection &, std::vector< bool > &bLocked)
Sometimes two vertex candidates can be quite close and coming from the same vertex.
edm::ESHandle< TrackerGeometry > tkerGeomHandle_
doc?
void setTracksSelector(const edm::ParameterSet &ps)
std::vector< PFDisplacedVertexSeed > PFDisplacedVertexSeedCollection
collection of PFDisplacedVertexSeed objects
reco::PFDisplacedVertexCandidateCollection const * displacedVertexCandidates_
-----— Members -----— ///
void setDebug(bool debug)
Sets debug printout flag.
void findSeedsFromCandidate(const reco::PFDisplacedVertexCandidate &, reco::PFDisplacedVertexSeedCollection &)
--—— Different steps of the finder algorithm --—— ///
Displaced Vertex Finder Algorithm.
void selectAndLabelVertices(reco::PFDisplacedVertexCollection &, std::vector< bool > &)
Remove potentially fakes displaced vertices.
std::auto_ptr< reco::PFDisplacedVertexCollection > transferDisplacedVertices()
const MagneticField * magField_
to be able to extrapolate tracks f
friend std::ostream & operator<<(std::ostream &, const PFDisplacedVertexFinder &)
double getLongProj(const GlobalPoint &, const GlobalVector &) const
void setAVFParameters(const edm::ParameterSet &ps)
void setInput(const edm::Handle< reco::PFDisplacedVertexCandidateCollection > &)
Set input collections of tracks.
const std::auto_ptr< reco::PFDisplacedVertexCollection > & displacedVertices() const
double transvSize_
--—— Parameters --—— ///
Block of elements.
#define debug
Definition: HDRShower.cc:19
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
double sigmacut_
Adaptive Vertex Fitter parameters.
reco::PFDisplacedVertexCollection::iterator IDV
void setParameters(double transvSize, double longSize, double primaryVertexCut, double tobCut, double tecCut, double minAdaptWeight, bool switchOff2TrackVertex)
--—— Set different algo parameters --—— ///
double getLongDiff(const GlobalPoint &, const GlobalPoint &) const
void setVertexIdentifier(const edm::ParameterSet &ps)
bool isCloseTo(const reco::PFDisplacedVertexSeed &, const reco::PFDisplacedVertexSeed &) const
-----— Tools -----— ///
reco::PFDisplacedVertex::VertexTrackType getVertexTrackType(PFTrackHitFullInfo &) const
PFDisplacedVertexHelper helper_
PFCheckHitPatter.