CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFBlockElement.h
Go to the documentation of this file.
1 #ifndef __PFBlockElement__
2 #define __PFBlockElement__
3 
13 
14 #include "DataFormats/ParticleFlowReco/interface/PFMultilinksTC.h" // Glowinski & Gouzevitch
15 
16 #include <iostream>
17 
18 
19 namespace reco {
20  class PFBlockElementCluster;
21  class PFBlockElementTrack;
22 
23 
29  public:
30 
33  enum Type {
34  NONE=0,
35  TRACK=1,
36  PS1=2,
37  PS2=3,
38  ECAL=4,
39  HCAL=5,
40  GSF=6,
41  BREM=7,
42  HFEM=8,
43  HFHAD=9,
44  SC=10,
45  HO=11
46  };
47 
48  enum TrackType {
55  };
56 
59  type_(type),
60  locked_(false),
61  index_( static_cast<unsigned>(-1) ) {
62  }
63 
64 
66  virtual ~PFBlockElement() {}
67 
69  virtual void Dump(std::ostream& out=std::cout,
70  const char* tab=" " ) const;
71 
73  virtual PFBlockElement* clone() const = 0;
74 
76  void lock() {locked_ = true;}
77 
79  void unLock() {locked_ = false;}
80 
82  Type type() const { return type_; }
83 
85  virtual bool trackType(TrackType trType) const { return false; }
86 
88  virtual void setTrackType(TrackType trType, bool value) {
89  std::cout << "Error in PFBlockElement::setTrackType : this base class method is not implemented" << std::endl;}
90 
92  bool locked() const {return locked_;}
93 
95  void setIndex(unsigned index) { index_ = index; }
96 
98  unsigned index() const {return index_;}
99 
100  virtual reco::TrackRef trackRef() const {return reco::TrackRef(); }
101  virtual PFRecTrackRef trackRefPF() const {return PFRecTrackRef(); }
102  virtual PFClusterRef clusterRef() const {return PFClusterRef(); }
104  virtual ConversionRef convRef() const { return ConversionRef();}
105  virtual MuonRef muonRef() const { return MuonRef(); }
107  virtual void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef& niref, TrackType trType) {
108  std::cout << "Error in PFBlockElement::setDisplacedVertexRef : this base class method is not implemented" << std::endl;}
109  virtual void setConversionRef(const ConversionRef& convRef, TrackType trType) {
110  std::cout << "Error in PFBlockElement::setConversionRef : this base class method is not implemented" << std::endl;}
111  virtual void setMuonRef(const MuonRef& muref) {
112  std::cout << "Error in PFBlockElement::setMuonRef : this base class method is not implemented" << std::endl;}
113  virtual void setV0Ref(const VertexCompositeCandidateRef& v0ref,TrackType trType) {
114 
115  std::cout << "Error in PFBlockElement::setV0Ref : this base class method is not implemented" << std::endl;
116  }
117 
118 
119  virtual bool isSecondary() const { return false; }
120  virtual bool isPrimary() const { return false; }
121  virtual bool isLinkedToDisplacedVertex() const {return false;}
122 
123  friend std::ostream& operator<<( std::ostream& out,
124  const PFBlockElement& element );
125 
126  // Glowinski & Gouzevitch
127  void setMultilinks(const PFMultiLinksTC& ml) {multilinks_ = ml;}
128  void setIsValidMultilinks(bool isVal) {multilinks_.isValid = isVal;}
130 
131  bool isMultilinksValide() const {return multilinks_.isValid;}
133  // ! Glowinski & Gouzevitch
134 
135  protected:
136 
140 
144  bool locked_;
145 
147  unsigned index_;
148 
149  // Glowinski & Gouzevitch
151  // ! Glowinski & Gouzevitch
152 
153  };
154 }
155 #endif
type
Definition: HCALResponse.h:21
std::vector< std::pair< double, double > > PFMultilinksType
Abstract This class is used by the KDTree Track / Ecal Cluster linker to store all found links...
Abstract base class for a PFBlock element (track, cluster...)
virtual bool isPrimary() const
void unLock()
unlock element
virtual void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
Type type() const
virtual bool isSecondary() const
virtual PFDisplacedTrackerVertexRef displacedVertexRef(TrackType trType) const
PFBlockElement(Type type=NONE)
standard constructor
virtual PFBlockElement * clone() const =0
necessary to have the edm::OwnVector&lt;PFBlockElement&gt; working
virtual void setTrackType(TrackType trType, bool value)
the trackType
virtual VertexCompositeCandidateRef V0Ref() const
void setMultilinksList(const PFMultilinksType &links)
edm::Ref< VertexCompositeCandidateCollection > VertexCompositeCandidateRef
persistent reference to an object in a collection of Candidate objects
void setIsValidMultilinks(bool isVal)
unsigned index() const
bool locked() const
locked ?
PFMultiLinksTC multilinks_
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
virtual reco::TrackRef trackRef() const
void setIndex(unsigned index)
set index
PFMultilinksType linkedClusters
virtual void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef &niref, TrackType trType)
virtual void setV0Ref(const VertexCompositeCandidateRef &v0ref, TrackType trType)
virtual PFClusterRef clusterRef() const
tuple tab
Definition: accesses.py:4
edm::Ref< PFRecTrackCollection > PFRecTrackRef
persistent reference to PFRecTrack objects
Definition: PFRecTrackFwd.h:15
edm::Ref< PFDisplacedTrackerVertexCollection > PFDisplacedTrackerVertexRef
persistent reference to a DisplacedTrackerVertex
edm::Ref< MuonCollection > MuonRef
presistent reference to a Muon
Definition: MuonFwd.h:13
virtual PFRecTrackRef trackRefPF() const
void lock()
lock element
tuple out
Definition: dbtoconf.py:99
virtual ~PFBlockElement()
destructor
virtual void setConversionRef(const ConversionRef &convRef, TrackType trType)
virtual MuonRef muonRef() const
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
bool isMultilinksValide() const
unsigned index_
index in block vector
virtual bool trackType(TrackType trType) const
virtual ConversionRef convRef() const
virtual void setMuonRef(const MuonRef &muref)
edm::Ref< ConversionCollection > ConversionRef
reference to an object in a collection of Conversion objects
Definition: ConversionFwd.h:15
tuple cout
Definition: gather_cfg.py:121
virtual bool isLinkedToDisplacedVertex() const
volatile std::atomic< bool > shutdown_flag false
friend std::ostream & operator<<(std::ostream &out, const PFBlockElement &element)
void setMultilinks(const PFMultiLinksTC &ml)
const PFMultilinksType & getMultilinks() const