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
reco::PFBlockElement::isTimeValid
bool isTimeValid() const
do we have a valid time information
Definition: PFBlockElement.h:123
reco::PFBlockElement::nullConv_
const static ConversionRefVector nullConv_
Definition: PFBlockElement.h:160
reco::PFBlockElement::trackType
virtual bool trackType(TrackType trType) const
Definition: PFBlockElement.h:72
reco::PFBlockElement::HO
Definition: PFBlockElement.h:42
reco::PFBlockElement::setIndex
void setIndex(unsigned index)
set index
Definition: PFBlockElement.h:83
reco::PFBlockElement::time_
float time_
timing information (valid if timeError_ >= 0)
Definition: PFBlockElement.h:152
reco::PFBlockElement::trackRefPF
virtual const PFRecTrackRef & trackRefPF() const
Definition: PFBlockElement.h:89
reco::PFBlockElement::nullTrack_
const static reco::TrackRef nullTrack_
Definition: PFBlockElement.h:156
plotFactory.isVal
isVal
Definition: plotFactory.py:109
funct::false
false
Definition: Factorize.h:34
reco::PFMultilinksType
std::vector< std::pair< double, double > > PFMultilinksType
Abstract This class is used by the KDTree Track / Ecal Cluster linker to store all found links.
Definition: PFMultilinksTC.h:13
reco::PFBlockElement::V0Ref
virtual const VertexCompositeCandidateRef & V0Ref() const
Definition: PFBlockElement.h:94
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
reco::PFBlockElement::multilinks_
PFMultiLinksTC multilinks_
Definition: PFBlockElement.h:148
reco::PFBlockElement::time
float time() const
Definition: PFBlockElement.h:125
reco::PFBlockElement::T_TO_DISP
Definition: PFBlockElement.h:47
reco::PFBlockElement::isLinkedToDisplacedVertex
virtual bool isLinkedToDisplacedVertex() const
Definition: PFBlockElement.h:111
gather_cfg.cout
cout
Definition: gather_cfg.py:144
reco::PFBlockElement::SC
Definition: PFBlockElement.h:41
reco::PFBlockElement::nullVertex_
const static VertexCompositeCandidateRef nullVertex_
Definition: PFBlockElement.h:162
reco::PFBlockElement::index_
unsigned index_
index in block vector
Definition: PFBlockElement.h:145
edm::RefVector< ConversionCollection >
reco::PFBlockElement::HGCAL
Definition: PFBlockElement.h:43
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::PFBlockElement::getMultilinks
const PFMultilinksType & getMultilinks() const
Definition: PFBlockElement.h:119
ConversionFwd.h
reco::PFBlockElement::nullPFCluster_
const static PFClusterRef nullPFCluster_
Definition: PFBlockElement.h:158
reco::PFBlockElement::setConversionRef
virtual void setConversionRef(const ConversionRef &convRef, TrackType trType)
Definition: PFBlockElement.h:99
reco::PFBlockElement::setTime
void setTime(float time, float timeError=0.f)
\set the timing information
Definition: PFBlockElement.h:129
edm::Ref< TrackCollection >
reco::PFBlockElement::Type
Type
Definition: PFBlockElement.h:30
reco::PFBlockElement::isSecondary
virtual bool isSecondary() const
Definition: PFBlockElement.h:109
reco::PFBlockElement::isPrimary
virtual bool isPrimary() const
Definition: PFBlockElement.h:110
TrackFwd.h
reco::PFBlockElement::MUON
Definition: PFBlockElement.h:47
VertexCompositeCandidate.h
reco::PFBlockElement::Dump
virtual void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
Definition: PFBlockElement.cc:24
reco::PFBlockElement::TRACK
Definition: PFBlockElement.h:32
MuonFwd.h
reco::PFBlockElement::~PFBlockElement
virtual ~PFBlockElement()
destructor
Definition: PFBlockElement.h:54
reco::PFBlockElement::setMultilinks
void setMultilinks(const PFMultiLinksTC &ml)
Definition: PFBlockElement.h:114
reco::PFMultiLinksTC
Definition: PFMultilinksTC.h:14
reco::PFBlockElement::NONE
Definition: PFBlockElement.h:31
reco::PFMultiLinksTC::linkedClusters
PFMultilinksType linkedClusters
Definition: PFMultilinksTC.h:17
HCAL
Definition: HCAL.py:1
reco::PFBlockElement::unLock
void unLock()
unlock element
Definition: PFBlockElement.h:66
reco::PFBlockElement::type_
Type type_
Definition: PFBlockElement.h:137
reco::PFBlockElement::T_FROM_V0
Definition: PFBlockElement.h:47
reco::PFBlockElement::setMuonRef
virtual void setMuonRef(const MuonRef &muref)
Definition: PFBlockElement.h:102
reco::PFBlockElement::TrackType
TrackType
Definition: PFBlockElement.h:47
reco::PFBlockElement::T_FROM_DISP
Definition: PFBlockElement.h:47
reco::PFBlockElement::HFEM
Definition: PFBlockElement.h:39
reco::PFBlockElement::GSF
Definition: PFBlockElement.h:37
reco::PFBlockElement::convRefs
virtual const ConversionRefVector & convRefs() const
Definition: PFBlockElement.h:92
PFDisplacedTrackerVertex.h
reco::PFBlockElement::DEFAULT
Definition: PFBlockElement.h:47
reco::PFBlockElement::ECAL
Definition: PFBlockElement.h:35
reco::PFBlockElement::clone
virtual PFBlockElement * clone() const =0
necessary to have the edm::OwnVector<PFBlockElement> working
reco::PFBlockElement::BREM
Definition: PFBlockElement.h:38
reco::PFBlockElement::timeError
float timeError() const
Definition: PFBlockElement.h:127
reco::PFBlockElement::trackRef
virtual const reco::TrackRef & trackRef() const
Definition: PFBlockElement.h:88
reco::PFBlockElement::muonRef
virtual const MuonRef & muonRef() const
Definition: PFBlockElement.h:93
PFClusterFwd.h
value
Definition: value.py:1
reco::PFBlockElement::T_FROM_GAMMACONV
Definition: PFBlockElement.h:47
reco::operator<<
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
reco::PFBlockElement::HFHAD
Definition: PFBlockElement.h:40
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
reco::PFBlockElement::nullPFRecTrack_
const static PFRecTrackRef nullPFRecTrack_
Definition: PFBlockElement.h:157
reco::PFBlockElement::displacedVertexRef
virtual const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const
Definition: PFBlockElement.h:91
type
type
Definition: HCALResponse.h:21
reco::PFMultiLinksTC::isValid
bool isValid
Definition: PFMultilinksTC.h:16
reco::PFBlockElement::nullMuon_
const static MuonRef nullMuon_
Definition: PFBlockElement.h:161
PFMultilinksTC.h
reco::PFBlockElement::setMultilinksList
void setMultilinksList(const PFMultilinksType &links)
Definition: PFBlockElement.h:116
reco::PFBlockElement::kNBETypes
Definition: PFBlockElement.h:44
electronStore.links
links
Definition: electronStore.py:149
reco::PFBlockElement::setIsValidMultilinks
void setIsValidMultilinks(bool isVal)
Definition: PFBlockElement.h:115
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69
PFRecTrackFwd.h
reco::PFBlockElement::locked_
bool locked_
Definition: PFBlockElement.h:142
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
reco::PFBlockElement::PS1
Definition: PFBlockElement.h:33
reco::PFBlockElement::index
unsigned index() const
Definition: PFBlockElement.h:86
reco::PFBlockElement::setDisplacedVertexRef
virtual void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef &niref, TrackType trType)
Definition: PFBlockElement.h:95
VertexCompositeCandidateFwd.h
reco::PFBlockElement::nullPFDispVertex_
const static PFDisplacedTrackerVertexRef nullPFDispVertex_
Definition: PFBlockElement.h:159
reco::PFBlockElement::timeError_
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFBlockElement.h:154
reco::PFBlockElement::setTrackType
virtual void setTrackType(TrackType trType, bool value)
\set the trackType
Definition: PFBlockElement.h:75
reco::PFBlockElement::lock
void lock()
lock element
Definition: PFBlockElement.h:63
reco::PFBlockElement::PFBlockElement
PFBlockElement(Type type=NONE)
standard constructor
Definition: PFBlockElement.h:50
reco::PFBlockElement::PS2
Definition: PFBlockElement.h:34
reco::PFBlockElement::setV0Ref
virtual void setV0Ref(const VertexCompositeCandidateRef &v0ref, TrackType trType)
Definition: PFBlockElement.h:105
reco::PFBlockElement::isMultilinksValide
bool isMultilinksValide() const
Definition: PFBlockElement.h:118
reco::PFBlockElement::clusterRef
virtual const PFClusterRef & clusterRef() const
Definition: PFBlockElement.h:90
reco::PFBlockElement::locked
bool locked() const
locked ?
Definition: PFBlockElement.h:80
Conversion.h