CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PFBlockElementTrack.h
Go to the documentation of this file.
1 #ifndef __PFBlockElementTrack__
2 #define __PFBlockElementTrack__
3 
4 #include <iostream>
5 
7 
11 
12 namespace reco {
13 
17  class PFBlockElementTrack final : public PFBlockElement {
18  public:
20 
22 
23  PFBlockElement* clone() const override { return new PFBlockElementTrack(*this); }
24 
25  void Dump(std::ostream& out = std::cout, const char* tab = " ") const override;
26 
28  bool trackType(TrackType trType) const override { return (trackType_ >> trType) & 1; }
29 
31  void setTrackType(TrackType trType, bool value) override {
32  if (value)
33  trackType_ = trackType_ | (1 << trType);
34  else
35  trackType_ = trackType_ ^ (1 << trType);
36  }
37 
39  void setPositionAtECALEntrance(float x, float y, float z) { positionAtECALEntrance_.SetCoordinates(x, y, z); }
40 
43 
46  const PFRecTrackRef& trackRefPF() const override { return trackRefPF_; }
47 
49  const reco::TrackRef& trackRef() const override { return trackRef_; }
50 
51  static constexpr unsigned int kPrimaryMask = 1 << T_TO_DISP;
52 
53  static constexpr unsigned int kSecondaryMask = (1 << T_FROM_DISP) | (1 << T_FROM_GAMMACONV) | (1 << T_FROM_V0);
54 
55  static constexpr unsigned int kLinkedToDisplacedVertexMask = kPrimaryMask | kSecondaryMask;
56 
58  bool isSecondary() const override { return trackType_ & kSecondaryMask; }
59 
60  bool isPrimary() const override { return trackType_ & kPrimaryMask; }
61 
63 
66  if (trType == T_TO_DISP)
68  else if (trType == T_FROM_DISP)
70  else
71  return nullPFDispVertex_;
72  }
73 
75  void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef& niref, TrackType trType) override {
76  if (trType == T_TO_DISP) {
78  setTrackType(trType, true);
79  } else if (trType == T_FROM_DISP) {
81  setTrackType(trType, true);
82  }
83  }
84 
86  const reco::MuonRef& muonRef() const override { return muonRef_; }
87 
89  void setMuonRef(const MuonRef& muref) override {
90  muonRef_ = muref;
91  setTrackType(MUON, true);
92  }
93 
95  const ConversionRefVector& convRefs() const override { return convRefs_; }
96 
98  void setConversionRef(const ConversionRef& convRef, TrackType trType) override {
99  convRefs_.push_back(convRef);
100  setTrackType(trType, true);
101  }
102 
104  const VertexCompositeCandidateRef& V0Ref() const override { return v0Ref_; }
105 
107  void setV0Ref(const VertexCompositeCandidateRef& V0Ref, TrackType trType) override {
108  v0Ref_ = V0Ref;
109  setTrackType(trType, true);
110  }
111 
112  private:
115 
118 
119  unsigned int trackType_;
120 
123 
126 
129 
132 
135 
138  };
139 } // namespace reco
140 
141 #endif
Abstract base class for a PFBlock element (track, cluster...)
const ConversionRefVector & convRefs() const override
const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const override
bool isPrimary() const override
ConversionRefVector convRefs_
reference to reco conversion
static constexpr unsigned int kLinkedToDisplacedVertexMask
PFRecTrackRef trackRefPF_
reference to the corresponding track (transient)
static const PFDisplacedTrackerVertexRef nullPFDispVertex_
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
PFBlockElement * clone() const override
necessary to have the edm::OwnVector&lt;PFBlockElement&gt; working
reco::TrackRef trackRef_
reference to the corresponding track
void setTrackType(TrackType trType, bool value) override
the trackType
const math::XYZPointF & positionAtECALEntrance() const
const VertexCompositeCandidateRef & V0Ref() const override
void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef &niref, TrackType trType) override
the ref to the displaced vertex interaction
bool trackType(TrackType trType) const override
VertexCompositeCandidateRef v0Ref_
reference to V0
const reco::MuonRef & muonRef() const override
void setPositionAtECALEntrance(float x, float y, float z)
set position at ECAL entrance
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element
static constexpr unsigned int kPrimaryMask
bool isSecondary() const override
check if the track is secondary
bool isLinkedToDisplacedVertex() const override
static constexpr unsigned int kSecondaryMask
reco::MuonRef muonRef_
reference to the corresponding muon
PFDisplacedTrackerVertexRef displacedVertexDaughterRef_
reference to the corresponding pf displaced vertex which this track was created
const reco::TrackRef & trackRef() const override
PFDisplacedTrackerVertexRef displacedVertexMotherRef_
reference to the corresponding pf displaced vertex where this track was created
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:67
void setMuonRef(const MuonRef &muref) override
reference to the Muon
void setV0Ref(const VertexCompositeCandidateRef &V0Ref, TrackType trType) override
the ref to V0
tuple cout
Definition: gather_cfg.py:144
void setConversionRef(const ConversionRef &convRef, TrackType trType) override
the ref to gamma conversion
const PFRecTrackRef & trackRefPF() const override
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance