test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFRecHitCaloNavigator.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFClusterProducer_PFRecHitCaloNavigator_h
2 #define RecoParticleFlow_PFClusterProducer_PFRecHitCaloNavigator_h
3 
4 
8 
14 
19 
22 
23 
24 template <typename DET,typename TOPO,bool ownsTopo=true>
26  public:
27 
28  virtual ~PFRecHitCaloNavigator() { if(!ownsTopo) { topology_.release(); } }
29 
30  void associateNeighbours(reco::PFRecHit& hit,std::auto_ptr<reco::PFRecHitCollection>& hits,edm::RefProd<reco::PFRecHitCollection>& refProd) {
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  }
100 
101 
102 
103  protected:
104  std::unique_ptr<const TOPO> topology_;
105 
106 
107 };
108 
109 #endif
110 
111 
unsigned detId() const
rechit detId
Definition: PFRecHit.h:108
void associateNeighbour(const DetId &id, reco::PFRecHit &hit, std::auto_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd, short eta, short phi, short depth)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
void associateNeighbours(reco::PFRecHit &hit, std::auto_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd)
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_