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:
20  enum Quality {
21  UsedInFit = 7,
22  PrimaryDz = 6,
23  PrimaryV0 = 5,
24  BTrack = 4,
25  Unused = 3,
26  OtherDz = 2,
29  };
30 
32  : maxDzSigForPrimaryAssignment_(iConfig.getParameter<double>("maxDzSigForPrimaryAssignment")),
33  maxDzForPrimaryAssignment_(iConfig.getParameter<double>("maxDzForPrimaryAssignment")),
34  maxDzErrorForPrimaryAssignment_(iConfig.getParameter<double>("maxDzErrorForPrimaryAssignment")),
35  maxDtSigForPrimaryAssignment_(iConfig.getParameter<double>("maxDtSigForPrimaryAssignment")),
36  maxJetDeltaR_(iConfig.getParameter<double>("maxJetDeltaR")),
37  minJetPt_(iConfig.getParameter<double>("minJetPt")),
38  maxDistanceToJetAxis_(iConfig.getParameter<double>("maxDistanceToJetAxis")),
39  maxDzForJetAxisAssigment_(iConfig.getParameter<double>("maxDzForJetAxisAssigment")),
40  maxDxyForJetAxisAssigment_(iConfig.getParameter<double>("maxDxyForJetAxisAssigment")),
41  maxDxySigForNotReconstructedPrimary_(iConfig.getParameter<double>("maxDxySigForNotReconstructedPrimary")),
42  maxDxyForNotReconstructedPrimary_(iConfig.getParameter<double>("maxDxyForNotReconstructedPrimary")),
43  useTiming_(iConfig.getParameter<bool>("useTiming")),
44  preferHighRanked_(iConfig.getParameter<bool>("preferHighRanked")) {}
45 
47 
48  std::pair<int, PrimaryVertexAssignment::Quality> chargedHadronVertex(
50  const reco::TrackRef& trackRef,
51  const reco::Track* track,
52  float trackTime,
53  float trackTimeResolution, // <0 if timing not available for this object
55  const TransientTrackBuilder& builder) const;
56 
57  std::pair<int, PrimaryVertexAssignment::Quality> chargedHadronVertex(
59  const reco::TrackRef& trackRef,
60  float trackTime,
61  float trackTimeResolution, // <0 if timing not available for this object
63  const TransientTrackBuilder& builder) const {
64  return chargedHadronVertex(vertices, trackRef, &(*trackRef), trackTime, trackTimeResolution, jets, builder);
65  }
66 
67  std::pair<int, PrimaryVertexAssignment::Quality> chargedHadronVertex(const reco::VertexCollection& vertices,
70  const TransientTrackBuilder& builder) const {
71  float time = 0, timeResolution = -1;
72  if (useTiming_ && pfcand.isTimeValid()) {
73  time = pfcand.time();
74  timeResolution = pfcand.timeError();
75  }
76  if (pfcand.gsfTrackRef().isNull()) {
77  if (pfcand.trackRef().isNull())
78  return std::pair<int, PrimaryVertexAssignment::Quality>(-1, PrimaryVertexAssignment::Unassigned);
79  else
80  return chargedHadronVertex(vertices, pfcand.trackRef(), time, timeResolution, jets, builder);
81  }
82  return chargedHadronVertex(
83  vertices, reco::TrackRef(), &(*pfcand.gsfTrackRef()), time, timeResolution, jets, builder);
84  }
85  std::pair<int, PrimaryVertexAssignment::Quality> chargedHadronVertex(const reco::VertexCollection& vertices,
86  const reco::RecoChargedRefCandidate& chcand,
90  const TransientTrackBuilder& builder) const {
91  float time = 0, timeResolution = -1;
92  if (useTiming_) {
93  time = (*trackTimeTag)[chcand.track()];
94  timeResolution = (*trackTimeResoTag)[chcand.track()];
95  }
96  if (chcand.track().isNull())
97  return std::pair<int, PrimaryVertexAssignment::Quality>(-1, PrimaryVertexAssignment::Unassigned);
98  return chargedHadronVertex(vertices, chcand.track(), time, timeResolution, jets, builder);
99  }
100 
101 private:
107  double minJetPt_;
115 };
116 
117 #endif
PrimaryVertexAssignment::chargedHadronVertex
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::TrackRef &trackRef, float trackTime, float trackTimeResolution, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const
Definition: PrimaryVertexAssignment.h:57
electrons_cff.bool
bool
Definition: electrons_cff.py:366
reco::RecoChargedRefCandidate
Definition: RecoChargedRefCandidate.h:12
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
PrimaryVertexAssignment::preferHighRanked_
bool preferHighRanked_
Definition: PrimaryVertexAssignment.h:114
PrimaryVertexAssignment::OtherDz
Definition: PrimaryVertexAssignment.h:26
EDProducer.h
PFCandidate.h
PrimaryVertexAssignment::chargedHadronVertex
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::PFCandidate &pfcand, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const
Definition: PrimaryVertexAssignment.h:67
HLT_FULL_cff.timeResolution
timeResolution
Definition: HLT_FULL_cff.py:8048
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
PrimaryVertexAssignment::PrimaryVertexAssignment
PrimaryVertexAssignment(const edm::ParameterSet &iConfig)
Definition: PrimaryVertexAssignment.h:31
PrimaryVertexAssignment::useTiming_
bool useTiming_
Definition: PrimaryVertexAssignment.h:113
PrimaryVertexAssignment::PrimaryDz
Definition: PrimaryVertexAssignment.h:22
PrimaryVertexAssignment::maxDtSigForPrimaryAssignment_
double maxDtSigForPrimaryAssignment_
Definition: PrimaryVertexAssignment.h:105
PrimaryVertexAssignment::~PrimaryVertexAssignment
~PrimaryVertexAssignment()
Definition: PrimaryVertexAssignment.h:46
protons_cff.time
time
Definition: protons_cff.py:39
PrimaryVertexAssignment
Definition: PrimaryVertexAssignment.h:18
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
RecoVertex_phase2_timing_cff.trackTimeResoTag
trackTimeResoTag
Definition: RecoVertex_phase2_timing_cff.py:23
PrimaryVertexAssignment::Quality
Quality
Definition: PrimaryVertexAssignment.h:20
PrimaryVertexAssignment::maxDzForPrimaryAssignment_
double maxDzForPrimaryAssignment_
Definition: PrimaryVertexAssignment.h:103
PrimaryVertexAssignment::BTrack
Definition: PrimaryVertexAssignment.h:24
PrimaryVertexAssignment::maxDxySigForNotReconstructedPrimary_
double maxDxySigForNotReconstructedPrimary_
Definition: PrimaryVertexAssignment.h:111
edm::Ref< TrackCollection >
RecoVertex_phase2_timing_cff.trackTimeTag
trackTimeTag
Definition: RecoVertex_phase2_timing_cff.py:22
pfDeepBoostedJetPreprocessParams_cfi.pfcand
pfcand
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:8
PrimaryVertexAssignment::PrimaryV0
Definition: PrimaryVertexAssignment.h:23
PrimaryVertexAssignment::maxDistanceToJetAxis_
double maxDistanceToJetAxis_
Definition: PrimaryVertexAssignment.h:108
PrimaryVertexAssignment::maxDzForJetAxisAssigment_
double maxDzForJetAxisAssigment_
Definition: PrimaryVertexAssignment.h:109
PrimaryVertexAssignment::maxDzErrorForPrimaryAssignment_
double maxDzErrorForPrimaryAssignment_
Definition: PrimaryVertexAssignment.h:104
PrimaryVertexAssignment::Unassigned
Definition: PrimaryVertexAssignment.h:28
reco::Track
Definition: Track.h:27
PrimaryVertexAssignment::maxJetDeltaR_
double maxJetDeltaR_
Definition: PrimaryVertexAssignment.h:106
RecoChargedRefCandidate.h
edm::View
Definition: CaloClusterFwd.h:14
PrimaryVertexAssignment::maxDzSigForPrimaryAssignment_
double maxDzSigForPrimaryAssignment_
Definition: PrimaryVertexAssignment.h:102
TransientTrackBuilder.h
PrimaryVertexAssignment::chargedHadronVertex
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::TrackRef &trackRef, const reco::Track *track, float trackTime, float trackTimeResolution, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const
Definition: PrimaryVertexAssignment.cc:9
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
PrimaryVertexAssignment::maxDxyForNotReconstructedPrimary_
double maxDxyForNotReconstructedPrimary_
Definition: PrimaryVertexAssignment.h:112
PrimaryVertexAssignment::maxDxyForJetAxisAssigment_
double maxDxyForJetAxisAssigment_
Definition: PrimaryVertexAssignment.h:110
PrimaryVertexAssignment::minJetPt_
double minJetPt_
Definition: PrimaryVertexAssignment.h:107
TransientTrackBuilder
Definition: TransientTrackBuilder.h:16
PrimaryVertexAssignment::NotReconstructedPrimary
Definition: PrimaryVertexAssignment.h:27
VertexFwd.h
Frameworkfwd.h
edm::ValueMap< float >
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
reco::RecoChargedRefCandidate::track
reco::TrackRef track() const
Definition: RecoChargedRefCandidate.h:21
Candidate.h
PrimaryVertexAssignment::UsedInFit
Definition: PrimaryVertexAssignment.h:21
ParameterSet.h
PrimaryVertexAssignment::Unused
Definition: PrimaryVertexAssignment.h:25
PrimaryVertexAssignment::chargedHadronVertex
std::pair< int, PrimaryVertexAssignment::Quality > chargedHadronVertex(const reco::VertexCollection &vertices, const reco::RecoChargedRefCandidate &chcand, const edm::ValueMap< float > *trackTimeTag, const edm::ValueMap< float > *trackTimeResoTag, const edm::View< reco::Candidate > &jets, const TransientTrackBuilder &builder) const
Definition: PrimaryVertexAssignment.h:85
PFCandidateFwd.h
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7