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)
 
virtual ~PFRecHitCaloNavigator ()
 
- Public Member Functions inherited from PFRecHitNavigatorBase
virtual void beginEvent (const edm::EventSetup &)=0
 
 PFRecHitNavigatorBase ()
 
 PFRecHitNavigatorBase (const edm::ParameterSet &iConfig)
 
virtual ~PFRecHitNavigatorBase ()
 

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 25 of file PFRecHitCaloNavigator.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file PFRecHitCaloNavigator.h.

28 { if(!ownsTopo) { topology_.release(); } }
std::unique_ptr< const TOPO > topology_

Member Function Documentation

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 
)
inlinevirtual

Implements PFRecHitNavigatorBase.

Definition at line 30 of file PFRecHitCaloNavigator.h.

30  {
31  DetId detid( hit.detId() );
32 
34 
35  DetId N(0);
36  DetId E(0);
37  DetId S(0);
38  DetId W(0);
39  DetId NW(0);
40  DetId NE(0);
41  DetId SW(0);
42  DetId SE(0);
43 
44 
45  N=navigator.north();
46  associateNeighbour(N,hit,hits,refProd,0,1,0);
47 
48 
49  if (N !=DetId(0)) {
50  NE=navigator.east();
51  }
52  else
53  {
54  navigator.home();
55  E=navigator.east();
56  NE=navigator.north();
57  }
58  associateNeighbour(NE,hit,hits,refProd,1,1,0);
59  navigator.home();
60 
61  S = navigator.south();
62  associateNeighbour(S,hit,hits,refProd,0,-1,0);
63 
64  if (S !=DetId(0)) {
65  SW = navigator.west();
66  } else {
67  navigator.home();
68  W=navigator.west();
69  SW=navigator.south();
70  }
71  associateNeighbour(SW,hit,hits,refProd,-1,-1,0);
72  navigator.home();
73 
74  E = navigator.east();
75  associateNeighbour(E,hit,hits,refProd,1,0,0);
76 
77  if (E !=DetId(0)) {
78  SE = navigator.south();
79  } else {
80  navigator.home();
81  S=navigator.south();
82  SE=navigator.east();
83  }
84  associateNeighbour(SE,hit,hits,refProd,1,-1,0);
85  navigator.home();
86 
87 
88  W = navigator.west();
89  associateNeighbour(W,hit,hits,refProd,-1,0,0);
90 
91  if (W !=DetId(0)) {
92  NW = navigator.north();
93  } else {
94  navigator.home();
95  N=navigator.north();
96  NW=navigator.west();
97  }
98  associateNeighbour(NW,hit,hits,refProd,-1,1,0);
99  }
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)
unsigned detId() const
rechit detId
Definition: PFRecHit.h:108
Definition: DetId.h:18
#define N
Definition: blowfish.cc:9
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
std::unique_ptr< const TOPO > topology_

Member Data Documentation

template<typename DET, typename TOPO, bool ownsTopo = true>
std::unique_ptr<const TOPO> PFRecHitCaloNavigator< DET, TOPO, ownsTopo >::topology_
protected