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
 necessary to have the edm::OwnVector<PFBlockElement> working More...
 
const ConversionRefVectorconvRefs () const
 
const PFDisplacedTrackerVertexRefdisplacedVertexRef (TrackType trType) const
 
void Dump (std::ostream &out=std::cout, const char *tab=" ") const
 print the object inside the element More...
 
bool isLinkedToDisplacedVertex () const
 
bool isPrimary () const
 
bool isSecondary () const
 check if the track is secondary More...
 
const reco::MuonRefmuonRef () const
 
 PFBlockElementTrack ()
 
 PFBlockElementTrack (const PFRecTrackRef &ref)
 
const math::XYZPointFpositionAtECALEntrance () const
 
void setConversionRef (const ConversionRef &convRef, TrackType trType)
 the ref to gamma conversion More...
 
void setDisplacedVertexRef (const PFDisplacedTrackerVertexRef &niref, TrackType trType)
 the ref to the displaced vertex interaction More...
 
void setMuonRef (const MuonRef &muref)
 reference to the Muon More...
 
void setPositionAtECALEntrance (float x, float y, float z)
 set position at ECAL entrance More...
 
virtual void setTrackType (TrackType trType, bool value)
 the trackType More...
 
void setV0Ref (const VertexCompositeCandidateRef &V0Ref, TrackType trType)
 the ref to V0 More...
 
const reco::TrackReftrackRef () const
 
const PFRecTrackReftrackRefPF () const
 
virtual bool trackType (TrackType trType) const
 
const VertexCompositeCandidateRefV0Ref () const
 
- Public Member Functions inherited from reco::PFBlockElement
virtual const PFClusterRefclusterRef () const
 
const PFMultilinksTypegetMultilinks () const
 
unsigned index () const
 
bool isMultilinksValide () 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)
 
void setMultilinks (const PFMultiLinksTC &ml)
 
void setMultilinksList (const PFMultilinksType &links)
 
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...
 

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_
 
PFMultiLinksTC multilinks_
 
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_
 
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

reco::PFBlockElementTrack::PFBlockElementTrack ( )
inline

Definition at line 20 of file PFBlockElementTrack.h.

Referenced by clone().

20 {}
PFBlockElementTrack::PFBlockElementTrack ( const PFRecTrackRef ref)

Definition at line 13 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  :
15  trackRefPF_( ref ),
16  trackRef_( ref->trackRef() ),
17  trackType_(0) {
18 
19 
20  if( ref.isNull() )
21  throw cms::Exception("NullRef")<<" PFBlockElementTrack constructed from a null reference to PFRecTrack.";
22 
23  const reco::PFTrajectoryPoint& atECAL
24  = ref->extrapolatedPoint( reco::PFTrajectoryPoint::ECALEntrance );
25 
26  if( atECAL.isValid() )
27  positionAtECALEntrance_.SetCoordinates( atECAL.position().x(),
28  atECAL.position().y(),
29  atECAL.position().z() );
30  // if the position at ecal entrance is invalid,
31  // positionAtECALEntrance_ is initialized by default to 0,0,0
32 
33  setTrackType( DEFAULT, true );
34 }
const math::XYZPoint & position() const
cartesian position (x, y, z)
PFRecTrackRef trackRefPF_
reference to the corresponding track (transient)
reco::TrackRef trackRef_
reference to the corresponding track
PFBlockElement(Type type=NONE)
standard constructor
bool isNull() const
Checks for null.
Definition: Ref.h:250
bool isValid() const
is this point valid ?
virtual void setTrackType(TrackType trType, bool value)
the trackType
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

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

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

Implements reco::PFBlockElement.

Definition at line 24 of file PFBlockElementTrack.h.

References gather_cfg::cout, Dump(), MillePedeFileConverter_cfg::out, and PFBlockElementTrack().

24 { return new PFBlockElementTrack(*this); }
const ConversionRefVector& reco::PFBlockElementTrack::convRefs ( ) const
inlinevirtual
Returns
ref to original recoConversion

Reimplemented from reco::PFBlockElement.

Definition at line 103 of file PFBlockElementTrack.h.

References convRefs_.

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

103 {return convRefs_;}
ConversionRefVector convRefs_
reference to reco conversion
const PFDisplacedTrackerVertexRef& reco::PFBlockElementTrack::displacedVertexRef ( TrackType  trType) const
inlinevirtual
Returns
the displaced vertex associated

Reimplemented from reco::PFBlockElement.

Definition at line 77 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(), GeneralTracksImporterWithVeto::importToBlock(), and PFAlgo::reconstructTrack().

77  {
78  if (trType == T_TO_DISP)
80  else if (trType == T_FROM_DISP)
82  else return nullPFDispVertex_;
83  }
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
void PFBlockElementTrack::Dump ( std::ostream &  out = std::cout,
const char *  tab = " " 
) const
virtual

print the object inside the element

Reimplemented from reco::PFBlockElement.

Definition at line 37 of file PFBlockElementTrack.cc.

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

Referenced by clone(), and reco::operator<<().

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

Reimplemented from reco::PFBlockElement.

Definition at line 71 of file PFBlockElementTrack.h.

References isPrimary(), and isSecondary().

Referenced by TrackAndGSFLinker::testLink().

71  {
72  return isSecondary() || isPrimary();
73  }
bool isSecondary() const
check if the track is secondary
bool reco::PFBlockElementTrack::isPrimary ( ) const
inlinevirtual

Reimplemented from reco::PFBlockElement.

Definition at line 67 of file PFBlockElementTrack.h.

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

Referenced by isLinkedToDisplacedVertex().

67  {
68  return trackType(T_TO_DISP);
69  }
virtual bool trackType(TrackType trType) const
bool reco::PFBlockElementTrack::isSecondary ( ) const
inlinevirtual
const reco::MuonRef& reco::PFBlockElementTrack::muonRef ( ) const
inlinevirtual
Returns
reference to the corresponding Muon

Reimplemented from reco::PFBlockElement.

Definition at line 95 of file PFBlockElementTrack.h.

References muonRef_.

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

95 { return muonRef_; }
reco::MuonRef muonRef_
reference to the corresponding muon
const math::XYZPointF& reco::PFBlockElementTrack::positionAtECALEntrance ( ) const
inline
Returns
position at ECAL entrance

Definition at line 48 of file PFBlockElementTrack.h.

References positionAtECALEntrance_.

Referenced by PFEGammaAlgo::fillPFCandidates(), and PFAlgo::reconstructTrack().

48  {
50  }
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance
void reco::PFBlockElementTrack::setConversionRef ( const ConversionRef convRef,
TrackType  trType 
)
inlinevirtual

the ref to gamma conversion

Reimplemented from reco::PFBlockElement.

Definition at line 106 of file PFBlockElementTrack.h.

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

106  {
107  convRefs_.push_back(convRef); setTrackType(trType,true);
108  }
ConversionRefVector convRefs_
reference to reco conversion
virtual void setTrackType(TrackType trType, bool value)
the trackType
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
void reco::PFBlockElementTrack::setDisplacedVertexRef ( const PFDisplacedTrackerVertexRef niref,
TrackType  trType 
)
inlinevirtual

the ref to the displaced vertex interaction

Reimplemented from reco::PFBlockElement.

Definition at line 86 of file PFBlockElementTrack.h.

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

86  {
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  }
virtual void setTrackType(TrackType trType, bool value)
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
void reco::PFBlockElementTrack::setMuonRef ( const MuonRef muref)
inlinevirtual

reference to the Muon

Reimplemented from reco::PFBlockElement.

Definition at line 98 of file PFBlockElementTrack.h.

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

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

98  {
99  muonRef_=muref; setTrackType(MUON,true);
100  }
virtual void setTrackType(TrackType trType, bool value)
the trackType
reco::MuonRef muonRef_
reference to the corresponding muon
void reco::PFBlockElementTrack::setPositionAtECALEntrance ( float  x,
float  y,
float  z 
)
inline

set position at ECAL entrance

Definition at line 42 of file PFBlockElementTrack.h.

References positionAtECALEntrance_.

Referenced by PFAlgo::processBlock().

42  {
43  positionAtECALEntrance_.SetCoordinates(x, y, z);
44  }
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance
virtual void reco::PFBlockElementTrack::setTrackType ( TrackType  trType,
bool  value 
)
inlinevirtual

the trackType

Reimplemented from reco::PFBlockElement.

Definition at line 35 of file PFBlockElementTrack.h.

References trackType_.

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

35  {
36  if(value) trackType_ = trackType_ | (1<<trType);
37  else trackType_ = trackType_ ^ (1<<trType);
38  }
Definition: value.py:1
void reco::PFBlockElementTrack::setV0Ref ( const VertexCompositeCandidateRef V0Ref,
TrackType  trType 
)
inlinevirtual

the ref to V0

Reimplemented from reco::PFBlockElement.

Definition at line 114 of file PFBlockElementTrack.h.

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

114  {
115  v0Ref_ = V0Ref; setTrackType(trType,true);
116  }
const VertexCompositeCandidateRef & V0Ref() const
VertexCompositeCandidateRef v0Ref_
reference to V0
virtual void setTrackType(TrackType trType, bool value)
the trackType
const reco::TrackRef& reco::PFBlockElementTrack::trackRef ( ) const
inlinevirtual
const PFRecTrackRef& reco::PFBlockElementTrack::trackRefPF ( ) const
inlinevirtual
Returns
reference to the corresponding PFRecTrack please do not use this function after the block production stage!

Reimplemented from reco::PFBlockElement.

Definition at line 54 of file PFBlockElementTrack.h.

References trackRefPF_.

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

54 { return trackRefPF_; }
PFRecTrackRef trackRefPF_
reference to the corresponding track (transient)
virtual bool reco::PFBlockElementTrack::trackType ( TrackType  trType) const
inlinevirtual
const VertexCompositeCandidateRef& reco::PFBlockElementTrack::V0Ref ( ) const
inlinevirtual
Returns
ref to original V0

Reimplemented from reco::PFBlockElement.

Definition at line 111 of file PFBlockElementTrack.h.

References v0Ref_.

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

111 {return v0Ref_;}
VertexCompositeCandidateRef v0Ref_
reference to V0

Member Data Documentation

ConversionRefVector reco::PFBlockElementTrack::convRefs_
private

reference to reco conversion

Definition at line 143 of file PFBlockElementTrack.h.

Referenced by convRefs(), and setConversionRef().

PFDisplacedTrackerVertexRef reco::PFBlockElementTrack::displacedVertexDaughterRef_
private

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

Definition at line 137 of file PFBlockElementTrack.h.

Referenced by displacedVertexRef(), and setDisplacedVertexRef().

PFDisplacedTrackerVertexRef reco::PFBlockElementTrack::displacedVertexMotherRef_
private

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

Definition at line 134 of file PFBlockElementTrack.h.

Referenced by displacedVertexRef(), and setDisplacedVertexRef().

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

reference to the corresponding muon

Definition at line 140 of file PFBlockElementTrack.h.

Referenced by muonRef(), and setMuonRef().

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

position at ECAL entrance

Definition at line 131 of file PFBlockElementTrack.h.

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

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

reference to the corresponding track

Definition at line 126 of file PFBlockElementTrack.h.

Referenced by Dump(), and trackRef().

PFRecTrackRef reco::PFBlockElementTrack::trackRefPF_
private

reference to the corresponding track (transient)

Definition at line 123 of file PFBlockElementTrack.h.

Referenced by trackRefPF().

unsigned int reco::PFBlockElementTrack::trackType_
private

Definition at line 128 of file PFBlockElementTrack.h.

Referenced by setTrackType(), and trackType().

VertexCompositeCandidateRef reco::PFBlockElementTrack::v0Ref_
private

reference to V0

Definition at line 146 of file PFBlockElementTrack.h.

Referenced by setV0Ref(), and V0Ref().