CMS 3D CMS Logo

PFBlock.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFAlgo_PFBlock_h
2 #define RecoParticleFlow_PFAlgo_PFBlock_h
3 
4 #include <map>
5 #include <iostream>
6 
7 /* #include "boost/graph/adjacency_matrix.hpp" */
8 
9 // #include "DataFormats/ParticleFlowReco/interface/PFBlockLink.h"
11 // #include "DataFormats/ParticleFlowReco/interface/PFBlockParticle.h"
13 
14 namespace reco {
15 
17 
26  class PFBlock {
27  public:
28  struct Link {
29  Link() : distance(-1), test(0) {}
30  Link(float d, char t) : distance(d), test(t) {}
31  float distance;
32  char test;
33  };
34 
36  /* typedef std::vector< reco::PFBlockLink >::const_iterator IL; */
37 
38  // typedef std::vector< std::vector<double> > LinkData;
39  typedef std::map<unsigned int, Link> LinkData;
40 
42 
43  PFBlock() {}
44  // PFBlock(const PFBlock& other);
45 
48  void addElement(reco::PFBlockElement* element);
49 
50  void bookLinkData();
51 
54  bool matrix2vector(unsigned i, unsigned j, unsigned& index) const;
55 
59  void setLink(unsigned i1, unsigned i2, double dist, LinkData& linkData, LinkTest test = LINKTEST_RECHIT) const;
60 
64 
70  void associatedElements(unsigned i,
71  const LinkData& linkData,
72  std::multimap<double, unsigned>& sortedAssociates,
74  LinkTest test = LINKTEST_RECHIT) const;
75 
77  double dist(unsigned ie1, unsigned ie2, const LinkData& linkData, LinkTest test) const {
78  return dist(ie1, ie2, linkData);
79  }
80 
82  double dist(unsigned ie1, unsigned ie2, const LinkData& linkData) const;
83 
86 
88  const LinkData& linkData() const { return linkData_; }
89 
91  LinkData& linkData() { return linkData_; }
92 
93  private:
95  unsigned linkDataSize() const;
96 
99 
102  };
103 
104  std::ostream& operator<<(std::ostream& out, const PFBlock& co);
105 
106 } // namespace reco
107 
108 #endif
unsigned linkDataSize() const
Definition: PFBlock.cc:323
Abstract base class for a PFBlock element (track, cluster...)
edm::OwnVector< reco::PFBlockElement > elements_
all elements
Definition: PFBlock.h:101
LinkData & linkData()
Definition: PFBlock.h:91
const edm::OwnVector< reco::PFBlockElement > & elements() const
Definition: PFBlock.h:85
bool matrix2vector(unsigned i, unsigned j, unsigned &index) const
Definition: PFBlock.cc:102
std::map< unsigned int, Link > LinkData
Definition: PFBlock.h:39
__host__ __device__ VT * co
Definition: prefixScan.h:47
void associatedElements(unsigned i, const LinkData &linkData, std::multimap< double, unsigned > &sortedAssociates, reco::PFBlockElement::Type type=PFBlockElement::NONE, LinkTest test=LINKTEST_RECHIT) const
Definition: PFBlock.cc:60
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
void addElement(reco::PFBlockElement *element)
Definition: PFBlock.cc:11
double dist(unsigned ie1, unsigned ie2, const LinkData &linkData, LinkTest test) const
Definition: PFBlock.h:77
void bookLinkData()
Definition: PFBlock.cc:17
d
Definition: ztail.py:151
edm::OwnVector< reco::PFBlockElement >::const_iterator IE
Definition: PFBlock.h:35
fixed size matrix
const LinkData & linkData() const
Definition: PFBlock.h:88
void setLink(unsigned i1, unsigned i2, double dist, LinkData &linkData, LinkTest test=LINKTEST_RECHIT) const
Definition: PFBlock.cc:19
LinkData linkData_
link data (permanent)
Definition: PFBlock.h:98
Block of elements.
Definition: PFBlock.h:26