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 <iostream>
15 
16 
17 namespace reco {
18  class PFBlockElementCluster;
19  class PFBlockElementTrack;
20 
21 
27  public:
28 
31  enum Type {
32  NONE=0,
33  TRACK=1,
34  PS1=2,
35  PS2=3,
36  ECAL=4,
37  HCAL=5,
38  GSF=6,
39  BREM=7,
40  HFEM=8,
41  HFHAD=9,
42  SC=10
43  };
44 
45  enum TrackType {
52  };
53 
56  type_(type),
57  locked_(false),
58  index_( static_cast<unsigned>(-1) ) {
59  }
60 
61 
63  virtual ~PFBlockElement() {}
64 
66  virtual void Dump(std::ostream& out=std::cout,
67  const char* tab=" " ) const;
68 
70  virtual PFBlockElement* clone() const = 0;
71 
73  void lock() {locked_ = true;}
74 
76  void unLock() {locked_ = false;}
77 
79  Type type() const { return type_; }
80 
82  virtual bool trackType(TrackType trType) const { return false; }
83 
85  virtual void setTrackType(TrackType trType, bool value) {
86  std::cout << "Error in PFBlockElement::setTrackType : this base class method is not implemented" << std::endl;}
87 
89  bool locked() const {return locked_;}
90 
92  void setIndex(unsigned index) { index_ = index; }
93 
95  unsigned index() const {return index_;}
96 
97  virtual reco::TrackRef trackRef() const {return reco::TrackRef(); }
98  virtual PFRecTrackRef trackRefPF() const {return PFRecTrackRef(); }
99  virtual PFClusterRef clusterRef() const {return PFClusterRef(); }
101  virtual ConversionRef convRef() const { return ConversionRef();}
102  virtual MuonRef muonRef() const { return MuonRef(); }
104  virtual void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef& niref, TrackType trType) {
105  std::cout << "Error in PFBlockElement::setDisplacedVertexRef : this base class method is not implemented" << std::endl;}
106  virtual void setConversionRef(const ConversionRef& convRef, TrackType trType) {
107  std::cout << "Error in PFBlockElement::setConversionRef : this base class method is not implemented" << std::endl;}
108  virtual void setMuonRef(const MuonRef& muref) {
109  std::cout << "Error in PFBlockElement::setMuonRef : this base class method is not implemented" << std::endl;}
110  virtual void setV0Ref(const VertexCompositeCandidateRef& v0ref,TrackType trType) {
111 
112  std::cout << "Error in PFBlockElement::setV0Ref : this base class method is not implemented" << std::endl;
113  }
114 
115 
116  virtual bool isSecondary() const { return false; }
117  virtual bool isPrimary() const { return false; }
118  virtual bool isLinkedToDisplacedVertex() const {return false;}
119 
120  friend std::ostream& operator<<( std::ostream& out,
121  const PFBlockElement& element );
122 
123  protected:
124 
128 
132  bool locked_;
133 
135  unsigned index_;
136 
137 
138  };
139 }
140 #endif
type
Definition: HCALResponse.h:22
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
edm::Ref< VertexCompositeCandidateCollection > VertexCompositeCandidateRef
persistent reference to an object in a collection of Candidate objects
unsigned index() const
bool locked() const
locked ?
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
virtual reco::TrackRef trackRef() const
void setIndex(unsigned index)
set index
virtual void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef &niref, TrackType trType)
virtual void setV0Ref(const VertexCompositeCandidateRef &v0ref, TrackType trType)
virtual PFClusterRef clusterRef() const
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
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:41
virtual bool isLinkedToDisplacedVertex() const
friend std::ostream & operator<<(std::ostream &out, const PFBlockElement &element)