CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
helper::SimpleJetTrackAssociator Class Reference

#include <SimpleJetTrackAssociator.h>

Public Member Functions

void associate (const math::XYZVector &dir, const edm::View< reco::Track > &in, reco::TrackRefVector &out)
 
void associateTransient (const math::XYZVector &dir, const reco::TrackCollection &in, reco::TrackRefVector &out)
 
 SimpleJetTrackAssociator ()
 
 SimpleJetTrackAssociator (double deltaR, int32_t nHits, double chi2nMax)
 

Private Attributes

double chi2nMax_
 
double deltaR2_
 
int32_t nHits_
 

Detailed Description

Definition at line 6 of file SimpleJetTrackAssociator.h.

Constructor & Destructor Documentation

◆ SimpleJetTrackAssociator() [1/2]

helper::SimpleJetTrackAssociator::SimpleJetTrackAssociator ( )
inline

Definition at line 8 of file SimpleJetTrackAssociator.h.

8 : deltaR2_(0), nHits_(0), chi2nMax_(0) {}

◆ SimpleJetTrackAssociator() [2/2]

helper::SimpleJetTrackAssociator::SimpleJetTrackAssociator ( double  deltaR,
int32_t  nHits,
double  chi2nMax 
)
inline

Definition at line 9 of file SimpleJetTrackAssociator.h.

Member Function Documentation

◆ associate()

void helper::SimpleJetTrackAssociator::associate ( const math::XYZVector dir,
const edm::View< reco::Track > &  in,
reco::TrackRefVector out 
)

Definition at line 19 of file SimpleJetTrackAssociator.cc.

21  {
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 }

References HLTMuonOfflineAnalyzer_cfi::deltaR2, DeadROC_duringRun::dir, mps_fire::i, recoMuon::in, dqmiodumpmetadata::n, MillePedeFileConverter_cfg::out, and submitPVValidationJobs::t.

◆ associateTransient()

void helper::SimpleJetTrackAssociator::associateTransient ( const math::XYZVector dir,
const reco::TrackCollection in,
reco::TrackRefVector out 
)

Definition at line 5 of file SimpleJetTrackAssociator.cc.

7  {
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 }

References chi2nMax_, HLTMuonOfflineAnalyzer_cfi::deltaR2, deltaR2_, DeadROC_duringRun::dir, mps_fire::i, recoMuon::in, dqmiodumpmetadata::n, nHits_, MillePedeFileConverter_cfg::out, and submitPVValidationJobs::t.

Member Data Documentation

◆ chi2nMax_

double helper::SimpleJetTrackAssociator::chi2nMax_
private

Definition at line 21 of file SimpleJetTrackAssociator.h.

Referenced by associateTransient().

◆ deltaR2_

double helper::SimpleJetTrackAssociator::deltaR2_
private

Definition at line 19 of file SimpleJetTrackAssociator.h.

Referenced by associateTransient().

◆ nHits_

int32_t helper::SimpleJetTrackAssociator::nHits_
private

Definition at line 20 of file SimpleJetTrackAssociator.h.

Referenced by associateTransient().

mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
edm::Ref< TrackCollection >
nHits
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
Definition: BrokenLineFitOnGPU.h:27
reco::Track
Definition: Track.h:27
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
helper::SimpleJetTrackAssociator::nHits_
int32_t nHits_
Definition: SimpleJetTrackAssociator.h:20
recoMuon::in
Definition: RecoMuonEnumerators.h:6
helper::SimpleJetTrackAssociator::chi2nMax_
double chi2nMax_
Definition: SimpleJetTrackAssociator.h:21
HLTMuonOfflineAnalyzer_cfi.deltaR2
deltaR2
Definition: HLTMuonOfflineAnalyzer_cfi.py:105
AlignmentTrackSelector_cfi.chi2nMax
chi2nMax
Definition: AlignmentTrackSelector_cfi.py:19
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
helper::SimpleJetTrackAssociator::deltaR2_
double deltaR2_
Definition: SimpleJetTrackAssociator.h:19
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23