CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
10 // #include "DataFormats/ParticleFlowReco/interface/PFBlockLink.h"
12 // #include "DataFormats/ParticleFlowReco/interface/PFBlockParticle.h"
14 
15 
16 
17 namespace reco {
18 
19 
21 
30  class PFBlock {
31 
32 
33  public:
34 
35  struct Link {
36  Link() : distance(-1), test(0) {}
37  Link(float d, char t) : distance(d), test(t) {}
38  float distance;
39  char test;
40  };
41 
43  /* typedef std::vector< reco::PFBlockLink >::const_iterator IL; */
44 
45  // typedef std::vector< std::vector<double> > LinkData;
46  typedef std::map< unsigned int, Link > LinkData;
47 
48  enum LinkTest {
52  };
53 
54  PFBlock() {}
55  // PFBlock(const PFBlock& other);
56 
59  void addElement( reco::PFBlockElement* element );
60 
61  void bookLinkData();
62 
65  bool matrix2vector(unsigned i, unsigned j, unsigned& index) const;
66 
70  void setLink(unsigned i1,
71  unsigned i2,
72  double dist,
74  LinkTest test=LINKTEST_RECHIT ) const;
75 
79 
80 
86  void associatedElements( unsigned i,
87  const LinkData& linkData,
88  std::multimap<double, unsigned>& sortedAssociates,
90  LinkTest test=LINKTEST_RECHIT ) const;
91 
92 
94  double dist(unsigned ie1,
95  unsigned ie2,
96  const LinkData& linkData,
97  LinkTest test ) const {
98  return dist(ie1,ie2,linkData);
99  }
100 
102  double dist( unsigned ie1,
103  unsigned ie2,
104  const LinkData& linkData) const;
105 
108  return elements_;
109  }
110 
112  const LinkData& linkData() const {
113  return linkData_;
114  }
115 
118  return linkData_;
119  }
120 
121  friend std::ostream& operator<<( std::ostream& out, const PFBlock& co );
122 
123  private:
124 
126  unsigned linkDataSize() const;
127 
130 
133 
134  };
135 }
136 
137 #endif
138 
139 
140 
type
Definition: HCALResponse.h:22
Abstract base class for a PFBlock element (track, cluster...)
int i
Definition: DBlmapReader.cc:9
edm::OwnVector< reco::PFBlockElement >::const_iterator IE
Definition: PFBlock.h:42
LinkData & linkData()
Definition: PFBlock.h:117
std::map< unsigned int, Link > LinkData
Definition: PFBlock.h:46
const edm::OwnVector< reco::PFBlockElement > & elements() const
Definition: PFBlock.h:107
unsigned linkDataSize() const
Definition: PFBlock.cc:344
const LinkData & linkData() const
Definition: PFBlock.h:112
void setLink(unsigned i1, unsigned i2, double dist, LinkData &linkData, LinkTest test=LINKTEST_RECHIT) const
Definition: PFBlock.cc:26
void addElement(reco::PFBlockElement *element)
Definition: PFBlock.cc:12
int j
Definition: DBlmapReader.cc:9
void bookLinkData()
Definition: PFBlock.cc:20
tuple out
Definition: dbtoconf.py:99
edm::OwnVector< reco::PFBlockElement > elements_
all elements
Definition: PFBlock.h:132
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:75
bool matrix2vector(unsigned i, unsigned j, unsigned &index) const
Definition: PFBlock.cc:119
double dist(unsigned ie1, unsigned ie2, const LinkData &linkData, LinkTest test) const
Definition: PFBlock.h:94
LinkData linkData_
link data (permanent)
Definition: PFBlock.h:129
friend std::ostream & operator<<(std::ostream &out, const PFBlock &co)
Block of elements.
Definition: PFBlock.h:30