CMS 3D CMS Logo

PrimaryVertexAssignment.h
Go to the documentation of this file.
1 #ifndef CommonTools_PFCandProducer_PrimaryVertexAssignment_
2 #define CommonTools_PFCandProducer_PrimaryVertexAssignment_
3 
5 
9 
11 
17 
19  public:
21 
23  maxDzSigForPrimaryAssignment_(iConfig.getParameter<double>("maxDzSigForPrimaryAssignment")),
24  maxDzForPrimaryAssignment_(iConfig.getParameter<double>("maxDzForPrimaryAssignment")),
25  maxDzErrorForPrimaryAssignment_(iConfig.getParameter<double>("maxDzErrorForPrimaryAssignment")),
26  maxJetDeltaR_(iConfig.getParameter<double>("maxJetDeltaR")),
27  minJetPt_(iConfig.getParameter<double>("minJetPt")),
28  maxDistanceToJetAxis_(iConfig.getParameter<double>("maxDistanceToJetAxis")),
29  maxDzForJetAxisAssigment_(iConfig.getParameter<double>("maxDzForJetAxisAssigment")),
30  maxDxyForJetAxisAssigment_(iConfig.getParameter<double>("maxDxyForJetAxisAssigment")),
31  maxDxySigForNotReconstructedPrimary_(iConfig.getParameter<double>("maxDxySigForNotReconstructedPrimary")),
32  maxDxyForNotReconstructedPrimary_(iConfig.getParameter<double>("maxDxyForNotReconstructedPrimary"))
33  {}
34 
36 
37  std::pair<int,PrimaryVertexAssignment::Quality> chargedHadronVertex(const reco::VertexCollection& vertices,
38  const reco::TrackRef& trackRef,
39  const reco::Track * track,
41  const TransientTrackBuilder & builder) const;
42 
43  std::pair<int,PrimaryVertexAssignment::Quality> chargedHadronVertex(const reco::VertexCollection& vertices,
44  const reco::TrackRef& trackRef,
45  const edm::View<reco::Candidate> & jets,
46  const TransientTrackBuilder & builder) const
47  {
48  return chargedHadronVertex(vertices,trackRef,&(*trackRef),jets,builder);
49  }
50 
51  std::pair<int,PrimaryVertexAssignment::Quality> chargedHadronVertex( const reco::VertexCollection& vertices,
52  const reco::PFCandidate& pfcand,
53  const edm::View<reco::Candidate>& jets,
54  const TransientTrackBuilder& builder) const {
55  if(pfcand.gsfTrackRef().isNull())
56  {
57  if(pfcand.trackRef().isNull())
58  return std::pair<int,PrimaryVertexAssignment::Quality>(-1,PrimaryVertexAssignment::Unassigned);
59  else
60  return chargedHadronVertex(vertices,pfcand.trackRef(),jets,builder);
61  }
62  return chargedHadronVertex(vertices,reco::TrackRef(),&(*pfcand.gsfTrackRef()),jets,builder);
63  }
64  std::pair<int,PrimaryVertexAssignment::Quality> chargedHadronVertex( const reco::VertexCollection& vertices,
65  const reco::RecoChargedRefCandidate& chcand,
66  const edm::View<reco::Candidate>& jets,
67  const TransientTrackBuilder& builder) const {
68  if(chcand.track().isNull())
69  return std::pair<int,PrimaryVertexAssignment::Quality>(-1,PrimaryVertexAssignment::Unassigned);
70  return chargedHadronVertex(vertices,chcand.track(),jets,builder);
71  }
72 
73 
74  private :
78  double maxJetDeltaR_;
79  double minJetPt_;
85 };
86 
87 #endif
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::TrackRef &trackRef, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::PFCandidate &pfcand, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const
PrimaryVertexAssignment(const edm::ParameterSet &iConfig)
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:438
vector< PseudoJet > jets
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::RecoChargedRefCandidate &chcand, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const
bool isNull() const
Checks for null.
Definition: Ref.h:249
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:476
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::TrackRef &trackRef, const reco::Track *track, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const