CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
KDTreeLinkerBase.h
Go to the documentation of this file.
1 #ifndef KDTreeLinkerBase_h
2 #define KDTreeLinkerBase_h
3 
6 
7 #include <vector>
8 
10 {
11  public:
13 
14  virtual ~KDTreeLinkerBase();
15 
16  // Get/Set of the maximal size of the cristal (ECAL, HCAL,...) in phi/eta and
17  // X/Y. By default, thus value are set for the ECAL cristal.
18  void setCristalPhiEtaMaxSize(float size);
19  void setCristalXYMaxSize(float size);
20  float getCristalPhiEtaMaxSize() const;
21  float getCristalXYMaxSize() const;
22 
23  // Get/Set phi offset. See bellow in the description of phiOffset_ to understand
24  // the application.
25  void setPhiOffset(double phiOffset);
26  float getPhiOffset() const;
27 
28  // Debug flag.
29  void setDebug(bool isDebug);
30 
31  // With this method, we create the list of elements that we want to link.
32  virtual void insertTargetElt(reco::PFBlockElement *target) = 0;
33 
34  // Here, we create the list of cluster that we want to link. From cluster
35  // and fraction, we will create a second list of rechits that will be used to
36  // build the KDTree.
37  virtual void insertFieldClusterElt(reco::PFBlockElement *cluster) = 0;
38 
39  // The KDTree building from rechits list.
40  virtual void buildTree() = 0;
41 
42  // Here we will iterate over all target elements. For each one, we will search the closest
43  // rechits in the KDTree, from rechits we will find the associated clusters and after that
44  // we will check the links between the target and all closest clusters.
45  virtual void searchLinks() = 0;
46 
47  // Here, we will store all target/cluster founded links in the PFBlockElement class
48  // of each target in the PFmultilinks field.
49  virtual void updatePFBlockEltWithLinks() = 0;
50 
51  // Here we free all allocated structures.
52  virtual void clear() = 0;
53 
54  // This method calls is the good order buildTree(), searchLinks(),
55  // updatePFBlockEltWithLinks() and clear()
56  virtual void process();
57 
58  protected:
59  // Cristal maximal size. By default, thus value are set for the ECAL cristal.
62 
63  // Usually, phi is between -Pi and +Pi. But phi space is circular, that's why an element
64  // with phi = 3.13 and another with phi = -3.14 are close. To solve this problem, during
65  // the kdtree building step, we duplicate some elements close enough to +Pi (resp -Pi) by
66  // substracting (adding) 2Pi. This field define the threshold of this operation.
67  float phiOffset_;
68 
69  // Debug boolean. Not used until now.
70  bool debug_;
71 };
72 
73 
74 #endif /* !KDTreeLinkerBase_h */
Abstract base class for a PFBlock element (track, cluster...)
virtual void updatePFBlockEltWithLinks()=0
virtual ~KDTreeLinkerBase()
void setDebug(bool isDebug)
virtual void buildTree()=0
virtual void insertFieldClusterElt(reco::PFBlockElement *cluster)=0
void setPhiOffset(double phiOffset)
float getCristalXYMaxSize() const
virtual void clear()=0
void setCristalPhiEtaMaxSize(float size)
float getCristalPhiEtaMaxSize() const
virtual void searchLinks()=0
virtual void process()
virtual void insertTargetElt(reco::PFBlockElement *target)=0
void setCristalXYMaxSize(float size)
float getPhiOffset() const
tuple size
Write out results.