PhysicsTools
PatUtils
src
SimpleJetTrackAssociator.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/PatUtils/interface/SimpleJetTrackAssociator.h
"
2
#include "
DataFormats/TrackReco/interface/Track.h
"
3
#include "
DataFormats/Math/interface/deltaR.h
"
4
5
void
helper::SimpleJetTrackAssociator::associateTransient
(
const
math::XYZVector
&
dir
,
6
const
reco::TrackCollection
&
in
,
7
reco::TrackRefVector
&
out
) {
8
for
(
size_t
i
= 0,
n
=
in
.size();
i
<
n
;
i
++) {
9
const
reco::Track
&
t
=
in
[
i
];
10
if
((
t
.numberOfValidHits() <
nHits_
) || (
t
.normalizedChi2() >
chi2nMax_
))
11
continue
;
12
if
(
deltaR2
(
dir
,
t
) <
deltaR2_
) {
13
reco::TrackRef
tr(&
in
,
i
);
// note: transient ref
14
out
.push_back(tr);
15
}
16
}
17
}
18
19
void
helper::SimpleJetTrackAssociator::associate
(
const
math::XYZVector
&
dir
,
20
const
edm::View<reco::Track>
&
in
,
21
reco::TrackRefVector
&
out
) {
22
for
(
size_t
i
= 0,
n
=
in
.size();
i
<
n
;
i
++) {
23
const
reco::Track
&
t
=
in
[
i
];
24
if
((
t
.numberOfValidHits() < nHits_) || (
t
.normalizedChi2() > chi2nMax_))
25
continue
;
26
if
(
deltaR2
(
dir
,
t
) < deltaR2_) {
27
reco::TrackRef
tr =
in
.refAt(
i
).castTo<
reco::TrackRef
>();
28
out
.push_back(tr);
29
}
30
}
31
}
deltaR.h
mps_fire.i
i
Definition:
mps_fire.py:429
helper::SimpleJetTrackAssociator::deltaR2_
double deltaR2_
Definition:
SimpleJetTrackAssociator.h:19
helper::SimpleJetTrackAssociator::associateTransient
void associateTransient(const math::XYZVector &dir, const reco::TrackCollection &in, reco::TrackRefVector &out)
Definition:
SimpleJetTrackAssociator.cc:5
submitPVValidationJobs.t
string t
Definition:
submitPVValidationJobs.py:651
edm::Ref< TrackCollection >
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition:
TrackFwd.h:14
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
helper::SimpleJetTrackAssociator::nHits_
int32_t nHits_
Definition:
SimpleJetTrackAssociator.h:20
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
DeadROC_duringRun.dir
dir
Definition:
DeadROC_duringRun.py:23
HLTMuonOfflineAnalyzer_cfi.deltaR2
deltaR2
Definition:
HLTMuonOfflineAnalyzer_cfi.py:53
edm::View
Definition:
CaloClusterFwd.h:14
helper::SimpleJetTrackAssociator::associate
void associate(const math::XYZVector &dir, const edm::View< reco::Track > &in, reco::TrackRefVector &out)
Definition:
SimpleJetTrackAssociator.cc:19
helper::SimpleJetTrackAssociator::chi2nMax_
double chi2nMax_
Definition:
SimpleJetTrackAssociator.h:21
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition:
Vector3D.h:31
SimpleJetTrackAssociator.h
edm::RefVector< TrackCollection >
reco::Track
Definition:
Track.h:27
Track.h
Generated for CMSSW Reference Manual by
1.8.14