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
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
mps_fire.i
i
Definition: mps_fire.py:428
reco::PFBlock::IE
edm::OwnVector< reco::PFBlockElement >::const_iterator IE
Definition: PFBlock.h:35
reco::PFBlock::setLink
void setLink(unsigned i1, unsigned i2, double dist, LinkData &linkData, LinkTest test=LINKTEST_RECHIT) const
Definition: PFBlock.cc:19
reco::PFBlock::linkData
const LinkData & linkData() const
Definition: PFBlock.h:88
reco::PFBlock::bookLinkData
void bookLinkData()
Definition: PFBlock.cc:17
reco::PFBlock
Block of elements.
Definition: PFBlock.h:26
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
reco::PFBlock::associatedElements
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
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
reco::PFBlock::LINKTEST_RECHIT
Definition: PFBlock.h:41
reco::PFBlock::linkData
LinkData & linkData()
Definition: PFBlock.h:91
reco::PFBlockElement::Type
Type
Definition: PFBlockElement.h:30
test
Definition: SmallWORMDict.h:13
cms::cuda::co
__host__ __device__ VT * co
Definition: prefixScan.h:47
PFBlockElement.h
reco::PFBlockElement::NONE
Definition: PFBlockElement.h:31
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
reco::PFBlock::linkDataSize
unsigned linkDataSize() const
Definition: PFBlock.cc:323
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
reco::operator<<
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
reco::PFBlock::elements
const edm::OwnVector< reco::PFBlockElement > & elements() const
Definition: PFBlock.h:85
reco::PFBlock::LinkData
std::map< unsigned int, Link > LinkData
Definition: PFBlock.h:39
reco::PFBlock::LINKTEST_ALL
Definition: PFBlock.h:41
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
reco::PFBlock::addElement
void addElement(reco::PFBlockElement *element)
Definition: PFBlock.cc:11
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
reco::PFBlock::elements_
edm::OwnVector< reco::PFBlockElement > elements_
all elements
Definition: PFBlock.h:101
reco::PFBlock::dist
double dist(unsigned ie1, unsigned ie2, const LinkData &linkData, LinkTest test) const
Definition: PFBlock.h:77
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
ztail.d
d
Definition: ztail.py:151
reco::PFBlock::linkData_
LinkData linkData_
link data (permanent)
Definition: PFBlock.h:98
OwnVector.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
reco::PFBlock::PFBlock
PFBlock()
Definition: PFBlock.h:43
reco::PFBlock::LINKTEST_NLINKTEST
Definition: PFBlock.h:41
edm::OwnVector< reco::PFBlockElement >
reco::PFBlock::LinkTest
LinkTest
Definition: PFBlock.h:41
reco::PFBlock::matrix2vector
bool matrix2vector(unsigned i, unsigned j, unsigned &index) const
Definition: PFBlock.cc:102