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 
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,
73  LinkData& linkData,
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 
117  LinkData& linkData() {
118  return linkData_;
119  }
120 
121  private:
122 
124  unsigned linkDataSize() const;
125 
127  LinkData linkData_;
128 
131 
132  };
133 
134  std::ostream& operator<<( std::ostream& out, const PFBlock& co );
135 
136 }
137 
138 #endif
139 
140 
141 
type
Definition: HCALResponse.h:21
Abstract base class for a PFBlock element (track, cluster...)
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:349
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
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:71
void addElement(reco::PFBlockElement *element)
Definition: PFBlock.cc:12
void bookLinkData()
Definition: PFBlock.cc:20
edm::OwnVector< reco::PFBlockElement > elements_
all elements
Definition: PFBlock.h:130
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
fixed size matrix
double dist(unsigned ie1, unsigned ie2, const LinkData &linkData, LinkTest test) const
Definition: PFBlock.h:94
LinkData linkData_
link data (permanent)
Definition: PFBlock.h:127
Block of elements.
Definition: PFBlock.h:30