CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Attributes
reco::PFBlockElementTrack Class Referencefinal

Track Element. More...

#include <PFBlockElementTrack.h>

Inheritance diagram for reco::PFBlockElementTrack:
reco::PFBlockElement

Public Member Functions

PFBlockElementclone () const override
 necessary to have the edm::OwnVector<PFBlockElement> working More...
 
const ConversionRefVectorconvRefs () const override
 
const PFDisplacedTrackerVertexRefdisplacedVertexRef (TrackType trType) const override
 
void Dump (std::ostream &out=std::cout, const char *tab=" ") const override
 print the object inside the element More...
 
bool isLinkedToDisplacedVertex () const override
 
bool isPrimary () const override
 
bool isSecondary () const override
 check if the track is secondary More...
 
const reco::MuonRefmuonRef () const override
 
 PFBlockElementTrack ()
 
 PFBlockElementTrack (const PFRecTrackRef &ref)
 
const math::XYZPointFpositionAtECALEntrance () const
 
void setConversionRef (const ConversionRef &convRef, TrackType trType) override
 the ref to gamma conversion More...
 
void setDisplacedVertexRef (const PFDisplacedTrackerVertexRef &niref, TrackType trType) override
 the ref to the displaced vertex interaction More...
 
void setMuonRef (const MuonRef &muref) override
 reference to the Muon More...
 
void setPositionAtECALEntrance (float x, float y, float z)
 set position at ECAL entrance More...
 
void setTrackType (TrackType trType, bool value) override
 the trackType More...
 
void setV0Ref (const VertexCompositeCandidateRef &V0Ref, TrackType trType) override
 the ref to V0 More...
 
const reco::TrackReftrackRef () const override
 
const PFRecTrackReftrackRefPF () const override
 
bool trackType (TrackType trType) const override
 
const VertexCompositeCandidateRefV0Ref () const override
 
- Public Member Functions inherited from reco::PFBlockElement
virtual const PFClusterRefclusterRef () const
 
const PFMultilinksTypegetMultilinks (Type type) const
 
unsigned index () const
 
bool isMultilinksValide (Type type) const
 
bool isTimeValid () const
 do we have a valid time information More...
 
void lock ()
 lock element More...
 
bool locked () const
 locked ? More...
 
 PFBlockElement (Type type=NONE)
 standard constructor More...
 
void setIndex (unsigned index)
 set index More...
 
void setIsValidMultilinks (bool isVal, Type type)
 
void setMultilinks (const PFMultiLinksTC &ml, Type type)
 
void setTime (float time, float timeError=0.f)
 the timing information More...
 
float time () const
 
float timeError () const
 
Type type () const
 
void unLock ()
 unlock element More...
 
virtual ~PFBlockElement ()
 destructor More...
 

Static Public Attributes

static constexpr unsigned int kLinkedToDisplacedVertexMask = kPrimaryMask | kSecondaryMask
 
static constexpr unsigned int kPrimaryMask = 1 << T_TO_DISP
 
static constexpr unsigned int kSecondaryMask = (1 << T_FROM_DISP) | (1 << T_FROM_GAMMACONV) | (1 << T_FROM_V0)
 

Private Attributes

ConversionRefVector convRefs_
 reference to reco conversion More...
 
PFDisplacedTrackerVertexRef displacedVertexDaughterRef_
 reference to the corresponding pf displaced vertex which this track was created More...
 
PFDisplacedTrackerVertexRef displacedVertexMotherRef_
 reference to the corresponding pf displaced vertex where this track was created More...
 
reco::MuonRef muonRef_
 reference to the corresponding muon More...
 
math::XYZPointF positionAtECALEntrance_
 position at ECAL entrance More...
 
reco::TrackRef trackRef_
 reference to the corresponding track More...
 
PFRecTrackRef trackRefPF_
 reference to the corresponding track (transient) More...
 
unsigned int trackType_
 
VertexCompositeCandidateRef v0Ref_
 reference to V0 More...
 

Additional Inherited Members

- Public Types inherited from reco::PFBlockElement
enum  TrackType {
  DEFAULT = 0, T_FROM_DISP, T_TO_DISP, T_FROM_GAMMACONV,
  MUON, T_FROM_V0
}
 
enum  Type {
  NONE = 0, TRACK = 1, PS1 = 2, PS2 = 3,
  ECAL = 4, HCAL = 5, GSF = 6, BREM = 7,
  HFEM = 8, HFHAD = 9, SC = 10, HO = 11,
  HGCAL = 12, kNBETypes = 13
}
 
- Protected Attributes inherited from reco::PFBlockElement
unsigned index_
 index in block vector More...
 
bool locked_
 
std::map< reco::PFBlockElement::Type, PFMultiLinksTCmultilinks_
 
float time_
 timing information (valid if timeError_ >= 0) More...
 
float timeError_
 timing information uncertainty (<0 if timing not available) More...
 
Type type_
 
- Static Protected Attributes inherited from reco::PFBlockElement
static const ConversionRefVector nullConv_ = reco::ConversionRefVector()
 
static const MuonRef nullMuon_ = reco::MuonRef()
 
static const PFClusterRef nullPFCluster_ = reco::PFClusterRef()
 
static const PFDisplacedTrackerVertexRef nullPFDispVertex_ = reco::PFDisplacedTrackerVertexRef()
 
static const PFRecTrackRef nullPFRecTrack_ = reco::PFRecTrackRef()
 
static const reco::TrackRef nullTrack_ = reco::TrackRef()
 
static const VertexCompositeCandidateRef nullVertex_ = reco::VertexCompositeCandidateRef()
 

Detailed Description

Track Element.

this class contains a reference to a PFRecTrack

Definition at line 17 of file PFBlockElementTrack.h.

Constructor & Destructor Documentation

◆ PFBlockElementTrack() [1/2]

reco::PFBlockElementTrack::PFBlockElementTrack ( )
inline

Definition at line 19 of file PFBlockElementTrack.h.

Referenced by clone().

19 {}

◆ PFBlockElementTrack() [2/2]

PFBlockElementTrack::PFBlockElementTrack ( const PFRecTrackRef ref)

Definition at line 12 of file PFBlockElementTrack.cc.

References reco::PFBlockElement::DEFAULT, reco::PFTrajectoryPoint::ECALEntrance, edm::Ref< C, T, F >::isNull(), reco::PFTrajectoryPoint::isValid(), reco::PFTrajectoryPoint::position(), positionAtECALEntrance_, and setTrackType().

13  : PFBlockElement(TRACK), trackRefPF_(ref), trackRef_(ref->trackRef()), trackType_(0) {
14  if (ref.isNull())
15  throw cms::Exception("NullRef") << " PFBlockElementTrack constructed from a null reference to PFRecTrack.";
16 
17  const reco::PFTrajectoryPoint& atECAL = ref->extrapolatedPoint(reco::PFTrajectoryPoint::ECALEntrance);
18 
19  if (atECAL.isValid())
20  positionAtECALEntrance_.SetCoordinates(atECAL.position().x(), atECAL.position().y(), atECAL.position().z());
21  // if the position at ecal entrance is invalid,
22  // positionAtECALEntrance_ is initialized by default to 0,0,0
23 
24  setTrackType(DEFAULT, true);
25 }
PFRecTrackRef trackRefPF_
reference to the corresponding track (transient)
reco::TrackRef trackRef_
reference to the corresponding track
void setTrackType(TrackType trType, bool value) override
the trackType
PFBlockElement(Type type=NONE)
standard constructor
bool isValid() const
is this point valid ?
bool isNull() const
Checks for null.
Definition: Ref.h:235
const math::XYZPoint & position() const
cartesian position (x, y, z)
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance

Member Function Documentation

◆ clone()

PFBlockElement* reco::PFBlockElementTrack::clone ( ) const
inlineoverridevirtual

necessary to have the edm::OwnVector<PFBlockElement> working

Implements reco::PFBlockElement.

Definition at line 23 of file PFBlockElementTrack.h.

References PFBlockElementTrack().

23 { return new PFBlockElementTrack(*this); }

◆ convRefs()

const ConversionRefVector& reco::PFBlockElementTrack::convRefs ( ) const
inlineoverridevirtual
Returns
ref to original recoConversion

Reimplemented from reco::PFBlockElement.

Definition at line 95 of file PFBlockElementTrack.h.

References convRefs_.

Referenced by GeneralTracksImporter::importToBlock().

95 { return convRefs_; }
ConversionRefVector convRefs_
reference to reco conversion

◆ displacedVertexRef()

const PFDisplacedTrackerVertexRef& reco::PFBlockElementTrack::displacedVertexRef ( TrackType  trType) const
inlineoverridevirtual
Returns
the displaced vertex associated

Reimplemented from reco::PFBlockElement.

Definition at line 65 of file PFBlockElementTrack.h.

References displacedVertexDaughterRef_, displacedVertexMotherRef_, reco::PFBlockElement::nullPFDispVertex_, reco::PFBlockElement::T_FROM_DISP, and reco::PFBlockElement::T_TO_DISP.

Referenced by GeneralTracksImporter::importToBlock().

65  {
66  if (trType == T_TO_DISP)
68  else if (trType == T_FROM_DISP)
70  else
71  return nullPFDispVertex_;
72  }
static const PFDisplacedTrackerVertexRef nullPFDispVertex_
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

◆ Dump()

void PFBlockElementTrack::Dump ( std::ostream &  out = std::cout,
const char *  tab = " " 
) const
overridevirtual

print the object inside the element

Reimplemented from reco::PFBlockElement.

Definition at line 27 of file PFBlockElementTrack.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, alignBH_cfg::fixed, edm::Ref< C, T, F >::isNull(), MillePedeFileConverter_cfg::out, AlCaHLTBitMon_ParallelJobs::p, DiDispStaMuonMonitor_cfi::pt, alignCSCRings::s, and trackRef_.

27  {
28  if (!out)
29  return;
30 
31  if (!trackRef_.isNull()) {
32  double charge = trackRef_->charge();
33  double pt = trackRef_->pt();
34  double p = trackRef_->p();
35  string s = " at vertex";
36  double tracketa = trackRef_->eta();
37  double trackphi = trackRef_->phi();
38 
39  // COLIN
40  // the following lines rely on the presence of the PFRecTrack,
41  // which for most people is not there (PFRecTracks are transient)
42  // commented these lines out to remove the spurious error message
43  // for the missing PFRecTrack product
44  // const reco::PFTrajectoryPoint& atECAL
45  // = trackRefPF_->extrapolatedPoint( reco::PFTrajectoryPoint::ECALShowerMax );
46  // // check if reach ecal Shower max
47  // if( atECAL.isValid() ) {
48  // s = " at ECAL shower max";
49  // tracketa = atECAL.position().Eta();
50  // trackphi = atECAL.position().Phi();
51  // }
52 
53  out << setprecision(0);
54  out << tab << setw(7) << "charge=" << setw(3) << charge;
55  out << setprecision(3);
56  out << setiosflags(ios::right);
57  out << setiosflags(ios::fixed);
58  out << ", pT =" << setw(7) << pt;
59  out << ", p =" << setw(7) << p;
60  out << " (eta,phi)= (";
61  out << tracketa << ",";
62  out << trackphi << ")" << s;
63 
64  out << resetiosflags(ios::right | ios::fixed);
65  }
66 }
reco::TrackRef trackRef_
reference to the corresponding track
bool isNull() const
Checks for null.
Definition: Ref.h:235

◆ isLinkedToDisplacedVertex()

bool reco::PFBlockElementTrack::isLinkedToDisplacedVertex ( ) const
inlineoverridevirtual

Reimplemented from reco::PFBlockElement.

Definition at line 62 of file PFBlockElementTrack.h.

References kLinkedToDisplacedVertexMask, and trackType_.

Referenced by TrackAndGSFLinker::testLink().

static constexpr unsigned int kLinkedToDisplacedVertexMask

◆ isPrimary()

bool reco::PFBlockElementTrack::isPrimary ( ) const
inlineoverridevirtual

Reimplemented from reco::PFBlockElement.

Definition at line 60 of file PFBlockElementTrack.h.

References kPrimaryMask, and trackType_.

60 { return trackType_ & kPrimaryMask; }
static constexpr unsigned int kPrimaryMask

◆ isSecondary()

bool reco::PFBlockElementTrack::isSecondary ( ) const
inlineoverridevirtual

check if the track is secondary

Reimplemented from reco::PFBlockElement.

Definition at line 58 of file PFBlockElementTrack.h.

References kSecondaryMask, and trackType_.

58 { return trackType_ & kSecondaryMask; }
static constexpr unsigned int kSecondaryMask

◆ muonRef()

const reco::MuonRef& reco::PFBlockElementTrack::muonRef ( ) const
inlineoverridevirtual
Returns
reference to the corresponding Muon

Reimplemented from reco::PFBlockElement.

Definition at line 86 of file PFBlockElementTrack.h.

References muonRef_.

Referenced by PFMuonAlgo::isGlobalLooseMuon(), PFMuonAlgo::isGlobalTightMuon(), PFMuonAlgo::isIsolatedMuon(), PFMuonAlgo::isLooseMuon(), PFMuonAlgo::isTrackerTightMuon(), and reco::mlpf::setCandidateRefs().

86 { return muonRef_; }
reco::MuonRef muonRef_
reference to the corresponding muon

◆ positionAtECALEntrance()

const math::XYZPointF& reco::PFBlockElementTrack::positionAtECALEntrance ( ) const
inline
Returns
position at ECAL entrance

Definition at line 42 of file PFBlockElementTrack.h.

References positionAtECALEntrance_.

Referenced by PFEGammaAlgo::fillPFCandidates().

42 { return positionAtECALEntrance_; }
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance

◆ setConversionRef()

void reco::PFBlockElementTrack::setConversionRef ( const ConversionRef convRef,
TrackType  trType 
)
inlineoverridevirtual

the ref to gamma conversion

Reimplemented from reco::PFBlockElement.

Definition at line 98 of file PFBlockElementTrack.h.

References convRefs_, edm::RefVector< C, T, F >::push_back(), and setTrackType().

98  {
99  convRefs_.push_back(convRef);
100  setTrackType(trType, true);
101  }
ConversionRefVector convRefs_
reference to reco conversion
void setTrackType(TrackType trType, bool value) override
the trackType
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67

◆ setDisplacedVertexRef()

void reco::PFBlockElementTrack::setDisplacedVertexRef ( const PFDisplacedTrackerVertexRef niref,
TrackType  trType 
)
inlineoverridevirtual

the ref to the displaced vertex interaction

Reimplemented from reco::PFBlockElement.

Definition at line 75 of file PFBlockElementTrack.h.

References displacedVertexDaughterRef_, displacedVertexMotherRef_, setTrackType(), reco::PFBlockElement::T_FROM_DISP, and reco::PFBlockElement::T_TO_DISP.

75  {
76  if (trType == T_TO_DISP) {
78  setTrackType(trType, true);
79  } else if (trType == T_FROM_DISP) {
81  setTrackType(trType, true);
82  }
83  }
void setTrackType(TrackType trType, bool value) override
the trackType
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

◆ setMuonRef()

void reco::PFBlockElementTrack::setMuonRef ( const MuonRef muref)
inlineoverridevirtual

reference to the Muon

Reimplemented from reco::PFBlockElement.

Definition at line 89 of file PFBlockElementTrack.h.

References reco::PFBlockElement::MUON, muonRef_, and setTrackType().

Referenced by GeneralTracksImporter::importToBlock().

89  {
90  muonRef_ = muref;
91  setTrackType(MUON, true);
92  }
void setTrackType(TrackType trType, bool value) override
the trackType
reco::MuonRef muonRef_
reference to the corresponding muon

◆ setPositionAtECALEntrance()

void reco::PFBlockElementTrack::setPositionAtECALEntrance ( float  x,
float  y,
float  z 
)
inline

set position at ECAL entrance

Definition at line 39 of file PFBlockElementTrack.h.

References positionAtECALEntrance_, and x.

Referenced by PFAlgo::createCandidatesHCAL(), and PFAlgo::recoTracksNotHCAL().

39 { positionAtECALEntrance_.SetCoordinates(x, y, z); }
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance

◆ setTrackType()

void reco::PFBlockElementTrack::setTrackType ( TrackType  trType,
bool  value 
)
inlineoverridevirtual

the trackType

Reimplemented from reco::PFBlockElement.

Definition at line 31 of file PFBlockElementTrack.h.

References trackType_.

Referenced by PFBlockElementTrack(), setConversionRef(), setDisplacedVertexRef(), setMuonRef(), and setV0Ref().

31  {
32  if (value)
33  trackType_ = trackType_ | (1 << trType);
34  else
35  trackType_ = trackType_ ^ (1 << trType);
36  }
Definition: value.py:1

◆ setV0Ref()

void reco::PFBlockElementTrack::setV0Ref ( const VertexCompositeCandidateRef V0Ref,
TrackType  trType 
)
inlineoverridevirtual

the ref to V0

Reimplemented from reco::PFBlockElement.

Definition at line 107 of file PFBlockElementTrack.h.

References setTrackType(), V0Ref(), and v0Ref_.

107  {
108  v0Ref_ = V0Ref;
109  setTrackType(trType, true);
110  }
void setTrackType(TrackType trType, bool value) override
the trackType
const VertexCompositeCandidateRef & V0Ref() const override
VertexCompositeCandidateRef v0Ref_
reference to V0

◆ trackRef()

const reco::TrackRef& reco::PFBlockElementTrack::trackRef ( ) const
inlineoverridevirtual
Returns
reference to the corresponding Track

Reimplemented from reco::PFBlockElement.

Definition at line 49 of file PFBlockElementTrack.h.

References trackRef_.

Referenced by GeneralTracksImporter::importToBlock(), PFEGammaAlgo::removeOrLinkECALClustersToKFTracks(), and TrackAndHOLinker::testLink().

49 { return trackRef_; }
reco::TrackRef trackRef_
reference to the corresponding track

◆ trackRefPF()

const PFRecTrackRef& reco::PFBlockElementTrack::trackRefPF ( ) const
inlineoverridevirtual
Returns
reference to the corresponding PFRecTrack please do not use this function after the block production stage!

Reimplemented from reco::PFBlockElement.

Definition at line 46 of file PFBlockElementTrack.h.

References trackRefPF_.

Referenced by PFEGammaAlgo::isPrimaryTrack(), TrackAndHOLinker::testLink(), TrackAndGSFLinker::testLink(), TrackAndECALLinker::testLink(), and TrackAndHCALLinker::testLink().

46 { return trackRefPF_; }
PFRecTrackRef trackRefPF_
reference to the corresponding track (transient)

◆ trackType()

bool reco::PFBlockElementTrack::trackType ( TrackType  trType) const
inlineoverridevirtual

◆ V0Ref()

const VertexCompositeCandidateRef& reco::PFBlockElementTrack::V0Ref ( ) const
inlineoverridevirtual
Returns
ref to original V0

Reimplemented from reco::PFBlockElement.

Definition at line 104 of file PFBlockElementTrack.h.

References v0Ref_.

Referenced by GeneralTracksImporter::importToBlock(), and setV0Ref().

104 { return v0Ref_; }
VertexCompositeCandidateRef v0Ref_
reference to V0

Member Data Documentation

◆ convRefs_

ConversionRefVector reco::PFBlockElementTrack::convRefs_
private

reference to reco conversion

Definition at line 134 of file PFBlockElementTrack.h.

Referenced by convRefs(), and setConversionRef().

◆ displacedVertexDaughterRef_

PFDisplacedTrackerVertexRef reco::PFBlockElementTrack::displacedVertexDaughterRef_
private

reference to the corresponding pf displaced vertex which this track was created

Definition at line 128 of file PFBlockElementTrack.h.

Referenced by displacedVertexRef(), and setDisplacedVertexRef().

◆ displacedVertexMotherRef_

PFDisplacedTrackerVertexRef reco::PFBlockElementTrack::displacedVertexMotherRef_
private

reference to the corresponding pf displaced vertex where this track was created

Definition at line 125 of file PFBlockElementTrack.h.

Referenced by displacedVertexRef(), and setDisplacedVertexRef().

◆ kLinkedToDisplacedVertexMask

constexpr unsigned int reco::PFBlockElementTrack::kLinkedToDisplacedVertexMask = kPrimaryMask | kSecondaryMask
static

Definition at line 55 of file PFBlockElementTrack.h.

Referenced by isLinkedToDisplacedVertex().

◆ kPrimaryMask

constexpr unsigned int reco::PFBlockElementTrack::kPrimaryMask = 1 << T_TO_DISP
static

Definition at line 51 of file PFBlockElementTrack.h.

Referenced by isPrimary().

◆ kSecondaryMask

constexpr unsigned int reco::PFBlockElementTrack::kSecondaryMask = (1 << T_FROM_DISP) | (1 << T_FROM_GAMMACONV) | (1 << T_FROM_V0)
static

Definition at line 53 of file PFBlockElementTrack.h.

Referenced by isSecondary().

◆ muonRef_

reco::MuonRef reco::PFBlockElementTrack::muonRef_
private

reference to the corresponding muon

Definition at line 131 of file PFBlockElementTrack.h.

Referenced by muonRef(), and setMuonRef().

◆ positionAtECALEntrance_

math::XYZPointF reco::PFBlockElementTrack::positionAtECALEntrance_
private

position at ECAL entrance

Definition at line 122 of file PFBlockElementTrack.h.

Referenced by PFBlockElementTrack(), positionAtECALEntrance(), and setPositionAtECALEntrance().

◆ trackRef_

reco::TrackRef reco::PFBlockElementTrack::trackRef_
private

reference to the corresponding track

Definition at line 117 of file PFBlockElementTrack.h.

Referenced by Dump(), and trackRef().

◆ trackRefPF_

PFRecTrackRef reco::PFBlockElementTrack::trackRefPF_
private

reference to the corresponding track (transient)

Definition at line 114 of file PFBlockElementTrack.h.

Referenced by trackRefPF().

◆ trackType_

unsigned int reco::PFBlockElementTrack::trackType_
private

◆ v0Ref_

VertexCompositeCandidateRef reco::PFBlockElementTrack::v0Ref_
private

reference to V0

Definition at line 137 of file PFBlockElementTrack.h.

Referenced by setV0Ref(), and V0Ref().