CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
PFRecHitCaloNavigator< DET, TOPO, ownsTopo > Class Template Reference

#include <PFRecHitCaloNavigator.h>

Inheritance diagram for PFRecHitCaloNavigator< DET, TOPO, ownsTopo >:
PFRecHitNavigatorBase

Public Member Functions

void associateNeighbours (reco::PFRecHit &hit, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd) override
 
 ~PFRecHitCaloNavigator () 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 Attributes

std::unique_ptr< const TOPO > topology_
 

Additional Inherited Members

- Public Types inherited from PFRecHitNavigatorBase
typedef std::unordered_map< unsigned, unsigned > DetIdToHitIdx
 
- 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)
 

Detailed Description

template<typename DET, typename TOPO, bool ownsTopo = true>
class PFRecHitCaloNavigator< DET, TOPO, ownsTopo >

Definition at line 23 of file PFRecHitCaloNavigator.h.

Constructor & Destructor Documentation

◆ ~PFRecHitCaloNavigator()

template<typename DET, typename TOPO, bool ownsTopo = true>
PFRecHitCaloNavigator< DET, TOPO, ownsTopo >::~PFRecHitCaloNavigator ( )
inlineoverride

Definition at line 25 of file PFRecHitCaloNavigator.h.

25  {
26  if (!ownsTopo) {
27  topology_.release();
28  }
29  }

Member Function Documentation

◆ associateNeighbours()

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

Implements PFRecHitNavigatorBase.

Definition at line 31 of file PFRecHitCaloNavigator.h.

33  {
34  DetId detid(hit.detId());
35 
37 
38  DetId N(0);
39  DetId E(0);
40  DetId S(0);
41  DetId W(0);
42  DetId NW(0);
43  DetId NE(0);
44  DetId SW(0);
45  DetId SE(0);
46 
47  N = navigator.north();
48  associateNeighbour(N, hit, hits, refProd, 0, 1, 0);
49 
50  if (N != DetId(0)) {
51  NE = navigator.east();
52  } else {
53  navigator.home();
54  E = navigator.east();
55  NE = navigator.north();
56  }
57  associateNeighbour(NE, hit, hits, refProd, 1, 1, 0);
58  navigator.home();
59 
60  S = navigator.south();
61  associateNeighbour(S, hit, hits, refProd, 0, -1, 0);
62 
63  if (S != DetId(0)) {
64  SW = navigator.west();
65  } else {
66  navigator.home();
67  W = navigator.west();
68  SW = navigator.south();
69  }
70  associateNeighbour(SW, hit, hits, refProd, -1, -1, 0);
71  navigator.home();
72 
73  E = navigator.east();
74  associateNeighbour(E, hit, hits, refProd, 1, 0, 0);
75 
76  if (E != DetId(0)) {
77  SE = navigator.south();
78  } else {
79  navigator.home();
80  S = navigator.south();
81  SE = navigator.east();
82  }
83  associateNeighbour(SE, hit, hits, refProd, 1, -1, 0);
84  navigator.home();
85 
86  W = navigator.west();
87  associateNeighbour(W, hit, hits, refProd, -1, 0, 0);
88 
89  if (W != DetId(0)) {
90  NW = navigator.north();
91  } else {
92  navigator.home();
93  N = navigator.north();
94  NW = navigator.west();
95  }
96  associateNeighbour(NW, hit, hits, refProd, -1, 1, 0);
97  }

Member Data Documentation

◆ topology_

template<typename DET, typename TOPO, bool ownsTopo = true>
std::unique_ptr<const TOPO> PFRecHitCaloNavigator< DET, TOPO, ownsTopo >::topology_
protected
PFRecHitNavigatorBase::associateNeighbour
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)
Definition: PFRecHitNavigatorBase.h:41
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
DetId
Definition: DetId.h:17
HLT_2018_cff.navigator
navigator
Definition: HLT_2018_cff.py:11734
N
#define N
Definition: blowfish.cc:9
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
PFRecHitCaloNavigator::topology_
std::unique_ptr< const TOPO > topology_
Definition: PFRecHitCaloNavigator.h:100
CaloNavigator
Definition: CaloNavigator.h:7
S
Definition: CSCDBL1TPParametersExtended.h:16
hit
Definition: SiStripHitEffFromCalibTree.cc:88