CMS 3D CMS Logo

Classes | Functions
pfalgo_common_ref.h File Reference
#include "../firmware/data.h"
#include "../firmware/pfalgo_common.h"
#include <algorithm>

Go to the source code of this file.

Classes

struct  pfalgo_config
 

Functions

template<typename CO_t >
int best_match_with_pt_ref (int nCAL, int dR2MAX, const CO_t calo[], const TkObj &track)
 
void pfalgo_mu_ref (const pfalgo_config &cfg, const TkObj track[], const MuObj mu[], bool isMu[], PFChargedObj outmu[], bool debug)
 
template<typename T >
void ptsort_ref (int nIn, int nOut, const T in[], T out[])
 
template<typename T , typename TV >
void ptsort_ref (int nIn, int nOut, const TV &in, T out[])
 
template<typename T >
int sqr (const T &t)
 

Function Documentation

◆ best_match_with_pt_ref()

template<typename CO_t >
int best_match_with_pt_ref ( int  nCAL,
int  dR2MAX,
const CO_t  calo[],
const TkObj track 
)

Definition at line 56 of file pfalgo_common_ref.h.

56  {
57  pt_t caloPtMin = track.hwPt - 2 * (track.hwPtErr);
58  if (caloPtMin < 0)
59  caloPtMin = 0;
60  int dptscale = (dR2MAX << 8) / std::max<int>(1, sqr(track.hwPtErr));
61  int drmin = 0, ibest = -1;
62  for (int ic = 0; ic < nCAL; ++ic) {
63  if (calo[ic].hwPt <= caloPtMin)
64  continue;
65  int dr = dr2_int(track.hwEta, track.hwPhi, calo[ic].hwEta, calo[ic].hwPhi);
66  if (dr >= dR2MAX)
67  continue;
68  dr += ((sqr(std::max<int>(track.hwPt - calo[ic].hwPt, 0)) * dptscale) >> 8);
69  if (ibest == -1 || dr < drmin) {
70  drmin = dr;
71  ibest = ic;
72  }
73  }
74  return ibest;
75 }

References L1TowerCalibrationProducer_cfi::calo, flavorHistoryFilter_cfi::dr, dr2_int(), sqr(), and HLT_2018_cff::track.

◆ pfalgo_mu_ref()

void pfalgo_mu_ref ( const pfalgo_config cfg,
const TkObj  track[],
const MuObj  mu[],
bool  isMu[],
PFChargedObj  outmu[],
bool  debug 
)

◆ ptsort_ref() [1/2]

template<typename T >
void ptsort_ref ( int  nIn,
int  nOut,
const T  in[],
T  out[] 
)

◆ ptsort_ref() [2/2]

template<typename T , typename TV >
void ptsort_ref ( int  nIn,
int  nOut,
const TV &  in,
T  out[] 
)

Definition at line 78 of file pfalgo_common_ref.h.

78  {
79  for (int iout = 0; iout < nOut; ++iout) {
80  out[iout].hwPt = 0;
81  }
82  for (int it = 0; it < nIn; ++it) {
83  for (int iout = 0; iout < nOut; ++iout) {
84  if (in[it].hwPt >= out[iout].hwPt) {
85  for (int i2 = nOut - 1; i2 > iout; --i2) {
86  out[i2] = out[i2 - 1];
87  }
88  out[iout] = in[it];
89  break;
90  }
91  }
92  }
93 }

References testProducerWithPsetDescEmpty_cfi::i2, recoMuon::in, and MillePedeFileConverter_cfg::out.

◆ sqr()

template<typename T >
int sqr ( const T t)
inline

Definition at line 9 of file pfalgo_common_ref.h.

9  {
10  return t * t;
11 }

References OrderedSet::t.

Referenced by MonopoleTransportation::AlongStepGetPhysicalInteractionLength(), ThirdHitPredictionFromCircle::angle(), best_match_with_pt_ref(), HitPairGeneratorFromLayerPairForPhotonConversion::checkRZCompatibilityWithSeedTrack(), RectangularEtaPhiTrackingRegion::checkRZOld(), ThirdHitPredictionFromCircle::curvature(), RectangularEtaPhiTrackingRegion::estimator(), FullModelReactionDynamics::GenerateXandPt(), HitPairGeneratorFromLayerPairForPhotonConversion::getPhiRange(), CAHitTripletGenerator::hitNtuplets(), CAHitQuadrupletGenerator::hitNtuplets(), HitPairGeneratorFromLayerPairForPhotonConversion::hitPairs(), ThirdHitCorrection::init(), SeedForPhotonConversion1Leg::initialError(), SeedFromConsecutiveHitsCreator::initialError(), JacobianLocalToCartesian::JacobianLocalToCartesian(), SeedFromConsecutiveHitsCreator::makeSeed(), MatchJet::matchCollections(), RKCurvilinearDistance< T, N >::momentum(), RKCurvilinearDistance< T, N >::operator()(), ThirdHitZPrediction::operator()(), ThirdHitPredictionFromCircle::phi(), InnerDeltaPhi::phiRange(), ThirdHitPredictionFromCircle::HelixRZ::rAtZ(), reco::GhostTrackVertexFinder::reassignTracks(), PrimaryVertexResolution::Resolution::Resolution(), PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::selectPriVtxCompatibleWithTrack(), MSLayersKeeperX0AtEta::setX0(), reco::SequentialGhostTrackFitter::stable(), MSLayersAtAngle::sumX0D(), ThirdHitPredictionFromCircle::transverseIP(), reco::GhostTrackVertexFinder::vertexCompat(), reco::TrackGhostTrackState::vertexStateOnGhostTrack(), reco::TrackGhostTrackState::vertexStateOnMeasurement(), and ThirdHitPredictionFromCircle::HelixRZ::zAtR().

testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
L1TowerCalibrationProducer_cfi.calo
calo
Definition: L1TowerCalibrationProducer_cfi.py:59
sqr
int sqr(const T &t)
Definition: pfalgo_common_ref.h:9
OrderedSet.t
t
Definition: OrderedSet.py:90
pt_t
ap_int< 16 > pt_t
Definition: data.h:6
recoMuon::in
Definition: RecoMuonEnumerators.h:6
dr2_int
int dr2_int(etaphi_t eta1, etaphi_t phi1, etaphi_t eta2, etaphi_t phi2)
Definition: pfalgo_common.h:6
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352