CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
KDTreeLinkerTools.h
Go to the documentation of this file.
1 #ifndef KDTreeLinkerTools_h
2 #define KDTreeLinkerTools_h
3 
6 
7 #include <map>
8 #include <set>
9 
10 typedef std::set<reco::PFBlockElement*> BlockEltSet;
11 typedef std::set<const reco::PFRecHit*> RecHitSet;
12 
13 typedef std::map<const reco::PFRecHit*, BlockEltSet> RecHit2BlockEltMap;
14 typedef std::map<reco::PFBlockElement*, BlockEltSet> BlockElt2BlockEltMap;
15 
16 
17 // Box structure used to define 2D field.
18 // It's used in KDTree building step to divide the detector
19 // space (ECAL, HCAL...) and in searching step to create a bounding
20 // box around the demanded point (Track collision point, PS projection...).
21 struct KDTreeBox
22 {
23  double dim1min, dim1max;
24  double dim2min, dim2max;
25 
26  public:
27 
28  KDTreeBox(double d1min, double d1max,
29  double d2min, double d2max)
30  : dim1min (d1min), dim1max(d1max)
31  , dim2min (d2min), dim2max(d2max)
32  {}
33 
35  : dim1min (0), dim1max(0)
36  , dim2min (0), dim2max(0)
37  {}
38 };
39 
40 
41 // Data stored in each KDTree node.
42 // The dim1/dim2 fields are usually the duplication of some PFRecHit values
43 // (eta/phi or x/y). But in some situations, phi field is shifted by +-2.Pi
45 {
47  double dim1;
48  double dim2;
49 
50  public:
52  : ptr(0)
53  {}
54 
56  double d1,
57  double d2)
58  : ptr(rhptr), dim1(d1), dim2(d2)
59  {}
60 };
61 
62 
63 // KDTree node.
64 struct KDTreeNode
65 {
66  // Data
68 
69  // Right/left sons.
71 
72  // Region bounding box.
74 
75  public:
77  : left(0), right(0)
78  {}
79 
80  void setAttributs(const KDTreeBox& regionBox,
81  const KDTreeNodeInfo& rhinfo)
82  {
83  rh = rhinfo;
84  region = regionBox;
85  }
86 
87  void setAttributs(const KDTreeBox& regionBox)
88  {
89  region = regionBox;
90  }
91 };
92 
93 
94 
95 #endif
void setAttributs(const KDTreeBox &regionBox, const KDTreeNodeInfo &rhinfo)
KDTreeNodeInfo(const reco::PFRecHit *rhptr, double d1, double d2)
KDTreeBox(double d1min, double d1max, double d2min, double d2max)
void setAttributs(const KDTreeBox &regionBox)
KDTreeBox region
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
std::map< const reco::PFRecHit *, BlockEltSet > RecHit2BlockEltMap
KDTreeNode * right
KDTreeNode * left
KDTreeNodeInfo rh
std::map< reco::PFBlockElement *, BlockEltSet > BlockElt2BlockEltMap
std::set< const reco::PFRecHit * > RecHitSet
const reco::PFRecHit * ptr
std::set< reco::PFBlockElement * > BlockEltSet