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
}
mps_fire.i
i
Definition:
mps_fire.py:355
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
edm::RefVector< TrackCollection >
edm::Ref< TrackCollection >
deltaR.h
helper::SimpleJetTrackAssociator::associate
void associate(const math::XYZVector &dir, const edm::View< reco::Track > &in, reco::TrackRefVector &out)
Definition:
SimpleJetTrackAssociator.cc:19
Track.h
reco::Track
Definition:
Track.h:27
OrderedSet.t
t
Definition:
OrderedSet.py:90
edm::View
Definition:
CaloClusterFwd.h:14
SimpleJetTrackAssociator.h
helper::SimpleJetTrackAssociator::nHits_
int32_t nHits_
Definition:
SimpleJetTrackAssociator.h:20
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition:
Vector3D.h:31
helper::SimpleJetTrackAssociator::chi2nMax_
double chi2nMax_
Definition:
SimpleJetTrackAssociator.h:21
HLTMuonOfflineAnalyzer_cfi.deltaR2
deltaR2
Definition:
HLTMuonOfflineAnalyzer_cfi.py:105
helper::SimpleJetTrackAssociator::associateTransient
void associateTransient(const math::XYZVector &dir, const reco::TrackCollection &in, reco::TrackRefVector &out)
Definition:
SimpleJetTrackAssociator.cc:5
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition:
TrackFwd.h:14
helper::SimpleJetTrackAssociator::deltaR2_
double deltaR2_
Definition:
SimpleJetTrackAssociator.h:19
DeadROC_duringRun.dir
dir
Definition:
DeadROC_duringRun.py:23
Generated for CMSSW Reference Manual by
1.8.16