CMS 3D CMS Logo

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 namespace reco {
19  class PFBlockElementCluster;
20  class PFBlockElementTrack;
21 
27  public:
30  enum Type {
31  NONE = 0,
32  TRACK = 1,
33  PS1 = 2,
34  PS2 = 3,
35  ECAL = 4,
36  HCAL = 5,
37  GSF = 6,
38  BREM = 7,
39  HFEM = 8,
40  HFHAD = 9,
41  SC = 10,
42  HO = 11,
43  HGCAL = 12,
44  kNBETypes = 13
45  };
46 
48 
51  : type_(type), locked_(false), index_(static_cast<unsigned>(-1)), time_(0.f), timeError_(-1.f) {}
52 
54  virtual ~PFBlockElement() {}
55 
57  virtual void Dump(std::ostream& out = std::cout, const char* tab = " ") const;
58 
60  virtual PFBlockElement* clone() const = 0;
61 
63  void lock() { locked_ = true; }
64 
66  void unLock() { locked_ = false; }
67 
69  Type type() const { return type_; }
70 
72  virtual bool trackType(TrackType trType) const { return false; }
73 
75  virtual void setTrackType(TrackType trType, bool value) {
76  std::cout << "Error in PFBlockElement::setTrackType : this base class method is not implemented" << std::endl;
77  }
78 
80  bool locked() const { return locked_; }
81 
83  void setIndex(unsigned index) { index_ = index; }
84 
86  unsigned index() const { return index_; }
87 
88  virtual const reco::TrackRef& trackRef() const { return nullTrack_; }
89  virtual const PFRecTrackRef& trackRefPF() const { return nullPFRecTrack_; }
90  virtual const PFClusterRef& clusterRef() const { return nullPFCluster_; }
92  virtual const ConversionRefVector& convRefs() const { return nullConv_; }
93  virtual const MuonRef& muonRef() const { return nullMuon_; }
94  virtual const VertexCompositeCandidateRef& V0Ref() const { return nullVertex_; }
95  virtual void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef& niref, TrackType trType) {
96  std::cout << "Error in PFBlockElement::setDisplacedVertexRef : this base class method is not implemented"
97  << std::endl;
98  }
99  virtual void setConversionRef(const ConversionRef& convRef, TrackType trType) {
100  std::cout << "Error in PFBlockElement::setConversionRef : this base class method is not implemented" << std::endl;
101  }
102  virtual void setMuonRef(const MuonRef& muref) {
103  std::cout << "Error in PFBlockElement::setMuonRef : this base class method is not implemented" << std::endl;
104  }
105  virtual void setV0Ref(const VertexCompositeCandidateRef& v0ref, TrackType trType) {
106  std::cout << "Error in PFBlockElement::setV0Ref : this base class method is not implemented" << std::endl;
107  }
108 
109  virtual bool isSecondary() const { return false; }
110  virtual bool isPrimary() const { return false; }
111  virtual bool isLinkedToDisplacedVertex() const { return false; }
112 
113  // Glowinski & Gouzevitch
114  void setMultilinks(const PFMultiLinksTC& ml) { multilinks_ = ml; }
117 
118  bool isMultilinksValide() const { return multilinks_.isValid; }
120  // ! Glowinski & Gouzevitch
121 
123  bool isTimeValid() const { return timeError_ >= 0.f; }
125  float time() const { return time_; }
127  float timeError() const { return timeError_; }
129  void setTime(float time, float timeError = 0.f) {
130  time_ = time;
132  }
133 
134  protected:
138 
142  bool locked_;
143 
145  unsigned index_;
146 
147  // Glowinski & Gouzevitch
149  // ! Glowinski & Gouzevitch
150 
152  float time_;
154  float timeError_;
155 
161  const static MuonRef nullMuon_;
163  };
164 
165  std::ostream& operator<<(std::ostream& out, const PFBlockElement& element);
166 
167 } // namespace reco
168 #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
float time() const
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 void setTrackType(TrackType trType, bool value)
the trackType
virtual PFBlockElement * clone() const =0
necessary to have the edm::OwnVector<PFBlockElement> working
void setMultilinksList(const PFMultilinksType &links)
bool isTimeValid() const
do we have a valid time information
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
void setIsValidMultilinks(bool isVal)
float timeError_
timing information uncertainty (<0 if timing not available)
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)
double f[11][100]
Definition: value.py:1
virtual const PFRecTrackRef & trackRefPF() const
static const PFClusterRef nullPFCluster_
void lock()
lock element
virtual const ConversionRefVector & convRefs() const
static const ConversionRefVector nullConv_
Definition: HCAL.py:1
virtual const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const
virtual ~PFBlockElement()
destructor
virtual void setConversionRef(const ConversionRef &convRef, TrackType trType)
float time_
timing information (valid if timeError_ >= 0)
bool isMultilinksValide() const
unsigned index_
index in block vector
virtual bool trackType(TrackType trType) const
static const reco::TrackRef nullTrack_
fixed size matrix
static const VertexCompositeCandidateRef nullVertex_
virtual void setMuonRef(const MuonRef &muref)
virtual bool isLinkedToDisplacedVertex() const
virtual const reco::TrackRef & trackRef() const
void setTime(float time, float timeError=0.f)
the timing information
float timeError() const
void setMultilinks(const PFMultiLinksTC &ml)
const PFMultilinksType & getMultilinks() const
virtual const VertexCompositeCandidateRef & V0Ref() const