CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
PFRecHitCaloNavigatorWithTime< D, T, ownsTopo > Class Template Reference

#include <PFRecHitCaloNavigatorWithTime.h>

Inheritance diagram for PFRecHitCaloNavigatorWithTime< D, T, ownsTopo >:
PFRecHitNavigatorBase

Public Member Functions

void associateNeighbours (reco::PFRecHit &hit, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd) override
 
 PFRecHitCaloNavigatorWithTime (const edm::ParameterSet &iConfig)
 
 ~PFRecHitCaloNavigatorWithTime () override
 
- Public Member Functions inherited from PFRecHitNavigatorBase
virtual void init (const edm::EventSetup &)=0
 
 PFRecHitNavigatorBase ()=default
 
 PFRecHitNavigatorBase (const edm::ParameterSet &iConfig)
 
virtual ~PFRecHitNavigatorBase ()=default
 

Protected Member Functions

void associateNeighbour (const DetId &id, reco::PFRecHit &hit, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd, short eta, short phi)
 
- Protected Member Functions inherited from PFRecHitNavigatorBase
void associateNeighbour (const DetId &id, reco::PFRecHit &hit, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd, short eta, short phi, short depth)
 

Protected Attributes

std::unique_ptr< CaloRecHitResolutionProvider_timeResolutionCalc
 
double sigmaCut2_
 
std::unique_ptr< const Ttopology_
 

Additional Inherited Members

- Public Types inherited from PFRecHitNavigatorBase
typedef std::unordered_map< unsigned, unsigned > DetIdToHitIdx
 

Detailed Description

template<typename D, typename T, bool ownsTopo = true>
class PFRecHitCaloNavigatorWithTime< D, T, ownsTopo >

Definition at line 26 of file PFRecHitCaloNavigatorWithTime.h.

Constructor & Destructor Documentation

◆ PFRecHitCaloNavigatorWithTime()

template<typename D, typename T, bool ownsTopo = true>
PFRecHitCaloNavigatorWithTime< D, T, ownsTopo >::PFRecHitCaloNavigatorWithTime ( const edm::ParameterSet iConfig)
inline

Definition at line 28 of file PFRecHitCaloNavigatorWithTime.h.

28  {
29  sigmaCut2_ = pow(iConfig.getParameter<double>("sigmaCut"), 2);
30  const edm::ParameterSet& timeResConf = iConfig.getParameterSet("timeResolutionCalc");
31  _timeResolutionCalc.reset(new CaloRecHitResolutionProvider(timeResConf));
32  }

◆ ~PFRecHitCaloNavigatorWithTime()

template<typename D, typename T, bool ownsTopo = true>
PFRecHitCaloNavigatorWithTime< D, T, ownsTopo >::~PFRecHitCaloNavigatorWithTime ( )
inlineoverride

Definition at line 34 of file PFRecHitCaloNavigatorWithTime.h.

34  {
35  if (!ownsTopo) {
36  topology_.release();
37  }
38  }

Member Function Documentation

◆ associateNeighbour()

template<typename D, typename T, bool ownsTopo = true>
void PFRecHitCaloNavigatorWithTime< D, T, ownsTopo >::associateNeighbour ( const DetId id,
reco::PFRecHit hit,
std::unique_ptr< reco::PFRecHitCollection > &  hits,
edm::RefProd< reco::PFRecHitCollection > &  refProd,
short  eta,
short  phi 
)
inlineprotected

Definition at line 113 of file PFRecHitCaloNavigatorWithTime.h.

118  {
119  double sigma2 = 10000.0;
120 
121  auto found_hit = std::lower_bound(hits->begin(), hits->end(), id, [](const reco::PFRecHit& a, DetId b) {
122  if (DetId(a.detId()).det() == DetId::Hcal || b.det() == DetId::Hcal)
123  return (HcalDetId)(a.detId()) < (HcalDetId)(b);
124 
125  else
126  return a.detId() < b.rawId();
127  });
128 
129  if (found_hit != hits->end() &&
130  ((found_hit->detId() == id.rawId()) ||
131  ((id.det() == DetId::Hcal) && ((HcalDetId)(found_hit->detId()) == (HcalDetId)(id))))) {
132  sigma2 = _timeResolutionCalc->timeResolution2(hit.energy()) +
133  _timeResolutionCalc->timeResolution2(found_hit->energy());
134  const double deltaTime = hit.time() - found_hit->time();
135  if (deltaTime * deltaTime < sigmaCut2_ * sigma2) {
136  hit.addNeighbour(eta, phi, 0, found_hit - hits->begin());
137  }
138  }
139  }

Referenced by PFRecHitCaloNavigatorWithTime< EEDetId, EcalEndcapTopology >::associateNeighbours().

◆ associateNeighbours()

template<typename D, typename T, bool ownsTopo = true>
void PFRecHitCaloNavigatorWithTime< D, T, ownsTopo >::associateNeighbours ( reco::PFRecHit hit,
std::unique_ptr< reco::PFRecHitCollection > &  hits,
edm::RefProd< reco::PFRecHitCollection > &  refProd 
)
inlineoverridevirtual

Implements PFRecHitNavigatorBase.

Definition at line 40 of file PFRecHitCaloNavigatorWithTime.h.

42  {
43  DetId detid(hit.detId());
44 
45  CaloNavigator<D> navigator(detid, topology_.get());
46 
47  DetId N(0);
48  DetId E(0);
49  DetId S(0);
50  DetId W(0);
51  DetId NW(0);
52  DetId NE(0);
53  DetId SW(0);
54  DetId SE(0);
55 
56  N = navigator.north();
57  associateNeighbour(N, hit, hits, refProd, 0, 1);
58 
59  if (N != DetId(0)) {
60  NE = navigator.east();
61  } else {
62  navigator.home();
63  E = navigator.east();
64  NE = navigator.north();
65  }
66  associateNeighbour(NE, hit, hits, refProd, 1, 1);
67  navigator.home();
68 
69  S = navigator.south();
70  associateNeighbour(S, hit, hits, refProd, 0, -1);
71 
72  if (S != DetId(0)) {
73  SW = navigator.west();
74  } else {
75  navigator.home();
76  W = navigator.west();
77  SW = navigator.south();
78  }
79  associateNeighbour(SW, hit, hits, refProd, -1, -1);
80  navigator.home();
81 
82  E = navigator.east();
83  associateNeighbour(E, hit, hits, refProd, 1, 0);
84 
85  if (E != DetId(0)) {
86  SE = navigator.south();
87  } else {
88  navigator.home();
89  S = navigator.south();
90  SE = navigator.east();
91  }
92  associateNeighbour(SE, hit, hits, refProd, 1, -1);
93  navigator.home();
94 
95  W = navigator.west();
96  associateNeighbour(W, hit, hits, refProd, -1, 0);
97 
98  if (W != DetId(0)) {
99  NW = navigator.north();
100  } else {
101  navigator.home();
102  N = navigator.north();
103  NW = navigator.west();
104  }
105  associateNeighbour(NW, hit, hits, refProd, -1, 1);
106  }

Member Data Documentation

◆ _timeResolutionCalc

template<typename D, typename T, bool ownsTopo = true>
std::unique_ptr<CaloRecHitResolutionProvider> PFRecHitCaloNavigatorWithTime< D, T, ownsTopo >::_timeResolutionCalc
protected

◆ sigmaCut2_

template<typename D, typename T, bool ownsTopo = true>
double PFRecHitCaloNavigatorWithTime< D, T, ownsTopo >::sigmaCut2_
protected

◆ topology_

template<typename D, typename T, bool ownsTopo = true>
std::unique_ptr<const T> PFRecHitCaloNavigatorWithTime< D, T, ownsTopo >::topology_
protected
CaloRecHitResolutionProvider
Definition: CaloRecHitResolutionProvider.h:8
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
HLT_FULL_cff.navigator
navigator
Definition: HLT_FULL_cff.py:13126
DetId::Hcal
Definition: DetId.h:28
PFRecHitCaloNavigatorWithTime::associateNeighbour
void associateNeighbour(const DetId &id, reco::PFRecHit &hit, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd, short eta, short phi)
Definition: PFRecHitCaloNavigatorWithTime.h:113
DetId
Definition: DetId.h:17
PFRecHitCaloNavigatorWithTime::_timeResolutionCalc
std::unique_ptr< CaloRecHitResolutionProvider > _timeResolutionCalc
Definition: PFRecHitCaloNavigatorWithTime.h:111
PVValHelper::eta
Definition: PVValidationHelpers.h:69
PFRecHitCaloNavigatorWithTime::sigmaCut2_
double sigmaCut2_
Definition: PFRecHitCaloNavigatorWithTime.h:109
N
#define N
Definition: blowfish.cc:9
b
double b
Definition: hdecay.h:118
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
HcalDetId
Definition: HcalDetId.h:12
DDAxes::phi
CaloNavigator
Definition: CaloNavigator.h:7
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
PFRecHitCaloNavigatorWithTime::topology_
std::unique_ptr< const T > topology_
Definition: PFRecHitCaloNavigatorWithTime.h:110
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
S
Definition: CSCDBL1TPParametersExtended.h:16
reco::PFRecHit
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
hit
Definition: SiStripHitEffFromCalibTree.cc:88