CMS 3D CMS Logo

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
reco::PFBlockElementTrack::trackType
bool trackType(TrackType trType) const override
Definition: PFBlockElementTrack.h:28
reco::PFBlockElementTrack::v0Ref_
VertexCompositeCandidateRef v0Ref_
reference to V0
Definition: PFBlockElementTrack.h:137
reco::PFBlockElementTrack::convRefs_
ConversionRefVector convRefs_
reference to reco conversion
Definition: PFBlockElementTrack.h:134
reco::PFBlockElementTrack::V0Ref
const VertexCompositeCandidateRef & V0Ref() const override
Definition: PFBlockElementTrack.h:104
reco::PFBlockElementTrack::isLinkedToDisplacedVertex
bool isLinkedToDisplacedVertex() const override
Definition: PFBlockElementTrack.h:62
reco::PFBlockElement::T_TO_DISP
Definition: PFBlockElement.h:47
gather_cfg.cout
cout
Definition: gather_cfg.py:144
reco::PFBlockElementTrack::trackRef_
reco::TrackRef trackRef_
reference to the corresponding track
Definition: PFBlockElementTrack.h:117
reco::PFBlockElementTrack::setTrackType
void setTrackType(TrackType trType, bool value) override
\set the trackType
Definition: PFBlockElementTrack.h:31
reco::PFBlockElementTrack::trackRef
const reco::TrackRef & trackRef() const override
Definition: PFBlockElementTrack.h:49
reco::PFBlockElementTrack::muonRef_
reco::MuonRef muonRef_
reference to the corresponding muon
Definition: PFBlockElementTrack.h:131
edm::RefVector< ConversionCollection >
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Ref< PFRecTrackCollection >
reco::PFBlockElementTrack::Dump
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element
Definition: PFBlockElementTrack.cc:27
reco::PFBlockElementTrack::displacedVertexRef
const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const override
Definition: PFBlockElementTrack.h:65
reco::PFBlockElementTrack::kLinkedToDisplacedVertexMask
static constexpr unsigned int kLinkedToDisplacedVertexMask
Definition: PFBlockElementTrack.h:55
TrackFwd.h
reco::PFBlockElement::MUON
Definition: PFBlockElement.h:47
reco::PFBlockElementTrack::trackRefPF
const PFRecTrackRef & trackRefPF() const override
Definition: PFBlockElementTrack.h:46
reco::PFBlockElementTrack::setMuonRef
void setMuonRef(const MuonRef &muref) override
\set reference to the Muon
Definition: PFBlockElementTrack.h:89
reco::PFBlockElementTrack::displacedVertexDaughterRef_
PFDisplacedTrackerVertexRef displacedVertexDaughterRef_
reference to the corresponding pf displaced vertex which this track was created
Definition: PFBlockElementTrack.h:128
PFBlockElement.h
reco::PFBlockElementTrack::trackRefPF_
PFRecTrackRef trackRefPF_
reference to the corresponding track (transient)
Definition: PFBlockElementTrack.h:114
reco::PFBlockElement::T_FROM_V0
Definition: PFBlockElement.h:47
reco::PFBlockElement::TrackType
TrackType
Definition: PFBlockElement.h:47
reco::PFBlockElement::T_FROM_DISP
Definition: PFBlockElement.h:47
reco::PFBlockElementTrack::trackType_
unsigned int trackType_
Definition: PFBlockElementTrack.h:119
reco::PFBlockElementTrack::positionAtECALEntrance
const math::XYZPointF & positionAtECALEntrance() const
Definition: PFBlockElementTrack.h:42
reco::PFBlockElementTrack::setDisplacedVertexRef
void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef &niref, TrackType trType) override
\set the ref to the displaced vertex interaction
Definition: PFBlockElementTrack.h:75
reco::PFBlockElementTrack::setConversionRef
void setConversionRef(const ConversionRef &convRef, TrackType trType) override
\set the ref to gamma conversion
Definition: PFBlockElementTrack.h:98
reco::PFBlockElementTrack::kSecondaryMask
static constexpr unsigned int kSecondaryMask
Definition: PFBlockElementTrack.h:53
reco::PFBlockElementTrack::displacedVertexMotherRef_
PFDisplacedTrackerVertexRef displacedVertexMotherRef_
reference to the corresponding pf displaced vertex where this track was created
Definition: PFBlockElementTrack.h:125
value
Definition: value.py:1
reco::PFBlockElement::T_FROM_GAMMACONV
Definition: PFBlockElement.h:47
reco::PFBlockElementTrack::setPositionAtECALEntrance
void setPositionAtECALEntrance(float x, float y, float z)
set position at ECAL entrance
Definition: PFBlockElementTrack.h:39
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
reco::PFBlockElementTrack::kPrimaryMask
static constexpr unsigned int kPrimaryMask
Definition: PFBlockElementTrack.h:51
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
reco::PFBlockElementTrack::positionAtECALEntrance_
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance
Definition: PFBlockElementTrack.h:122
reco::PFBlockElementTrack
Track Element.
Definition: PFBlockElementTrack.h:17
Point3D.h
reco::PFBlockElementTrack::muonRef
const reco::MuonRef & muonRef() const override
Definition: PFBlockElementTrack.h:86
PFRecTrackFwd.h
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
math::XYZPointF
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
reco::PFBlockElement::nullPFDispVertex_
const static PFDisplacedTrackerVertexRef nullPFDispVertex_
Definition: PFBlockElement.h:165
reco::PFBlockElementTrack::isSecondary
bool isSecondary() const override
check if the track is secondary
Definition: PFBlockElementTrack.h:58
reco::PFBlockElementTrack::isPrimary
bool isPrimary() const override
Definition: PFBlockElementTrack.h:60
reco::PFBlockElementTrack::PFBlockElementTrack
PFBlockElementTrack()
Definition: PFBlockElementTrack.h:19
reco::PFBlockElementTrack::clone
PFBlockElement * clone() const override
necessary to have the edm::OwnVector<PFBlockElement> working
Definition: PFBlockElementTrack.h:23
reco::PFBlockElementTrack::convRefs
const ConversionRefVector & convRefs() const override
Definition: PFBlockElementTrack.h:95
reco::PFBlockElementTrack::setV0Ref
void setV0Ref(const VertexCompositeCandidateRef &V0Ref, TrackType trType) override
\set the ref to V0
Definition: PFBlockElementTrack.h:107