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
116 
118  const auto& it = multilinks_.find(type);
119  if (it != multilinks_.end())
120  return it->second.isValid;
121  else
122  return false; // no multilinks_ for the specified type
123  }
124  const PFMultilinksType& getMultilinks(Type type) const { return multilinks_.at(type).linkedClusters; }
125  // ! Glowinski & Gouzevitch
126 
128  bool isTimeValid() const { return timeError_ >= 0.f; }
130  float time() const { return time_; }
132  float timeError() const { return timeError_; }
134  void setTime(float time, float timeError = 0.f) {
135  time_ = time;
137  }
138 
139  protected:
143 
147  bool locked_;
148 
150  unsigned index_;
151 
152  // Glowinski & Gouzevitch
153  // PFMultiLinks for each different link target type
154  std::map<reco::PFBlockElement::Type, PFMultiLinksTC> multilinks_;
155  // ! Glowinski & Gouzevitch
156 
158  float time_;
160  float timeError_;
161 
167  const static MuonRef nullMuon_;
169  };
170 
171  std::ostream& operator<<(std::ostream& out, const PFBlockElement& element);
172 
173 } // namespace reco
174 #endif
reco::PFBlockElement::isTimeValid
bool isTimeValid() const
do we have a valid time information
Definition: PFBlockElement.h:128
reco::PFBlockElement::nullConv_
const static ConversionRefVector nullConv_
Definition: PFBlockElement.h:166
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:158
reco::PFBlockElement::trackRefPF
virtual const PFRecTrackRef & trackRefPF() const
Definition: PFBlockElement.h:89
reco::PFBlockElement::nullTrack_
const static reco::TrackRef nullTrack_
Definition: PFBlockElement.h:162
plotFactory.isVal
isVal
Definition: plotFactory.py:109
funct::false
false
Definition: Factorize.h:29
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::time
float time() const
Definition: PFBlockElement.h:130
reco::PFBlockElement::multilinks_
std::map< reco::PFBlockElement::Type, PFMultiLinksTC > multilinks_
Definition: PFBlockElement.h:154
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:168
reco::PFBlockElement::index_
unsigned index_
index in block vector
Definition: PFBlockElement.h:150
reco::PFBlockElement::setIsValidMultilinks
void setIsValidMultilinks(bool isVal, Type type)
Definition: PFBlockElement.h:115
reco::PFBlockElement::isMultilinksValide
bool isMultilinksValide(Type type) const
Definition: PFBlockElement.h:117
edm::RefVector< ConversionCollection >
reco::PFBlockElement::HGCAL
Definition: PFBlockElement.h:43
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
ConversionFwd.h
reco::PFBlockElement::nullPFCluster_
const static PFClusterRef nullPFCluster_
Definition: PFBlockElement.h:164
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:134
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
reco::PFBlockElement::setMultilinks
void setMultilinks(const PFMultiLinksTC &ml, Type type)
Definition: PFBlockElement.h:114
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::PFMultiLinksTC
Definition: PFMultilinksTC.h:14
reco::PFBlockElement::NONE
Definition: PFBlockElement.h:31
HCAL
Definition: HCAL.py:1
reco::PFBlockElement::unLock
void unLock()
unlock element
Definition: PFBlockElement.h:66
reco::PFBlockElement::type_
Type type_
Definition: PFBlockElement.h:142
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
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
reco::PFBlockElement::convRefs
virtual const ConversionRefVector & convRefs() const
Definition: PFBlockElement.h:92
edm_modernize_messagelogger.ml
ml
Definition: edm_modernize_messagelogger.py:25
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:132
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:163
reco::PFBlockElement::displacedVertexRef
virtual const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const
Definition: PFBlockElement.h:91
reco::PFBlockElement::nullMuon_
const static MuonRef nullMuon_
Definition: PFBlockElement.h:167
PFMultilinksTC.h
reco::PFBlockElement::kNBETypes
Definition: PFBlockElement.h:44
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69
PFRecTrackFwd.h
reco::PFBlockElement::locked_
bool locked_
Definition: PFBlockElement.h:147
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:165
reco::PFBlockElement::getMultilinks
const PFMultilinksType & getMultilinks(Type type) const
Definition: PFBlockElement.h:124
reco::PFBlockElement::timeError_
float timeError_
timing information uncertainty (<0 if timing not available)
Definition: PFBlockElement.h:160
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::clusterRef
virtual const PFClusterRef & clusterRef() const
Definition: PFBlockElement.h:90
reco::PFBlockElement::locked
bool locked() const
locked ?
Definition: PFBlockElement.h:80
Conversion.h