CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
PFDisplacedVertexCandidateFinder Class Reference

#include <PFDisplacedVertexCandidateFinder.h>

Public Types

typedef reco::PFDisplacedVertexCandidateCollection::const_iterator IBC
 
typedef std::list< reco::TrackBaseRef >::iterator IE
 
typedef std::list< reco::TrackBaseRef >::const_iterator IEC
 
typedef std::vector< bool > Mask
 Mask used to spot if a track is free or not. More...
 

Public Member Functions

void findDisplacedVertexCandidates ()
 -----— Main function which find vertices -----— /// More...
 
 PFDisplacedVertexCandidateFinder ()
 
void setDebug (bool debug)
 sets debug printout flag More...
 
void setInput (const edm::Handle< reco::TrackCollection > &trackh, const MagneticField *magField)
 
void setParameters (double dcaCut, double primaryVertexCut, double dcaPInnerHitCut, const edm::ParameterSet &ps_trk)
 ---—— Set different algo parameters —— /// More...
 
void setPrimaryVertex (edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
 
std::unique_ptr< reco::PFDisplacedVertexCandidateCollectiontransferVertexCandidates ()
 
const std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > & vertexCandidates () const
 
 ~PFDisplacedVertexCandidateFinder ()
 

Private Member Functions

IE associate (IE next, IE last, reco::PFDisplacedVertexCandidate &tempVertexCandidate)
 --—— Different steps of the finder algorithm --—— /// More...
 
GlobalTrajectoryParameters getGlobalTrajectoryParameters (const reco::Track *) const
 --—— TOOLS --—— // More...
 
bool goodPtResolution (const reco::TrackBaseRef &trackref) const
 Quality Criterion on the Pt resolution to select a Track. More...
 
bool isSelected (const reco::TrackBaseRef &trackref)
 
void link (const reco::TrackBaseRef &el1, const reco::TrackBaseRef &el2, double &dist, GlobalPoint &P, reco::PFDisplacedVertexCandidate::VertexLinkTest &linktest)
 Check whether 2 elements are linked and fill the link parameters. More...
 
void packLinks (reco::PFDisplacedVertexCandidate &vertexCandidate)
 

Private Attributes

double dcaCut_
 –— Algo parameters for the vertex finder -— /// More...
 
double dcaPInnerHitCut2_
 Maximum distance between the DCA Point and the inner hit of the track. More...
 
bool debug_
 if true, debug printouts activated More...
 
double dxy_
 
std::list< reco::TrackBaseRefeventTracks_
 The track refs. More...
 
std::vector< GlobalTrajectoryParameterseventTrackTrajectories_
 
const MagneticFieldmagField_
 
double nChi2_max_
 
double primaryVertexCut2_
 Do not reconstruct vertices wich are too close to the beam pipe. More...
 
double pt_min_
 
double pt_min_prim_
 
math::XYZPoint pvtx_
 
TwoTrackMinimumDistance theMinimum_
 
Mask trackMask_
 
std::unique_ptr< reco::PFDisplacedVertexCandidateCollectionvertexCandidates_
 -----— Members -----— /// More...
 
unsigned vertexCandidatesSize_
 

Friends

std::ostream & operator<< (std::ostream &, const PFDisplacedVertexCandidateFinder &)
 

Detailed Description

Definition at line 24 of file PFDisplacedVertexCandidateFinder.h.

Member Typedef Documentation

typedef reco::PFDisplacedVertexCandidateCollection::const_iterator PFDisplacedVertexCandidateFinder::IBC

Definition at line 35 of file PFDisplacedVertexCandidateFinder.h.

Definition at line 33 of file PFDisplacedVertexCandidateFinder.h.

Definition at line 34 of file PFDisplacedVertexCandidateFinder.h.

typedef std::vector<bool> PFDisplacedVertexCandidateFinder::Mask

Mask used to spot if a track is free or not.

Definition at line 31 of file PFDisplacedVertexCandidateFinder.h.

Constructor & Destructor Documentation

PFDisplacedVertexCandidateFinder::PFDisplacedVertexCandidateFinder ( )

Definition at line 15 of file PFDisplacedVertexCandidateFinder.cc.

17  dcaCut_(1000),
18  primaryVertexCut2_(0.0),
19  dcaPInnerHitCut2_(1000.0),
22  debug_(false),
23  magField_(nullptr) {}
std::vector< PFDisplacedVertexCandidate > PFDisplacedVertexCandidateCollection
collection of PFDisplacedVertexCandidate objects
double dcaCut_
–— Algo parameters for the vertex finder -— ///
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > vertexCandidates_
-----— Members -----— ///
double primaryVertexCut2_
Do not reconstruct vertices wich are too close to the beam pipe.
double dcaPInnerHitCut2_
Maximum distance between the DCA Point and the inner hit of the track.
bool debug_
if true, debug printouts activated
PFDisplacedVertexCandidateFinder::~PFDisplacedVertexCandidateFinder ( )

Definition at line 25 of file PFDisplacedVertexCandidateFinder.cc.

References gather_cfg::cout, debug_, and eventTracks_.

25  {
26 #ifdef PFLOW_DEBUG
27  if (debug_)
28  cout << "~PFDisplacedVertexCandidateFinder - number of remaining elements: " << eventTracks_.size() << endl;
29 #endif
30 }
std::list< reco::TrackBaseRef > eventTracks_
The track refs.
bool debug_
if true, debug printouts activated

Member Function Documentation

PFDisplacedVertexCandidateFinder::IE PFDisplacedVertexCandidateFinder::associate ( IE  next,
IE  last,
reco::PFDisplacedVertexCandidate tempVertexCandidate 
)
private

--—— Different steps of the finder algorithm --—— ///

Recursive procedure to associate tracks together

Definition at line 110 of file PFDisplacedVertexCandidateFinder.cc.

References reco::PFDisplacedVertexCandidate::addElement(), gather_cfg::cout, debug_, eventTracks_, mps_fire::i, link(), GetRecoTauVFromDQM_MC_cff::next, trackMask_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by findDisplacedVertexCandidates(), and vertexCandidates().

111  {
112 #ifdef PFLOW_DEBUG
113  if (debug_)
114  cout << "== Start the association procedure ==" << endl;
115 #endif
116 
117  if (last != eventTracks_.end()) {
118  double dist = -1;
119  GlobalPoint P(0, 0, 0);
121  link((*last), (*next), dist, P, linktest);
122 
123  if (dist < -0.5) {
124 #ifdef PFLOW_DEBUG
125  if (debug_)
126  cout << "link failed" << endl;
127 #endif
128  return ++next; // association failed
129  } else {
130  // add next element to the current pflowblock
131  tempVertexCandidate.addElement((*next));
132  trackMask_[(*next).key()] = false;
133 #ifdef PFLOW_DEBUG
134  if (debug_)
135  cout << "link parameters "
136  << " *next = " << (*next).key() << " *last = " << (*last).key() << " dist = " << dist
137  << " P.x = " << P.x() << " P.y = " << P.y() << " P.z = " << P.z() << endl;
138 #endif
139  }
140  } else {
141  // add next element to this eflowblock
142 #ifdef PFLOW_DEBUG
143  if (debug_)
144  cout << "adding to block element " << (*next).key() << endl;
145 #endif
146  tempVertexCandidate.addElement((*next));
147  trackMask_[(*next).key()] = false;
148  }
149 
150  // recursive call: associate next and other unused elements
151 #ifdef PFLOW_DEBUG
152  if (debug_) {
153  for (unsigned i = 0; i < trackMask_.size(); i++)
154  cout << " Mask[" << i << "] = " << trackMask_[i];
155  cout << "" << endl;
156  }
157 #endif
158 
159  for (IE ie = eventTracks_.begin(); ie != eventTracks_.end();) {
160  if (ie == last || ie == next) {
161  ++ie;
162  continue;
163  }
164 
165  // *ie already included to a block
166  if (!trackMask_[(*ie).key()]) {
167  ++ie;
168  continue;
169  }
170 
171 #ifdef PFLOW_DEBUG
172  if (debug_)
173  cout << "calling associate " << (*next).key() << " & " << (*ie).key() << endl;
174 #endif
175  ie = associate(next, ie, tempVertexCandidate);
176  }
177 
178 #ifdef PFLOW_DEBUG
179  if (debug_) {
180  cout << "**** removing element " << endl;
181  }
182 #endif
183 
184  IE iteratorToNextFreeElement = eventTracks_.erase(next);
185 
186 #ifdef PFLOW_DEBUG
187  if (debug_)
188  cout << "== End the association procedure ==" << endl;
189 #endif
190 
191  return iteratorToNextFreeElement;
192 }
void addElement(const TrackBaseRef)
add a track Reference to the current Candidate
void link(const reco::TrackBaseRef &el1, const reco::TrackBaseRef &el2, double &dist, GlobalPoint &P, reco::PFDisplacedVertexCandidate::VertexLinkTest &linktest)
Check whether 2 elements are linked and fill the link parameters.
IE associate(IE next, IE last, reco::PFDisplacedVertexCandidate &tempVertexCandidate)
--—— Different steps of the finder algorithm --—— ///
std::list< reco::TrackBaseRef > eventTracks_
The track refs.
std::list< reco::TrackBaseRef >::iterator IE
std::pair< OmniClusterRef, TrackingParticleRef > P
bool debug_
if true, debug printouts activated
void PFDisplacedVertexCandidateFinder::findDisplacedVertexCandidates ( )

-----— Main function which find vertices -----— ///

Definition at line 80 of file PFDisplacedVertexCandidateFinder.cc.

References associate(), gather_cfg::cout, debug_, eventTracks_, reco::PFDisplacedVertexCandidate::isValid(), packLinks(), vertexCandidates_, and vertexCandidatesSize_.

Referenced by vertexCandidates().

80  {
81  if (debug_)
82  cout << "========= Start Finding Displaced Vertex Candidates =========" << endl;
83 
84  // The vertexCandidates have not been passed to the event, and need to be cleared
85  if (vertexCandidates_.get())
86  vertexCandidates_->clear();
87  else
89 
91  for (IE ie = eventTracks_.begin(); ie != eventTracks_.end();) {
92  // Run the recursive procedure to find all tracks link together
93  // In one blob called Candidate
94 
95  PFDisplacedVertexCandidate tempVertexCandidate;
96 
97  ie = associate(eventTracks_.end(), ie, tempVertexCandidate);
98 
99  // Build remaining links in current block
100  if (tempVertexCandidate.isValid()) {
101  packLinks(tempVertexCandidate);
102  vertexCandidates_->push_back(tempVertexCandidate);
103  }
104  }
105 
106  if (debug_)
107  cout << "========= End Finding Displaced Vertex Candidates =========" << endl;
108 }
std::vector< PFDisplacedVertexCandidate > PFDisplacedVertexCandidateCollection
collection of PFDisplacedVertexCandidate objects
A block of tracks linked together.
IE associate(IE next, IE last, reco::PFDisplacedVertexCandidate &tempVertexCandidate)
--—— Different steps of the finder algorithm --—— ///
std::list< reco::TrackBaseRef > eventTracks_
The track refs.
std::list< reco::TrackBaseRef >::iterator IE
bool isValid() const
A Vertex Candidate is valid if it has at least two tracks.
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > vertexCandidates_
-----— Members -----— ///
void packLinks(reco::PFDisplacedVertexCandidate &vertexCandidate)
bool debug_
if true, debug printouts activated
GlobalTrajectoryParameters PFDisplacedVertexCandidateFinder::getGlobalTrajectoryParameters ( const reco::Track track) const
private

--—— TOOLS --—— //

Allows to calculate the helix aproximation for a given track which may be then extrapolated to any point.

Definition at line 309 of file PFDisplacedVertexCandidateFinder.cc.

References reco::TrackBase::charge(), magField_, reco::TrackBase::momentum(), position, reco::TrackBase::vx(), reco::TrackBase::vy(), and reco::TrackBase::vz().

Referenced by setInput(), and vertexCandidates().

309  {
310  const GlobalPoint position(track->vx(), track->vy(), track->vz());
311 
312  const GlobalVector momentum(track->momentum().x(), track->momentum().y(), track->momentum().z());
313 
314  GlobalTrajectoryParameters gtp(position, momentum, track->charge(), magField_);
315 
316  return gtp;
317 }
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:629
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:626
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:623
static int position[264][3]
Definition: ReadPGInfo.cc:289
int charge() const
track electric charge
Definition: TrackBase.h:575
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:620
bool PFDisplacedVertexCandidateFinder::goodPtResolution ( const reco::TrackBaseRef trackref) const
private

Quality Criterion on the Pt resolution to select a Track.

Definition at line 320 of file PFDisplacedVertexCandidateFinder.cc.

References gather_cfg::cout, debug_, PVValHelper::dxy, reco::TrackBase::dxy(), dxy_, nChi2_max_, reco::TrackBase::normalizedChi2(), DiDispStaMuonMonitor_cfi::pt, reco::TrackBase::pt(), pt_min_, pt_min_prim_, reco::TrackBase::ptError(), and pvtx_.

Referenced by isSelected(), and vertexCandidates().

320  {
321  double nChi2 = trackref->normalizedChi2();
322  double pt = trackref->pt();
323  double dpt = trackref->ptError();
324  double dxy = trackref->dxy(pvtx_);
325 
326  double pt_error = dpt / pt * 100;
327 
328  if (debug_)
329  cout << " PFDisplacedVertexFinder: PFrecTrack->Track Pt= " << pt << " dPt/Pt = " << pt_error
330  << "% nChi2 = " << nChi2 << endl;
331  if (nChi2 > nChi2_max_ || pt < pt_min_) {
332  if (debug_)
333  cout << " PFBlockAlgo: skip badly measured or low pt track"
334  << " nChi2_cut = " << 5 << " pt_cut = " << 0.2 << endl;
335  return false;
336  }
337  // cout << "dxy = " << dxy << endl;
338  if (fabs(dxy) < dxy_ && pt < pt_min_prim_)
339  return false;
340  // if (fabs(dxy) < 0.2 && pt < 0.8) return false;
341 
342  return true;
343 }
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:572
double pt() const
track transverse momentum
Definition: TrackBase.h:602
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:696
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:587
bool debug_
if true, debug printouts activated
bool PFDisplacedVertexCandidateFinder::isSelected ( const reco::TrackBaseRef trackref)
inlineprivate

A function which gather the information if a track is available for vertexing

Definition at line 101 of file PFDisplacedVertexCandidateFinder.h.

References goodPtResolution(), and operator<<.

Referenced by setInput().

101 { return goodPtResolution(trackref); }
bool goodPtResolution(const reco::TrackBaseRef &trackref) const
Quality Criterion on the Pt resolution to select a Track.
void PFDisplacedVertexCandidateFinder::link ( const reco::TrackBaseRef el1,
const reco::TrackBaseRef el2,
double &  dist,
GlobalPoint P,
reco::PFDisplacedVertexCandidate::VertexLinkTest linktest 
)
private

Check whether 2 elements are linked and fill the link parameters.

Definition at line 194 of file PFDisplacedVertexCandidateFinder.cc.

References TwoTrackMinimumDistance::calculate(), TwoTrackMinimumDistance::crossingPoint(), dcaCut_, TwoTrackMinimumDistance::distance(), reco::TrackBase::eta(), eventTrackTrajectories_, edm::RefToBase< T >::key(), reco::TrackBase::phi(), primaryVertexCut2_, reco::TrackBase::pt(), theMinimum_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by associate(), packLinks(), and vertexCandidates().

198  {
199  if (fabs(el1->eta() - el2->eta()) > 1) {
200  dist = -1;
201  return;
202  }
203  if (el1->pt() > 2 && el2->pt() > 2 && fabs(el1->phi() - el2->phi()) > 1) {
204  dist = -1;
205  return;
206  }
207 
210 
211  // Closest approach
212  theMinimum_.calculate(gt1, gt2);
213 
214  // Fill the parameters
215  dist = theMinimum_.distance();
217 
218  vertexLinkTest = PFDisplacedVertexCandidate::LINKTEST_DCA; //rechit by default
219 
220  // Check if the link test fails
221  if (dist > dcaCut_) {
222  dist = -1;
223  return;
224  }
225 
226  // Check if the closses approach point is too close to the primary vertex/beam pipe
227  double rho2 = P.x() * P.x() + P.y() * P.y();
228 
229  if (rho2 < primaryVertexCut2_) {
230  dist = -1;
231  return;
232  }
233 
234  // Check if the closses approach point is out of range of the tracker
235 
236  double tob_rho_limit2 = 10000;
237  double tec_z_limit = 270;
238 
239  if (rho2 > tob_rho_limit2) {
240  dist = -1;
241  return;
242  }
243  if (fabs(P.z()) > tec_z_limit) {
244  dist = -1;
245  return;
246  }
247 
248  return;
249 
250  /*
251  // Check if the inner hit of one of the tracks is not too far away from the vertex
252  double dx = el1->innerPosition().x()-P.x();
253  double dy = el1->innerPosition().y()-P.y();
254  double dz = el1->innerPosition().z()-P.z();
255  double dist2 = dx*dx+dy*dy+dz*dz;
256 
257  if (dist2 > dcaPInnerHitCut2_) {
258  dist = -1;
259  if (debug_) cout << "track " << el1.key() << " dist to vertex " << sqrt(dist2) << endl;
260  return;
261  }
262 
263  dx = el2->innerPosition().x()-P.x();
264  dy = el2->innerPosition().y()-P.y();
265  dz = el2->innerPosition().z()-P.z();
266  dist2 = dx*dx+dy*dy+dz*dz;
267 
268  if (dist2 > dcaPInnerHitCut2_) {
269  dist = -1;
270  if (debug_) cout << "track " << el2.key() << " dist to vertex " << sqrt(dist2) << endl;
271  return;
272  }
273  */
274 }
T y() const
Definition: PV3DBase.h:60
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:614
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:617
size_t key() const
Definition: RefToBase.h:219
double dcaCut_
–— Algo parameters for the vertex finder -— ///
double pt() const
track transverse momentum
Definition: TrackBase.h:602
T z() const
Definition: PV3DBase.h:61
GlobalPoint crossingPoint() const override
std::vector< GlobalTrajectoryParameters > eventTrackTrajectories_
float distance() const override
double primaryVertexCut2_
Do not reconstruct vertices wich are too close to the beam pipe.
T x() const
Definition: PV3DBase.h:59
void PFDisplacedVertexCandidateFinder::packLinks ( reco::PFDisplacedVertexCandidate vertexCandidate)
private

Compute missing links in the displacedVertexCandidates (the recursive procedure does not build all links)

Definition at line 278 of file PFDisplacedVertexCandidateFinder.cc.

References gather_cfg::cout, debug_, reco::PFDisplacedVertexCandidate::elements(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, link(), and reco::PFDisplacedVertexCandidate::setLink().

Referenced by findDisplacedVertexCandidates(), and vertexCandidates().

278  {
279  const vector<TrackBaseRef>& els = vertexCandidate.elements();
280 
281  //First Loop: update all link data
282  for (unsigned i1 = 0; i1 < els.size(); i1++) {
283  for (unsigned i2 = i1 + 1; i2 < els.size(); i2++) {
284  // no reflexive link
285  if (i1 == i2)
286  continue;
287 
288  double dist = -1;
289  GlobalPoint P(0, 0, 0);
291 
292  link(els[i1], els[i2], dist, P, linktest);
293 
294 #ifdef PFLOW_DEBUG
295  if (debug_)
296  cout << "Setting link between elements " << i1 << " key " << els[i1].key() << " and " << i2 << " key "
297  << els[i2].key() << " of dist =" << dist << " computed from link test " << linktest << endl;
298 #endif
299 
300  if (dist > -0.5)
301  vertexCandidate.setLink(i1, i2, dist, P, linktest);
302  }
303  }
304 }
void link(const reco::TrackBaseRef &el1, const reco::TrackBaseRef &el2, double &dist, GlobalPoint &P, reco::PFDisplacedVertexCandidate::VertexLinkTest &linktest)
Check whether 2 elements are linked and fill the link parameters.
const std::vector< TrackBaseRef > & elements() const
void setLink(unsigned i1, unsigned i2, const float dist, const GlobalPoint &dcaPoint, const VertexLinkTest test=LINKTEST_DCA)
std::pair< OmniClusterRef, TrackingParticleRef > P
bool debug_
if true, debug printouts activated
void PFDisplacedVertexCandidateFinder::setDebug ( bool  debug)
inline

sets debug printout flag

Definition at line 51 of file PFDisplacedVertexCandidateFinder.h.

References debug, debug_, and setInput().

51 { debug_ = debug; }
#define debug
Definition: HDRShower.cc:19
bool debug_
if true, debug printouts activated
void PFDisplacedVertexCandidateFinder::setInput ( const edm::Handle< reco::TrackCollection > &  trackh,
const MagneticField magField 
)

Set the imput collection of tracks and calculate their trajectory parameters the Global Trajectory Parameters

Definition at line 49 of file PFDisplacedVertexCandidateFinder.cc.

References eventTracks_, eventTrackTrajectories_, edm::Ref< C, T, F >::get(), getGlobalTrajectoryParameters(), mps_fire::i, isSelected(), edm::HandleBase::isValid(), magField_, and trackMask_.

Referenced by setDebug().

50  {
51  magField_ = magField;
52  trackMask_.clear();
53  trackMask_.resize(trackh->size());
55  eventTrackTrajectories_.resize(trackh->size());
56 
57  for (unsigned i = 0; i < trackMask_.size(); i++)
58  trackMask_[i] = true;
59 
60  eventTracks_.clear();
61  if (trackh.isValid()) {
62  for (unsigned i = 0; i < trackh->size(); i++) {
63  TrackRef tref(trackh, i);
64  TrackBaseRef tbref(tref);
65 
66  if (!isSelected(tbref)) {
67  trackMask_[i] = false;
68  continue;
69  }
70 
71  const Track* trk = tref.get();
72  eventTracks_.push_back(tbref);
74  }
75  }
76 }
GlobalTrajectoryParameters getGlobalTrajectoryParameters(const reco::Track *) const
--—— TOOLS --—— //
std::list< reco::TrackBaseRef > eventTracks_
The track refs.
bool isValid() const
Definition: HandleBase.h:70
std::vector< GlobalTrajectoryParameters > eventTrackTrajectories_
bool isSelected(const reco::TrackBaseRef &trackref)
void PFDisplacedVertexCandidateFinder::setParameters ( double  dcaCut,
double  primaryVertexCut,
double  dcaPInnerHitCut,
const edm::ParameterSet ps_trk 
)
inline

---—— Set different algo parameters —— ///

Sets algo parameters for the vertex candidate finder

Definition at line 40 of file PFDisplacedVertexCandidateFinder.h.

References particleFlowDisplacedVertexCandidate_cfi::dcaCut, dcaCut_, particleFlowDisplacedVertexCandidate_cfi::dcaPInnerHitCut, dcaPInnerHitCut2_, dxy_, edm::ParameterSet::getParameter(), nChi2_max_, particleFlowDisplacedVertex_cfi::primaryVertexCut, primaryVertexCut2_, pt_min_, and pt_min_prim_.

40  {
41  dcaCut_ = dcaCut;
44  nChi2_max_ = ps_trk.getParameter<double>("nChi2_max");
45  pt_min_ = ps_trk.getParameter<double>("pt_min");
46  pt_min_prim_ = ps_trk.getParameter<double>("pt_min_prim");
47  dxy_ = ps_trk.getParameter<double>("dxy");
48  }
T getParameter(std::string const &) const
double dcaCut_
–— Algo parameters for the vertex finder -— ///
double primaryVertexCut2_
Do not reconstruct vertices wich are too close to the beam pipe.
double dcaPInnerHitCut2_
Maximum distance between the DCA Point and the inner hit of the track.
void PFDisplacedVertexCandidateFinder::setPrimaryVertex ( edm::Handle< reco::VertexCollection mainVertexHandle,
edm::Handle< reco::BeamSpot beamSpotHandle 
)

Definition at line 32 of file PFDisplacedVertexCandidateFinder.cc.

References pwdgSkimBPark_cfi::beamSpot, edm::HandleBase::isValid(), pvtx_, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

Referenced by vertexCandidates().

33  {
34  const math::XYZPoint beamSpot = beamSpotHandle.isValid()
35  ? math::XYZPoint(beamSpotHandle->x0(), beamSpotHandle->y0(), beamSpotHandle->z0())
36  : math::XYZPoint(0, 0, 0);
37 
38  // The primary vertex is taken from the refitted list,
39  // if does not exist from the average offline beam spot position
40  // if does not exist (0,0,0) is used
41  pvtx_ = mainVertexHandle.isValid()
43  mainVertexHandle->begin()->x(), mainVertexHandle->begin()->y(), mainVertexHandle->begin()->z())
44  : beamSpot;
45 }
double z0() const
z coordinate
Definition: BeamSpot.h:65
bool isValid() const
Definition: HandleBase.h:70
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double y0() const
y coordinate
Definition: BeamSpot.h:63
double x0() const
x coordinate
Definition: BeamSpot.h:61
std::unique_ptr<reco::PFDisplacedVertexCandidateCollection> PFDisplacedVertexCandidateFinder::transferVertexCandidates ( )
inline
Returns
auto_ptr to collection of DisplacedVertexCandidates

Definition at line 58 of file PFDisplacedVertexCandidateFinder.h.

References eostools::move(), and vertexCandidates_.

58  {
60  }
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > vertexCandidates_
-----— Members -----— ///
def move(src, dest)
Definition: eostools.py:511
const std::unique_ptr<reco::PFDisplacedVertexCandidateCollection>& PFDisplacedVertexCandidateFinder::vertexCandidates ( ) const
inline

Definition at line 62 of file PFDisplacedVertexCandidateFinder.h.

References associate(), findDisplacedVertexCandidates(), getGlobalTrajectoryParameters(), goodPtResolution(), dqmdumpme::last, link(), eostools::move(), GetRecoTauVFromDQM_MC_cff::next, packLinks(), setPrimaryVertex(), and vertexCandidates_.

Referenced by operator<<().

62  {
64  }
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > vertexCandidates_
-----— Members -----— ///
def move(src, dest)
Definition: eostools.py:511

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const PFDisplacedVertexCandidateFinder a 
)
friend

Definition at line 345 of file PFDisplacedVertexCandidateFinder.cc.

Referenced by isSelected().

345  {
346  if (!out)
347  return out;
348 
349  out << "====== Particle Flow Block Algorithm ======= ";
350  out << endl;
351  out << "number of unassociated elements : " << a.eventTracks_.size() << endl;
352  out << endl;
353 
354  out << " Tracks selection based on " << std::endl;
355  out << " pvtx_ = " << a.pvtx_ << std::endl;
356  out << " fabs(dxy) < " << a.dxy_ << " and pt < " << a.pt_min_prim_ << std::endl;
357  out << " nChi2 < " << a.nChi2_max_ << " and pt < " << a.pt_min_ << std::endl;
358 
359  out << endl;
360 
361  for (PFDisplacedVertexCandidateFinder::IEC ie = a.eventTracks_.begin(); ie != a.eventTracks_.end(); ie++) {
362  double pt = (*ie).get()->pt();
363 
364  math::XYZPoint Pi = (*ie).get()->innerPosition();
365  math::XYZPoint Po = (*ie).get()->outerPosition();
366 
367  double innermost_radius = sqrt(Pi.x() * Pi.x() + Pi.y() * Pi.y() + Pi.z() * Pi.z());
368  double outermost_radius = sqrt(Po.x() * Po.x() + Po.y() * Po.y() + Po.z() * Po.z());
369  double innermost_rho = sqrt(Pi.x() * Pi.x() + Pi.y() * Pi.y());
370  double outermost_rho = sqrt(Po.x() * Po.x() + Po.y() * Po.y());
371 
372  out << "ie = " << (*ie).key() << " pt = " << pt << " innermost hit radius = " << innermost_radius
373  << " rho = " << innermost_rho << " outermost hit radius = " << outermost_radius << " rho = " << outermost_rho
374  << endl;
375  }
376 
377  const std::unique_ptr<reco::PFDisplacedVertexCandidateCollection>& vertexCandidates = std::move(a.vertexCandidates());
378 
379  if (!vertexCandidates.get()) {
380  out << "vertexCandidates already transfered" << endl;
381  } else {
382  out << "number of vertexCandidates : " << vertexCandidates->size() << endl;
383  out << endl;
384 
385  for (PFDisplacedVertexCandidateFinder::IBC ib = vertexCandidates->begin(); ib != vertexCandidates->end(); ib++)
386  ib->Dump();
387  }
388 
389  return out;
390 }
const double Pi
const std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > & vertexCandidates() const
std::list< reco::TrackBaseRef > eventTracks_
The track refs.
T sqrt(T t)
Definition: SSEVec.h:19
reco::PFDisplacedVertexCandidateCollection::const_iterator IBC
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::list< reco::TrackBaseRef >::const_iterator IEC
def move(src, dest)
Definition: eostools.py:511
ib
Definition: cuy.py:662

Member Data Documentation

double PFDisplacedVertexCandidateFinder::dcaCut_
private

–— Algo parameters for the vertex finder -— ///

Distance of minimal approach below which two tracks are considered as linked together

Definition at line 124 of file PFDisplacedVertexCandidateFinder.h.

Referenced by link(), and setParameters().

double PFDisplacedVertexCandidateFinder::dcaPInnerHitCut2_
private

Maximum distance between the DCA Point and the inner hit of the track.

Definition at line 128 of file PFDisplacedVertexCandidateFinder.h.

Referenced by setParameters().

bool PFDisplacedVertexCandidateFinder::debug_
private
double PFDisplacedVertexCandidateFinder::dxy_
private

Definition at line 137 of file PFDisplacedVertexCandidateFinder.h.

Referenced by goodPtResolution(), operator<<(), and setParameters().

std::list<reco::TrackBaseRef> PFDisplacedVertexCandidateFinder::eventTracks_
private
std::vector<GlobalTrajectoryParameters> PFDisplacedVertexCandidateFinder::eventTrackTrajectories_
private

The Trajectories vector allow to calculate snd to store only once the track trajectory parameters

Definition at line 118 of file PFDisplacedVertexCandidateFinder.h.

Referenced by link(), and setInput().

const MagneticField* PFDisplacedVertexCandidateFinder::magField_
private

Definition at line 152 of file PFDisplacedVertexCandidateFinder.h.

Referenced by getGlobalTrajectoryParameters(), and setInput().

double PFDisplacedVertexCandidateFinder::nChi2_max_
private

Tracks preselection to reduce the combinatorics in PFDisplacedVertexCandidates this cuts are repeated then in a smarter way in the PFDisplacedVertexFinder be sure you are consistent between them

Definition at line 133 of file PFDisplacedVertexCandidateFinder.h.

Referenced by goodPtResolution(), operator<<(), and setParameters().

double PFDisplacedVertexCandidateFinder::primaryVertexCut2_
private

Do not reconstruct vertices wich are too close to the beam pipe.

Definition at line 126 of file PFDisplacedVertexCandidateFinder.h.

Referenced by link(), and setParameters().

double PFDisplacedVertexCandidateFinder::pt_min_
private

Definition at line 134 of file PFDisplacedVertexCandidateFinder.h.

Referenced by goodPtResolution(), operator<<(), and setParameters().

double PFDisplacedVertexCandidateFinder::pt_min_prim_
private

Definition at line 136 of file PFDisplacedVertexCandidateFinder.h.

Referenced by goodPtResolution(), operator<<(), and setParameters().

math::XYZPoint PFDisplacedVertexCandidateFinder::pvtx_
private
TwoTrackMinimumDistance PFDisplacedVertexCandidateFinder::theMinimum_
private

Definition at line 144 of file PFDisplacedVertexCandidateFinder.h.

Referenced by link().

Mask PFDisplacedVertexCandidateFinder::trackMask_
private

The trackMask allows to keep the information on the tracks which are still free and those which are already used or disabled.

Definition at line 115 of file PFDisplacedVertexCandidateFinder.h.

Referenced by associate(), and setInput().

std::unique_ptr<reco::PFDisplacedVertexCandidateCollection> PFDisplacedVertexCandidateFinder::vertexCandidates_
private

-----— Members -----— ///

Definition at line 107 of file PFDisplacedVertexCandidateFinder.h.

Referenced by findDisplacedVertexCandidates(), transferVertexCandidates(), and vertexCandidates().

unsigned PFDisplacedVertexCandidateFinder::vertexCandidatesSize_
private

Max number of expected vertexCandidates in the event Used to allocate the memory and avoid multiple copy

Definition at line 141 of file PFDisplacedVertexCandidateFinder.h.

Referenced by findDisplacedVertexCandidates().