CMS 3D CMS Logo

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

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
 \set the ref to gamma conversion More...
 
void setDisplacedVertexRef (const PFDisplacedTrackerVertexRef &niref, TrackType trType) override
 \set the ref to the displaced vertex interaction More...
 
void setMuonRef (const MuonRef &muref) override
 \set 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
 \set the trackType More...
 
void setV0Ref (const VertexCompositeCandidateRef &V0Ref, TrackType trType) override
 \set 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)
 \set the timing information More...
 
float time () const
 
float timeError () const
 
Type type () const
 
void unLock ()
 unlock element More...
 
virtual ~PFBlockElement ()
 destructor More...
 

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
const static ConversionRefVector nullConv_ = reco::ConversionRefVector()
 
const static MuonRef nullMuon_ = reco::MuonRef()
 
const static PFClusterRef nullPFCluster_ = reco::PFClusterRef()
 
const static PFDisplacedTrackerVertexRef nullPFDispVertex_ = reco::PFDisplacedTrackerVertexRef()
 
const static PFRecTrackRef nullPFRecTrack_ = reco::PFRecTrackRef()
 
const static reco::TrackRef nullTrack_ = reco::TrackRef()
 
const static 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.

19 {}

Referenced by clone().

◆ PFBlockElementTrack() [2/2]

PFBlockElementTrack::PFBlockElementTrack ( const PFRecTrackRef ref)

Definition at line 12 of file PFBlockElementTrack.cc.

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 }

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

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.

23 { return new PFBlockElementTrack(*this); }

References PFBlockElementTrack().

◆ convRefs()

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

Reimplemented from reco::PFBlockElement.

Definition at line 91 of file PFBlockElementTrack.h.

91 { return convRefs_; }

References convRefs_.

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

◆ displacedVertexRef()

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

Reimplemented from reco::PFBlockElement.

Definition at line 61 of file PFBlockElementTrack.h.

61  {
62  if (trType == T_TO_DISP)
64  else if (trType == T_FROM_DISP)
66  else
67  return nullPFDispVertex_;
68  }

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

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

◆ 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.

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 }

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_.

◆ isLinkedToDisplacedVertex()

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

Reimplemented from reco::PFBlockElement.

Definition at line 58 of file PFBlockElementTrack.h.

58 { return isSecondary() || isPrimary(); }

References isPrimary(), and isSecondary().

Referenced by TrackAndGSFLinker::testLink().

◆ isPrimary()

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

Reimplemented from reco::PFBlockElement.

Definition at line 56 of file PFBlockElementTrack.h.

56 { return trackType(T_TO_DISP); }

References reco::PFBlockElement::T_TO_DISP, and trackType().

Referenced by isLinkedToDisplacedVertex().

◆ isSecondary()

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

check if the track is secondary

Reimplemented from reco::PFBlockElement.

Definition at line 52 of file PFBlockElementTrack.h.

52  {
54  }

References reco::PFBlockElement::T_FROM_DISP, reco::PFBlockElement::T_FROM_GAMMACONV, reco::PFBlockElement::T_FROM_V0, and trackType().

Referenced by isLinkedToDisplacedVertex().

◆ muonRef()

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

Reimplemented from reco::PFBlockElement.

Definition at line 82 of file PFBlockElementTrack.h.

82 { return muonRef_; }

References muonRef_.

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

◆ positionAtECALEntrance()

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

Definition at line 42 of file PFBlockElementTrack.h.

42 { return positionAtECALEntrance_; }

References positionAtECALEntrance_.

Referenced by PFEGammaAlgo::fillPFCandidates().

◆ setConversionRef()

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

\set the ref to gamma conversion

Reimplemented from reco::PFBlockElement.

Definition at line 94 of file PFBlockElementTrack.h.

94  {
95  convRefs_.push_back(convRef);
96  setTrackType(trType, true);
97  }

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

◆ setDisplacedVertexRef()

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

\set the ref to the displaced vertex interaction

Reimplemented from reco::PFBlockElement.

Definition at line 71 of file PFBlockElementTrack.h.

71  {
72  if (trType == T_TO_DISP) {
74  setTrackType(trType, true);
75  } else if (trType == T_FROM_DISP) {
77  setTrackType(trType, true);
78  }
79  }

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

◆ setMuonRef()

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

\set reference to the Muon

Reimplemented from reco::PFBlockElement.

Definition at line 85 of file PFBlockElementTrack.h.

85  {
86  muonRef_ = muref;
87  setTrackType(MUON, true);
88  }

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

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

◆ 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.

39 { positionAtECALEntrance_.SetCoordinates(x, y, z); }

References positionAtECALEntrance_.

◆ setTrackType()

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

\set the trackType

Reimplemented from reco::PFBlockElement.

Definition at line 31 of file PFBlockElementTrack.h.

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

References trackType_.

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

◆ setV0Ref()

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

\set the ref to V0

Reimplemented from reco::PFBlockElement.

Definition at line 103 of file PFBlockElementTrack.h.

103  {
104  v0Ref_ = V0Ref;
105  setTrackType(trType, true);
106  }

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

◆ trackRef()

const reco::TrackRef& reco::PFBlockElementTrack::trackRef ( ) const
inlineoverridevirtual

◆ 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.

46 { return trackRefPF_; }

References trackRefPF_.

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

◆ 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 100 of file PFBlockElementTrack.h.

100 { return v0Ref_; }

References v0Ref_.

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

Member Data Documentation

◆ convRefs_

ConversionRefVector reco::PFBlockElementTrack::convRefs_
private

reference to reco conversion

Definition at line 130 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 124 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 121 of file PFBlockElementTrack.h.

Referenced by displacedVertexRef(), and setDisplacedVertexRef().

◆ muonRef_

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

reference to the corresponding muon

Definition at line 127 of file PFBlockElementTrack.h.

Referenced by muonRef(), and setMuonRef().

◆ positionAtECALEntrance_

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

position at ECAL entrance

Definition at line 118 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 113 of file PFBlockElementTrack.h.

Referenced by Dump(), and trackRef().

◆ trackRefPF_

PFRecTrackRef reco::PFBlockElementTrack::trackRefPF_
private

reference to the corresponding track (transient)

Definition at line 110 of file PFBlockElementTrack.h.

Referenced by trackRefPF().

◆ trackType_

unsigned int reco::PFBlockElementTrack::trackType_
private

Definition at line 115 of file PFBlockElementTrack.h.

Referenced by setTrackType(), and trackType().

◆ v0Ref_

VertexCompositeCandidateRef reco::PFBlockElementTrack::v0Ref_
private

reference to V0

Definition at line 133 of file PFBlockElementTrack.h.

Referenced by setV0Ref(), and V0Ref().

reco::PFBlockElementTrack::trackType
bool trackType(TrackType trType) const override
Definition: PFBlockElementTrack.h:28
reco::PFBlockElementTrack::v0Ref_
VertexCompositeCandidateRef v0Ref_
reference to V0
Definition: PFBlockElementTrack.h:133
reco::PFBlockElementTrack::convRefs_
ConversionRefVector convRefs_
reference to reco conversion
Definition: PFBlockElementTrack.h:130
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
reco::PFBlockElementTrack::V0Ref
const VertexCompositeCandidateRef & V0Ref() const override
Definition: PFBlockElementTrack.h:100
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
reco::PFBlockElement::T_TO_DISP
Definition: PFBlockElement.h:47
reco::PFBlockElementTrack::trackRef_
reco::TrackRef trackRef_
reference to the corresponding track
Definition: PFBlockElementTrack.h:113
reco::PFBlockElementTrack::setTrackType
void setTrackType(TrackType trType, bool value) override
\set the trackType
Definition: PFBlockElementTrack.h:31
reco::PFBlockElementTrack::muonRef_
reco::MuonRef muonRef_
reference to the corresponding muon
Definition: PFBlockElementTrack.h:127
alignCSCRings.s
s
Definition: alignCSCRings.py:92
reco::PFBlockElement::MUON
Definition: PFBlockElement.h:47
reco::PFBlockElement::TRACK
Definition: PFBlockElement.h:32
reco::PFBlockElementTrack::displacedVertexDaughterRef_
PFDisplacedTrackerVertexRef displacedVertexDaughterRef_
reference to the corresponding pf displaced vertex which this track was created
Definition: PFBlockElementTrack.h:124
reco::PFBlockElementTrack::trackRefPF_
PFRecTrackRef trackRefPF_
reference to the corresponding track (transient)
Definition: PFBlockElementTrack.h:110
reco::PFBlockElement::T_FROM_V0
Definition: PFBlockElement.h:47
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
reco::PFBlockElement::T_FROM_DISP
Definition: PFBlockElement.h:47
reco::PFBlockElementTrack::trackType_
unsigned int trackType_
Definition: PFBlockElementTrack.h:115
reco::PFTrajectoryPoint::position
const math::XYZPoint & position() const
cartesian position (x, y, z)
Definition: PFTrajectoryPoint.h:100
reco::PFBlockElement::DEFAULT
Definition: PFBlockElement.h:47
reco::PFBlockElementTrack::displacedVertexMotherRef_
PFDisplacedTrackerVertexRef displacedVertexMotherRef_
reference to the corresponding pf displaced vertex where this track was created
Definition: PFBlockElementTrack.h:121
value
Definition: value.py:1
reco::PFBlockElement::T_FROM_GAMMACONV
Definition: PFBlockElement.h:47
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
reco::PFTrajectoryPoint::isValid
bool isValid() const
is this point valid ?
Definition: PFTrajectoryPoint.h:84
reco::PFTrajectoryPoint::ECALEntrance
ECAL front face.
Definition: PFTrajectoryPoint.h:43
reco::PFTrajectoryPoint
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Definition: PFTrajectoryPoint.h:26
reco::PFBlockElementTrack::positionAtECALEntrance_
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance
Definition: PFBlockElementTrack.h:118
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
cms::Exception
Definition: Exception.h:70
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:52
reco::PFBlockElement::PFBlockElement
PFBlockElement(Type type=NONE)
standard constructor
Definition: PFBlockElement.h:50
reco::PFBlockElementTrack::isPrimary
bool isPrimary() const override
Definition: PFBlockElementTrack.h:56
reco::PFBlockElementTrack::PFBlockElementTrack
PFBlockElementTrack()
Definition: PFBlockElementTrack.h:19