CMS 3D CMS Logo

Public Member Functions | Protected Attributes

TPtoRecoTrack Class Reference

#include <TPtoRecoTrack.h>

List of all members.

Public Member Functions

bool allmatched () const
bool allmatchedA () const
bool allmatchedB () const
math::XYZPoint BeamSpot () const
float GetSharedA () const
float GetSharedB () const
bool hasPCA () const
bool hasRV () const
bool hasRVA () const
bool hasRVB () const
bool hasTPMother () const
bool matched () const
bool matchedA () const
bool matchedAnotB () const
bool matchedB () const
bool matchedBnotA () const
int numTPMothers () const
int numTPSourceTracks () const
double rA_d0 () const
double rA_d02 () const
double rA_dsz () const
double rA_dxy () const
double rA_dz () const
double rA_dz2 () const
double rB_d0 () const
double rB_d02 () const
double rB_dsz () const
double rB_dxy () const
double rB_dz () const
double rB_dz2 () const
reco::Track RTA () const
reco::Track RTB () const
reco::Vertex RVA () const
reco::Vertex RVB () const
double s_d0 () const
double s_dsz () const
double s_dxy () const
double s_dz () const
double s_eta () const
double s_lambda () const
GlobalVector s_p () const
GlobalPoint s_pca () const
double s_phi () const
double s_qoverp () const
double s_theta () const
GlobalPoint s_v () const
void SetBeamSpot (math::XYZPoint bs)
void SetRecoTrack_AlgoA (reco::TrackBaseRef track)
void SetRecoTrack_AlgoB (reco::TrackBaseRef track)
void SetRecoVertex_AlgoA (reco::VertexRef vertex)
void SetRecoVertex_AlgoB (reco::VertexRef vertex)
void SetShared_AlgoA (const float &mA)
void SetShared_AlgoB (const float &mB)
void SetTrackingParticle (TrackingParticleRef tp)
void SetTrackingParticleMomentumPCA (const GlobalVector &p)
void SetTrackingParticlePCA (const GlobalPoint &v)
TrackingParticle TP () const
TrackingParticle TPMother (unsigned short i) const
TrackingParticle TPMother () const
 TPtoRecoTrack ()
 ~TPtoRecoTrack ()

Protected Attributes

math::XYZPoint beamSpot_
reco::TrackBaseRef recoTrack_AlgoA_
reco::TrackBaseRef recoTrack_AlgoB_
reco::VertexRef recoVertex_AlgoA_
reco::VertexRef recoVertex_AlgoB_
float sharedA_
float sharedB_
GlobalVector simMomPCA_
GlobalPoint simPCA_
TrackingParticleRef trackingParticle_

Detailed Description

Definition at line 21 of file TPtoRecoTrack.h.


Constructor & Destructor Documentation

TPtoRecoTrack::TPtoRecoTrack ( )

Definition at line 5 of file TPtoRecoTrack.cc.

References SetBeamSpot(), SetTrackingParticleMomentumPCA(), and SetTrackingParticlePCA().

{
    SetBeamSpot(math::XYZPoint(-9999.0, -9999.0, -9999.0)); 
    SetTrackingParticlePCA(GlobalPoint(-9999.0, -9999.0, -9999.0));
    SetTrackingParticleMomentumPCA(GlobalVector(-9999.0, -9999.0, -9999.0));
}
TPtoRecoTrack::~TPtoRecoTrack ( )

Definition at line 13 of file TPtoRecoTrack.cc.

{
}

Member Function Documentation

bool TPtoRecoTrack::allmatched ( ) const [inline]

Definition at line 60 of file TPtoRecoTrack.h.

References hasRV(), and matched().

{return matched() && hasRV();} 
bool TPtoRecoTrack::allmatchedA ( ) const [inline]

Definition at line 58 of file TPtoRecoTrack.h.

References hasRVA(), and matchedA().

{return matchedA() && hasRVA();} 
bool TPtoRecoTrack::allmatchedB ( ) const [inline]

Definition at line 59 of file TPtoRecoTrack.h.

References hasRVA(), and matchedB().

{return matchedB() && hasRVA();} 
math::XYZPoint TPtoRecoTrack::BeamSpot ( ) const [inline]

Definition at line 47 of file TPtoRecoTrack.h.

References beamSpot_.

Referenced by rA_dsz(), rA_dxy(), rA_dz(), rB_dsz(), rB_dxy(), rB_dz(), and s_v().

{return beamSpot_;}
float TPtoRecoTrack::GetSharedA ( ) const [inline]

Definition at line 61 of file TPtoRecoTrack.h.

References sharedA_.

{return sharedA_;}
float TPtoRecoTrack::GetSharedB ( ) const [inline]

Definition at line 62 of file TPtoRecoTrack.h.

References sharedB_.

{return sharedB_;}
bool TPtoRecoTrack::hasPCA ( ) const [inline]

Definition at line 57 of file TPtoRecoTrack.h.

References PV3DBase< T, PVType, FrameType >::mag(), and s_pca().

{return s_pca().mag()<9999.0;}
bool TPtoRecoTrack::hasRV ( ) const [inline]

Definition at line 56 of file TPtoRecoTrack.h.

References hasRVA(), and hasRVB().

Referenced by allmatched().

{return hasRVA() && hasRVB();}
bool TPtoRecoTrack::hasRVA ( ) const [inline]

Definition at line 54 of file TPtoRecoTrack.h.

References edm::Ref< C, T, F >::isNonnull(), and recoVertex_AlgoA_.

Referenced by allmatchedA(), allmatchedB(), and hasRV().

{return recoVertex_AlgoA_.isNonnull() && fabs(recoVertex_AlgoA_->position().Mag2())>0.0;}   // position is ROOT::MATH::Cartesian3D<double> 
bool TPtoRecoTrack::hasRVB ( ) const [inline]

Definition at line 55 of file TPtoRecoTrack.h.

References edm::Ref< C, T, F >::isNonnull(), and recoVertex_AlgoB_.

Referenced by hasRV().

{return recoVertex_AlgoB_.isNonnull() && fabs(recoVertex_AlgoB_->position().Mag2())>0.0;}   // position is ROOT::MATH::Cartesian3D<double>
bool TPtoRecoTrack::hasTPMother ( ) const [inline]

Definition at line 104 of file TPtoRecoTrack.h.

References numTPMothers().

{return numTPMothers()>0;}
bool TPtoRecoTrack::matched ( ) const [inline]

Definition at line 49 of file TPtoRecoTrack.h.

References matchedA(), and matchedB().

Referenced by allmatched().

{return matchedA() && matchedB();}
bool TPtoRecoTrack::matchedA ( ) const [inline]
bool TPtoRecoTrack::matchedAnotB ( ) const [inline]

Definition at line 52 of file TPtoRecoTrack.h.

References matchedA(), and matchedB().

{return matchedA() && !matchedB();}
bool TPtoRecoTrack::matchedB ( ) const [inline]
bool TPtoRecoTrack::matchedBnotA ( ) const [inline]

Definition at line 53 of file TPtoRecoTrack.h.

References matchedA(), and matchedB().

{return matchedB() && !matchedA();}
int TPtoRecoTrack::numTPMothers ( ) const

Definition at line 55 of file TPtoRecoTrack.cc.

References prof2calltree::count, TrackingParticle::parentVertex(), and TP().

Referenced by hasTPMother(), and TPMother().

{
    int count = 0;
    for(TrackingParticleRefVector::iterator si = TP().parentVertex()->sourceTracks_begin();
        si != TP().parentVertex()->sourceTracks_end(); si++)
    {
        for(TrackingParticleRefVector::iterator di = TP().parentVertex()->daughterTracks_begin();
            di != TP().parentVertex()->daughterTracks_end(); di++)
        {
            if(si != di) count++;
            break;
        }
        if(count>0) break;
    }
    return count;
}
int TPtoRecoTrack::numTPSourceTracks ( ) const [inline]

Definition at line 102 of file TPtoRecoTrack.h.

References TrackingParticle::parentVertex(), and TP().

{return TP().parentVertex()->nSourceTracks();}
double TPtoRecoTrack::rA_d0 ( ) const [inline]

Definition at line 69 of file TPtoRecoTrack.h.

References rA_dxy().

{return -1.0 * rA_dxy();}
double TPtoRecoTrack::rA_d02 ( ) const [inline]

Definition at line 75 of file TPtoRecoTrack.h.

References reco::TrackBase::dxy(), position, RTA(), and RVA().

{return -1.0 * RTA().dxy( RVA().position() );}
double TPtoRecoTrack::rA_dsz ( ) const [inline]

Definition at line 67 of file TPtoRecoTrack.h.

References BeamSpot(), reco::TrackBase::dsz(), and RTA().

{return RTA().dsz( BeamSpot() );}
double TPtoRecoTrack::rA_dxy ( ) const [inline]

Definition at line 65 of file TPtoRecoTrack.h.

References BeamSpot(), reco::TrackBase::dxy(), and RTA().

Referenced by rA_d0().

{return RTA().dxy( BeamSpot() );}
double TPtoRecoTrack::rA_dz ( ) const [inline]

Definition at line 71 of file TPtoRecoTrack.h.

References BeamSpot(), reco::TrackBase::dz(), and RTA().

{return RTA().dz( BeamSpot() );}
double TPtoRecoTrack::rA_dz2 ( ) const [inline]

Definition at line 76 of file TPtoRecoTrack.h.

References reco::TrackBase::dz(), position, RTA(), and RVA().

{return RTA().dz( RVA().position() );}
double TPtoRecoTrack::rB_d0 ( ) const [inline]

Definition at line 70 of file TPtoRecoTrack.h.

References rB_dxy().

{return -1.0 * rB_dxy();}
double TPtoRecoTrack::rB_d02 ( ) const [inline]

Definition at line 77 of file TPtoRecoTrack.h.

References reco::TrackBase::dxy(), position, RTB(), and RVB().

{return -1.0 * RTB().dxy( RVB().position() );}
double TPtoRecoTrack::rB_dsz ( ) const [inline]

Definition at line 68 of file TPtoRecoTrack.h.

References BeamSpot(), reco::TrackBase::dsz(), and RTB().

{return RTB().dsz( BeamSpot() );}
double TPtoRecoTrack::rB_dxy ( ) const [inline]

Definition at line 66 of file TPtoRecoTrack.h.

References BeamSpot(), reco::TrackBase::dxy(), and RTB().

Referenced by rB_d0().

{return RTB().dxy( BeamSpot() );}
double TPtoRecoTrack::rB_dz ( ) const [inline]

Definition at line 72 of file TPtoRecoTrack.h.

References BeamSpot(), reco::TrackBase::dz(), and RTB().

{return RTB().dz( BeamSpot() );}
double TPtoRecoTrack::rB_dz2 ( ) const [inline]

Definition at line 78 of file TPtoRecoTrack.h.

References reco::TrackBase::dz(), position, RTB(), and RVB().

{return RTB().dz( RVB().position());}
reco::Track TPtoRecoTrack::RTA ( ) const [inline]
reco::Track TPtoRecoTrack::RTB ( ) const [inline]
reco::Vertex TPtoRecoTrack::RVA ( ) const [inline]

Definition at line 45 of file TPtoRecoTrack.h.

References edm::Ref< C, T, F >::isNonnull(), and recoVertex_AlgoA_.

Referenced by rA_d02(), and rA_dz2().

reco::Vertex TPtoRecoTrack::RVB ( ) const [inline]

Definition at line 46 of file TPtoRecoTrack.h.

References edm::Ref< C, T, F >::isNonnull(), and recoVertex_AlgoB_.

Referenced by rB_d02(), and rB_dz2().

double TPtoRecoTrack::s_d0 ( ) const [inline]

Definition at line 96 of file TPtoRecoTrack.h.

References s_dxy().

{return -1.0*s_dxy();}
double TPtoRecoTrack::s_dsz ( ) const [inline]
double TPtoRecoTrack::s_dxy ( ) const [inline]

Definition at line 94 of file TPtoRecoTrack.h.

References PV3DBase< T, PVType, FrameType >::perp(), s_p(), s_v(), x, and detailsBasic3DVector::y.

Referenced by s_d0().

{return ( - s_v().x() * s_p().y() + s_v().y() * s_p().x() ) / s_p().perp();}
double TPtoRecoTrack::s_dz ( ) const [inline]
double TPtoRecoTrack::s_eta ( ) const [inline]

Definition at line 92 of file TPtoRecoTrack.h.

References create_public_lumi_plots::log, s_p(), funct::tan(), and theta().

{return -1.0*log( tan (0.5*s_p().theta()) );}
double TPtoRecoTrack::s_lambda ( ) const [inline]

Definition at line 90 of file TPtoRecoTrack.h.

References M_PI, s_p(), and PV3DBase< T, PVType, FrameType >::theta().

{return M_PI/2-s_p().theta();}
GlobalVector TPtoRecoTrack::s_p ( ) const [inline]

Definition at line 84 of file TPtoRecoTrack.h.

References simMomPCA_.

Referenced by s_dsz(), s_dxy(), s_dz(), s_eta(), s_lambda(), s_phi(), s_qoverp(), and s_theta().

{return simMomPCA_;}
GlobalPoint TPtoRecoTrack::s_pca ( ) const [inline]

Definition at line 85 of file TPtoRecoTrack.h.

References simPCA_.

Referenced by hasPCA(), and s_v().

{return simPCA_;}
double TPtoRecoTrack::s_phi ( ) const [inline]

Definition at line 91 of file TPtoRecoTrack.h.

References PV3DBase< T, PVType, FrameType >::phi(), and s_p().

{return s_p().phi();}
double TPtoRecoTrack::s_qoverp ( ) const [inline]

Definition at line 88 of file TPtoRecoTrack.h.

References ParticleBase::charge(), PV3DBase< T, PVType, FrameType >::mag(), s_p(), and TP().

{return TP().charge() / s_p().mag();}
double TPtoRecoTrack::s_theta ( ) const [inline]

Definition at line 89 of file TPtoRecoTrack.h.

References s_p(), and PV3DBase< T, PVType, FrameType >::theta().

{return s_p().theta();}
GlobalPoint TPtoRecoTrack::s_v ( ) const [inline]

Definition at line 86 of file TPtoRecoTrack.h.

References BeamSpot(), s_pca(), x, detailsBasic3DVector::y, and z.

Referenced by s_dsz(), s_dxy(), and s_dz().

{return GlobalPoint(s_pca().x()-BeamSpot().x(), s_pca().y()-BeamSpot().y(), s_pca().z()-BeamSpot().z() );}
void TPtoRecoTrack::SetBeamSpot ( math::XYZPoint  bs) [inline]

Definition at line 39 of file TPtoRecoTrack.h.

References beamSpot_.

Referenced by TrackAlgoCompareUtil::produce(), and TPtoRecoTrack().

{beamSpot_ = bs;}
void TPtoRecoTrack::SetRecoTrack_AlgoA ( reco::TrackBaseRef  track) [inline]

Definition at line 30 of file TPtoRecoTrack.h.

References recoTrack_AlgoA_.

Referenced by TrackAlgoCompareUtil::produce().

{recoTrack_AlgoA_ = track;}
void TPtoRecoTrack::SetRecoTrack_AlgoB ( reco::TrackBaseRef  track) [inline]

Definition at line 31 of file TPtoRecoTrack.h.

References recoTrack_AlgoB_.

Referenced by TrackAlgoCompareUtil::produce().

{recoTrack_AlgoB_ = track;}
void TPtoRecoTrack::SetRecoVertex_AlgoA ( reco::VertexRef  vertex) [inline]

Definition at line 36 of file TPtoRecoTrack.h.

References recoVertex_AlgoA_.

Referenced by TrackAlgoCompareUtil::produce().

{recoVertex_AlgoA_ = vertex;}
void TPtoRecoTrack::SetRecoVertex_AlgoB ( reco::VertexRef  vertex) [inline]

Definition at line 37 of file TPtoRecoTrack.h.

References recoVertex_AlgoB_.

Referenced by TrackAlgoCompareUtil::produce().

{recoVertex_AlgoB_ = vertex;}
void TPtoRecoTrack::SetShared_AlgoA ( const float &  mA) [inline]

Definition at line 33 of file TPtoRecoTrack.h.

References sharedA_.

Referenced by TrackAlgoCompareUtil::produce().

{sharedA_= mA;}
void TPtoRecoTrack::SetShared_AlgoB ( const float &  mB) [inline]

Definition at line 34 of file TPtoRecoTrack.h.

References sharedB_.

Referenced by TrackAlgoCompareUtil::produce().

{sharedB_= mB;}
void TPtoRecoTrack::SetTrackingParticle ( TrackingParticleRef  tp) [inline]

Definition at line 28 of file TPtoRecoTrack.h.

References trackingParticle_.

Referenced by TrackAlgoCompareUtil::produce().

void TPtoRecoTrack::SetTrackingParticleMomentumPCA ( const GlobalVector p) [inline]
void TPtoRecoTrack::SetTrackingParticlePCA ( const GlobalPoint v) [inline]

Definition at line 82 of file TPtoRecoTrack.h.

References simPCA_, and v.

Referenced by TrackAlgoCompareUtil::SetTrackingParticleD0Dz(), and TPtoRecoTrack().

{simPCA_ = v;} 
TrackingParticle TPtoRecoTrack::TP ( ) const [inline]
TrackingParticle TPtoRecoTrack::TPMother ( ) const [inline]

Definition at line 101 of file TPtoRecoTrack.h.

References numTPMothers(), and TPMother().

Referenced by TPMother().

{return numTPMothers()==1 ? TPMother(0) : TrackingParticle();}
TrackingParticle TPtoRecoTrack::TPMother ( unsigned short  i) const

Definition at line 18 of file TPtoRecoTrack.cc.

References i, TrackingParticle::parentVertex(), query::result, and TP().

{
    std::vector<TrackingParticle>  result;

    if( TP().parentVertex().isNonnull())
    {
        if(TP().parentVertex()->nSourceTracks() > 0)
        {
        for(TrackingParticleRefVector::iterator si = TP().parentVertex()->sourceTracks_begin();
            si != TP().parentVertex()->sourceTracks_end(); si++)
            {
            for(TrackingParticleRefVector::iterator di = TP().parentVertex()->daughterTracks_begin();
                di != TP().parentVertex()->daughterTracks_end(); di++)
                {
                    if(si != di)
                    {
                        result.push_back(**si);
                        break;
                    }
                }
                if(result.size()) break;
            }
        }
        else
        {
            return TrackingParticle();
        }
    }
    else
    {
        return TrackingParticle();
    }

    return i < result.size() ? result[i] : TrackingParticle();
}

Member Data Documentation

Definition at line 118 of file TPtoRecoTrack.h.

Referenced by BeamSpot(), and SetBeamSpot().

Definition at line 108 of file TPtoRecoTrack.h.

Referenced by matchedA(), RTA(), and SetRecoTrack_AlgoA().

Definition at line 111 of file TPtoRecoTrack.h.

Referenced by matchedB(), RTB(), and SetRecoTrack_AlgoB().

Definition at line 109 of file TPtoRecoTrack.h.

Referenced by hasRVA(), RVA(), and SetRecoVertex_AlgoA().

Definition at line 112 of file TPtoRecoTrack.h.

Referenced by hasRVB(), RVB(), and SetRecoVertex_AlgoB().

float TPtoRecoTrack::sharedA_ [protected]

Definition at line 119 of file TPtoRecoTrack.h.

Referenced by GetSharedA(), and SetShared_AlgoA().

float TPtoRecoTrack::sharedB_ [protected]

Definition at line 120 of file TPtoRecoTrack.h.

Referenced by GetSharedB(), and SetShared_AlgoB().

Definition at line 116 of file TPtoRecoTrack.h.

Referenced by s_p(), and SetTrackingParticleMomentumPCA().

Definition at line 117 of file TPtoRecoTrack.h.

Referenced by s_pca(), and SetTrackingParticlePCA().

Definition at line 114 of file TPtoRecoTrack.h.

Referenced by matchedA(), matchedB(), SetTrackingParticle(), and TP().