test
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,
47  };
48 
49  enum TrackType {
56  };
57 
60  type_(type),
61  locked_(false),
62  index_( static_cast<unsigned>(-1) ) {
63  }
64 
65 
67  virtual ~PFBlockElement() {}
68 
70  virtual void Dump(std::ostream& out=std::cout,
71  const char* tab=" " ) const;
72 
74  virtual PFBlockElement* clone() const = 0;
75 
77  void lock() {locked_ = true;}
78 
80  void unLock() {locked_ = false;}
81 
83  Type type() const { return type_; }
84 
86  virtual bool trackType(TrackType trType) const { return false; }
87 
89  virtual void setTrackType(TrackType trType, bool value) {
90  std::cout << "Error in PFBlockElement::setTrackType : this base class method is not implemented" << std::endl;}
91 
93  bool locked() const {return locked_;}
94 
96  void setIndex(unsigned index) { index_ = index; }
97 
99  unsigned index() const {return index_;}
100 
101  virtual const reco::TrackRef& trackRef() const {return nullTrack_; }
102  virtual const PFRecTrackRef& trackRefPF() const {return nullPFRecTrack_; }
103  virtual const PFClusterRef& clusterRef() const {return nullPFCluster_; }
105  virtual const ConversionRefVector& convRefs() const { return nullConv_;}
106  virtual const MuonRef& muonRef() const { return nullMuon_; }
107  virtual const VertexCompositeCandidateRef& V0Ref() const { return nullVertex_; }
108  virtual void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef& niref, TrackType trType) {
109  std::cout << "Error in PFBlockElement::setDisplacedVertexRef : this base class method is not implemented" << std::endl;}
110  virtual void setConversionRef(const ConversionRef& convRef, TrackType trType) {
111  std::cout << "Error in PFBlockElement::setConversionRef : this base class method is not implemented" << std::endl;}
112  virtual void setMuonRef(const MuonRef& muref) {
113  std::cout << "Error in PFBlockElement::setMuonRef : this base class method is not implemented" << std::endl;}
114  virtual void setV0Ref(const VertexCompositeCandidateRef& v0ref,TrackType trType) {
115 
116  std::cout << "Error in PFBlockElement::setV0Ref : this base class method is not implemented" << std::endl;
117  }
118 
119 
120  virtual bool isSecondary() const { return false; }
121  virtual bool isPrimary() const { return false; }
122  virtual bool isLinkedToDisplacedVertex() const {return false;}
123 
124  friend std::ostream& operator<<( std::ostream& out,
125  const PFBlockElement& element );
126 
127  // Glowinski & Gouzevitch
128  void setMultilinks(const PFMultiLinksTC& ml) {multilinks_ = ml;}
129  void setIsValidMultilinks(bool isVal) {multilinks_.isValid = isVal;}
131 
132  bool isMultilinksValide() const {return multilinks_.isValid;}
134  // ! Glowinski & Gouzevitch
135 
136  protected:
137 
141 
145  bool locked_;
146 
148  unsigned index_;
149 
150  // Glowinski & Gouzevitch
152  // ! Glowinski & Gouzevitch
153 
159  const static MuonRef nullMuon_;
161 
162  };
163 }
164 #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 const MuonRef & muonRef() const
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
static const MuonRef nullMuon_
virtual const PFClusterRef & clusterRef() const
Type type() const
static const PFRecTrackRef nullPFRecTrack_
static const PFDisplacedTrackerVertexRef nullPFDispVertex_
virtual bool isSecondary() 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
void setMultilinksList(const PFMultilinksType &links)
void setIsValidMultilinks(bool isVal)
unsigned index() const
bool locked() const
locked ?
PFMultiLinksTC multilinks_
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 const PFRecTrackRef & trackRefPF() const
static const PFClusterRef nullPFCluster_
void lock()
lock element
virtual const ConversionRefVector & convRefs() const
static const ConversionRefVector nullConv_
virtual const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const
virtual ~PFBlockElement()
destructor
virtual void setConversionRef(const ConversionRef &convRef, TrackType trType)
bool isMultilinksValide() const
unsigned index_
index in block vector
virtual bool trackType(TrackType trType) const
static const reco::TrackRef nullTrack_
static const VertexCompositeCandidateRef nullVertex_
virtual void setMuonRef(const MuonRef &muref)
tuple cout
Definition: gather_cfg.py:145
virtual bool isLinkedToDisplacedVertex() const
volatile std::atomic< bool > shutdown_flag false
virtual const reco::TrackRef & trackRef() const
friend std::ostream & operator<<(std::ostream &out, const PFBlockElement &element)
void setMultilinks(const PFMultiLinksTC &ml)
const PFMultilinksType & getMultilinks() const
virtual const VertexCompositeCandidateRef & V0Ref() const