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  HGCAL=12,
48  };
49 
50  enum TrackType {
57  };
58 
61  type_(type),
62  locked_(false),
63  index_( static_cast<unsigned>(-1) ),
64  time_(0.f), timeError_(-1.f)
65  {
66  }
67 
68 
70  virtual ~PFBlockElement() {}
71 
73  virtual void Dump(std::ostream& out=std::cout,
74  const char* tab=" " ) const;
75 
77  virtual PFBlockElement* clone() const = 0;
78 
80  void lock() {locked_ = true;}
81 
83  void unLock() {locked_ = false;}
84 
86  Type type() const { return type_; }
87 
89  virtual bool trackType(TrackType trType) const { return false; }
90 
92  virtual void setTrackType(TrackType trType, bool value) {
93  std::cout << "Error in PFBlockElement::setTrackType : this base class method is not implemented" << std::endl;}
94 
96  bool locked() const {return locked_;}
97 
99  void setIndex(unsigned index) { index_ = index; }
100 
102  unsigned index() const {return index_;}
103 
104  virtual const reco::TrackRef& trackRef() const {return nullTrack_; }
105  virtual const PFRecTrackRef& trackRefPF() const {return nullPFRecTrack_; }
106  virtual const PFClusterRef& clusterRef() const {return nullPFCluster_; }
108  virtual const ConversionRefVector& convRefs() const { return nullConv_;}
109  virtual const MuonRef& muonRef() const { return nullMuon_; }
110  virtual const VertexCompositeCandidateRef& V0Ref() const { return nullVertex_; }
111  virtual void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef& niref, TrackType trType) {
112  std::cout << "Error in PFBlockElement::setDisplacedVertexRef : this base class method is not implemented" << std::endl;}
113  virtual void setConversionRef(const ConversionRef& convRef, TrackType trType) {
114  std::cout << "Error in PFBlockElement::setConversionRef : this base class method is not implemented" << std::endl;}
115  virtual void setMuonRef(const MuonRef& muref) {
116  std::cout << "Error in PFBlockElement::setMuonRef : this base class method is not implemented" << std::endl;}
117  virtual void setV0Ref(const VertexCompositeCandidateRef& v0ref,TrackType trType) {
118 
119  std::cout << "Error in PFBlockElement::setV0Ref : this base class method is not implemented" << std::endl;
120  }
121 
122 
123  virtual bool isSecondary() const { return false; }
124  virtual bool isPrimary() const { return false; }
125  virtual bool isLinkedToDisplacedVertex() const {return false;}
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 
137  bool isTimeValid() const { return timeError_ >= 0.f; }
139  float time() const { return time_; }
141  float timeError() const { return timeError_; }
143  void setTime(float time, float timeError = 0.f) { time_ = time; timeError_ = timeError; }
144 
145  protected:
146 
150 
154  bool locked_;
155 
157  unsigned index_;
158 
159  // Glowinski & Gouzevitch
161  // ! Glowinski & Gouzevitch
162 
164  float time_;
166  float timeError_;
167 
173  const static MuonRef nullMuon_;
175 
176  };
177 
178  std::ostream& operator<<( std::ostream& out,
179  const PFBlockElement& element );
180 
181 }
182 #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 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)
bool isTimeValid() const
do we have a valid time information
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:71
void setIsValidMultilinks(bool isVal)
float timeError_
timing information uncertainty (&lt;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]
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)
float time_
timing information (valid if timeError_ &gt;= 0)
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
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