CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
ConversionRef convRef () const
 
PFDisplacedTrackerVertexRef displacedVertexRef (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...
 
reco::MuonRef muonRef () 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...
 
reco::TrackRef trackRef () const
 
PFRecTrackRef trackRefPF () const
 
virtual bool trackType (TrackType trType) const
 
VertexCompositeCandidateRef V0Ref () const
 
- Public Member Functions inherited from reco::PFBlockElement
virtual PFClusterRef clusterRef () const
 
const PFMultilinksTypegetMultilinks () const
 
unsigned index () const
 
bool isMultilinksValide () const
 
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)
 
Type type () const
 
void unLock ()
 unlock element More...
 
virtual ~PFBlockElement ()
 destructor More...
 

Private Attributes

ConversionRef convRef_
 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
}
 
- Protected Attributes inherited from reco::PFBlockElement
unsigned index_
 index in block vector More...
 
bool locked_
 
PFMultiLinksTC multilinks_
 
Type type_
 

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:247
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 PFBlockElementTrack().

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

Reimplemented from reco::PFBlockElement.

Definition at line 102 of file PFBlockElementTrack.h.

References convRef_.

Referenced by setConversionRef().

102 {return convRef_;}
ConversionRef convRef_
reference to reco conversion
PFDisplacedTrackerVertexRef reco::PFBlockElementTrack::displacedVertexRef ( TrackType  trType) const
inlinevirtual
Returns
the displaced vertex associated

Reimplemented from reco::PFBlockElement.

Definition at line 76 of file PFBlockElementTrack.h.

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

Referenced by PFAlgo::reconstructTrack().

76  {
77  if (trType == T_TO_DISP)
79  else if (trType == T_FROM_DISP)
81  else return PFDisplacedTrackerVertexRef();
82  }
edm::Ref< PFDisplacedTrackerVertexCollection > PFDisplacedTrackerVertexRef
persistent reference to a DisplacedTrackerVertex
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 DeDxDiscriminatorTools::charge(), edm::Ref< C, T, F >::isNull(), AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::s, and trackRef_.

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
double charge(const std::vector< uint8_t > &Ampls)
bool isNull() const
Checks for null.
Definition: Ref.h:247
tuple out
Definition: dbtoconf.py:99
bool reco::PFBlockElementTrack::isLinkedToDisplacedVertex ( ) const
inlinevirtual

Reimplemented from reco::PFBlockElement.

Definition at line 71 of file PFBlockElementTrack.h.

References isPrimary(), and isSecondary().

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
reco::MuonRef reco::PFBlockElementTrack::muonRef ( ) const
inlinevirtual
Returns
reference to the corresponding Muon

Reimplemented from reco::PFBlockElement.

Definition at line 94 of file PFBlockElementTrack.h.

References muonRef_.

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

94 { 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 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 105 of file PFBlockElementTrack.h.

References convRef(), convRef_, and setTrackType().

105  {
106  convRef_ = convRef; setTrackType(trType,true);
107  }
ConversionRef convRef_
reference to reco conversion
virtual void setTrackType(TrackType trType, bool value)
the trackType
ConversionRef convRef() const
void reco::PFBlockElementTrack::setDisplacedVertexRef ( const PFDisplacedTrackerVertexRef niref,
TrackType  trType 
)
inlinevirtual

the ref to the displaced vertex interaction

Reimplemented from reco::PFBlockElement.

Definition at line 85 of file PFBlockElementTrack.h.

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

85  {
86 
87  if (trType == T_TO_DISP) {
88  displacedVertexDaughterRef_ = niref; setTrackType(trType,true);}
89  else if (trType == T_FROM_DISP) {
90  displacedVertexMotherRef_ = niref; setTrackType(trType,true);}
91  }
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 97 of file PFBlockElementTrack.h.

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

97  {
98  muonRef_=muref; setTrackType(MUON,true);
99  }
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  }
double double double z
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance
x
Definition: VDTMath.h:216
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  }
void reco::PFBlockElementTrack::setV0Ref ( const VertexCompositeCandidateRef V0Ref,
TrackType  trType 
)
inlinevirtual

the ref to V0

Reimplemented from reco::PFBlockElement.

Definition at line 113 of file PFBlockElementTrack.h.

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

113  {
114  v0Ref_ = V0Ref; setTrackType(trType,true);
115  }
VertexCompositeCandidateRef v0Ref_
reference to V0
VertexCompositeCandidateRef V0Ref() const
virtual void setTrackType(TrackType trType, bool value)
the trackType
reco::TrackRef reco::PFBlockElementTrack::trackRef ( ) const
inlinevirtual
Returns
reference to the corresponding Track

Reimplemented from reco::PFBlockElement.

Definition at line 57 of file PFBlockElementTrack.h.

References trackRef_.

Referenced by PFAlgo::reconstructTrack(), PFElectronAlgo::SetCandidates(), PFElectronAlgo::SetIDOutputs(), and PFElectronAlgo::SetLinks().

57 { return trackRef_; }
reco::TrackRef trackRef_
reference to the corresponding track
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().

54 { return trackRefPF_; }
PFRecTrackRef trackRefPF_
reference to the corresponding track (transient)
virtual bool reco::PFBlockElementTrack::trackType ( TrackType  trType) const
inlinevirtual
Returns
tracktype

Reimplemented from reco::PFBlockElement.

Definition at line 30 of file PFBlockElementTrack.h.

References trackType_.

Referenced by isPrimary(), isSecondary(), PFAlgo::processBlock(), and PFPhotonAlgo::RunPFPhoton().

30  {
31  return (trackType_>>trType) & 1;
32  }
VertexCompositeCandidateRef reco::PFBlockElementTrack::V0Ref ( ) const
inlinevirtual
Returns
ref to original V0

Reimplemented from reco::PFBlockElement.

Definition at line 110 of file PFBlockElementTrack.h.

References v0Ref_.

Referenced by setV0Ref().

110 {return v0Ref_;}
VertexCompositeCandidateRef v0Ref_
reference to V0

Member Data Documentation

ConversionRef reco::PFBlockElementTrack::convRef_
private

reference to reco conversion

Definition at line 142 of file PFBlockElementTrack.h.

Referenced by convRef(), and setConversionRef().

PFDisplacedTrackerVertexRef reco::PFBlockElementTrack::displacedVertexDaughterRef_
private

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

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

Referenced by displacedVertexRef(), and setDisplacedVertexRef().

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

reference to the corresponding muon

Definition at line 139 of file PFBlockElementTrack.h.

Referenced by muonRef(), and setMuonRef().

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

position at ECAL entrance

Definition at line 130 of file PFBlockElementTrack.h.

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

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

reference to the corresponding track

Definition at line 125 of file PFBlockElementTrack.h.

Referenced by Dump(), and trackRef().

PFRecTrackRef reco::PFBlockElementTrack::trackRefPF_
private

reference to the corresponding track (transient)

Definition at line 122 of file PFBlockElementTrack.h.

Referenced by trackRefPF().

unsigned int reco::PFBlockElementTrack::trackType_
private

Definition at line 127 of file PFBlockElementTrack.h.

Referenced by setTrackType(), and trackType().

VertexCompositeCandidateRef reco::PFBlockElementTrack::v0Ref_
private

reference to V0

Definition at line 145 of file PFBlockElementTrack.h.

Referenced by setV0Ref(), and V0Ref().