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 
18  public:
19 
21 
23 
24  PFBlockElement* clone() const override { return new PFBlockElementTrack(*this); }
25 
26  void Dump(std::ostream& out = std::cout,
27  const char* tab = " " ) const override;
28 
30  bool trackType(TrackType trType) const override {
31  return (trackType_>>trType) & 1;
32  }
33 
35  void setTrackType(TrackType trType, bool value) override {
36  if(value) trackType_ = trackType_ | (1<<trType);
37  else trackType_ = trackType_ ^ (1<<trType);
38  }
39 
40 
42  void setPositionAtECALEntrance(float x, float y, float z) {
43  positionAtECALEntrance_.SetCoordinates(x, y, z);
44  }
45 
46 
50  }
51 
54  const PFRecTrackRef& trackRefPF() const override { return trackRefPF_; }
55 
57  const reco::TrackRef& trackRef() const override { return trackRef_; }
58 
60  bool isSecondary() const override {
61  return
65  }
66 
67  bool isPrimary() const override{
68  return trackType(T_TO_DISP);
69  }
70 
71  bool isLinkedToDisplacedVertex() const override{
72  return isSecondary() || isPrimary();
73  }
74 
77  displacedVertexRef(TrackType trType) const override {
78  if (trType == T_TO_DISP)
80  else if (trType == T_FROM_DISP)
82  else return nullPFDispVertex_;
83  }
84 
86  void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef& niref, TrackType trType) override {
87 
88  if (trType == T_TO_DISP) {
89  displacedVertexDaughterRef_ = niref; setTrackType(trType,true);}
90  else if (trType == T_FROM_DISP) {
91  displacedVertexMotherRef_ = niref; setTrackType(trType,true);}
92  }
93 
95  const reco::MuonRef& muonRef() const override { return muonRef_; }
96 
98  void setMuonRef(const MuonRef& muref) override {
99  muonRef_=muref; setTrackType(MUON,true);
100  }
101 
103  const ConversionRefVector& convRefs() const override {return convRefs_;}
104 
106  void setConversionRef(const ConversionRef& convRef, TrackType trType) override {
107  convRefs_.push_back(convRef); setTrackType(trType,true);
108  }
109 
111  const VertexCompositeCandidateRef& V0Ref() const override {return v0Ref_;}
112 
114  void setV0Ref(const VertexCompositeCandidateRef& V0Ref, TrackType trType) override {
115  v0Ref_ = V0Ref; setTrackType(trType,true);
116  }
117 
118 
119 
120  private:
121 
124 
127 
128  unsigned int trackType_;
129 
132 
135 
138 
141 
144 
147  };
148 }
149 
150 #endif
151 
Abstract base class for a PFBlock element (track, cluster...)
ConversionRefVector convRefs_
reference to reco conversion
bool isSecondary() const override
check if the track is secondary
const reco::TrackRef & trackRef() const override
PFRecTrackRef trackRefPF_
reference to the corresponding track (transient)
const ConversionRefVector & convRefs() const override
static const PFDisplacedTrackerVertexRef nullPFDispVertex_
bool trackType(TrackType trType) const override
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
reco::TrackRef trackRef_
reference to the corresponding track
void setTrackType(TrackType trType, bool value) override
the trackType
const math::XYZPointF & positionAtECALEntrance() const
void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef &niref, TrackType trType) override
the ref to the displaced vertex interaction
VertexCompositeCandidateRef v0Ref_
reference to V0
bool isPrimary() const override
const VertexCompositeCandidateRef & V0Ref() const override
void setPositionAtECALEntrance(float x, float y, float z)
set position at ECAL entrance
Definition: value.py:1
bool isLinkedToDisplacedVertex() const override
const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const override
reco::MuonRef muonRef_
reference to the corresponding muon
PFDisplacedTrackerVertexRef displacedVertexDaughterRef_
reference to the corresponding pf displaced vertex which this track was created
PFDisplacedTrackerVertexRef displacedVertexMotherRef_
reference to the corresponding pf displaced vertex where this track was created
fixed size matrix
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element
const PFRecTrackRef & trackRefPF() const override
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
void setMuonRef(const MuonRef &muref) override
reference to the Muon
void setV0Ref(const VertexCompositeCandidateRef &V0Ref, TrackType trType) override
the ref to V0
void setConversionRef(const ConversionRef &convRef, TrackType trType) override
the ref to gamma conversion
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance
const reco::MuonRef & muonRef() const override
PFBlockElement * clone() const override
necessary to have the edm::OwnVector<PFBlockElement> working