CMS 3D CMS Logo

Public Member Functions | Protected Attributes

RecoTracktoTP Class Reference

#include <RecoTracktoTP.h>

List of all members.

Public Member Functions

bool allmatched () const
math::XYZPoint BeamSpot () const
float GetShared () const
bool hasPCA () const
bool hasRV () const
bool hasTPMother () const
bool matched () const
int numTPMothers () const
int numTPSourceTracks () const
double r_d0 () const
double r_d02 () const
double r_dsz () const
double r_dxy () const
double r_dz () const
double r_dz2 () const
 RecoTracktoTP ()
reco::Track RT () const
reco::Vertex RV () 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 (reco::TrackBaseRef track)
void SetRecoVertex (reco::VertexRef vertex)
void SetShared (const float &m)
void SetTrackingParticle (TrackingParticleRef tp)
void SetTrackingParticleMomentumPCA (const GlobalVector &p)
void SetTrackingParticlePCA (const GlobalPoint &v)
TrackingParticle TP () const
TrackingParticle TPMother () const
TrackingParticle TPMother (unsigned short i) const
 ~RecoTracktoTP ()

Protected Attributes

math::XYZPoint beamSpot_
reco::TrackBaseRef recoTrack
reco::VertexRef recoVertex
float shared_
GlobalVector simMomPCA_
GlobalPoint simPCA_
TrackingParticleRef trackingParticle_

Detailed Description

Definition at line 21 of file RecoTracktoTP.h.


Constructor & Destructor Documentation

RecoTracktoTP::RecoTracktoTP ( )

Definition at line 5 of file RecoTracktoTP.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));
}
RecoTracktoTP::~RecoTracktoTP ( )

Definition at line 13 of file RecoTracktoTP.cc.

{
}

Member Function Documentation

bool RecoTracktoTP::allmatched ( ) const [inline]

Definition at line 43 of file RecoTracktoTP.h.

References hasRV(), and matched().

{return matched() && hasRV();} 
math::XYZPoint RecoTracktoTP::BeamSpot ( ) const [inline]

Definition at line 38 of file RecoTracktoTP.h.

References beamSpot_.

Referenced by r_dsz(), r_dxy(), r_dz(), and s_v().

{return beamSpot_;}
float RecoTracktoTP::GetShared ( ) const [inline]

Definition at line 73 of file RecoTracktoTP.h.

References shared_.

{return shared_;}
bool RecoTracktoTP::hasPCA ( ) const [inline]

Definition at line 42 of file RecoTracktoTP.h.

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

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

Definition at line 41 of file RecoTracktoTP.h.

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

Referenced by allmatched().

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

Definition at line 80 of file RecoTracktoTP.h.

References numTPMothers().

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

Definition at line 55 of file RecoTracktoTP.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 RecoTracktoTP::numTPSourceTracks ( ) const [inline]

Definition at line 78 of file RecoTracktoTP.h.

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

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

Definition at line 48 of file RecoTracktoTP.h.

References r_dxy().

{return -1.0 * r_dxy();}
double RecoTracktoTP::r_d02 ( ) const [inline]

Definition at line 52 of file RecoTracktoTP.h.

References reco::TrackBase::dxy(), position, RT(), and RV().

{return -1.0 * RT().dxy( RV().position() );}
double RecoTracktoTP::r_dsz ( ) const [inline]

Definition at line 47 of file RecoTracktoTP.h.

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

{return RT().dsz( BeamSpot() );}
double RecoTracktoTP::r_dxy ( ) const [inline]

Definition at line 46 of file RecoTracktoTP.h.

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

Referenced by r_d0().

{return RT().dxy( BeamSpot() );}
double RecoTracktoTP::r_dz ( ) const [inline]

Definition at line 49 of file RecoTracktoTP.h.

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

{return RT().dz( BeamSpot() );}
double RecoTracktoTP::r_dz2 ( ) const [inline]

Definition at line 53 of file RecoTracktoTP.h.

References reco::TrackBase::dz(), position, RT(), and RV().

{return RT().dz( RV().position() );}
reco::Track RecoTracktoTP::RT ( ) const [inline]

Definition at line 35 of file RecoTracktoTP.h.

References edm::RefToBase< T >::isNonnull(), and recoTrack.

Referenced by r_d02(), r_dsz(), r_dxy(), r_dz(), and r_dz2().

reco::Vertex RecoTracktoTP::RV ( ) const [inline]

Definition at line 37 of file RecoTracktoTP.h.

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

Referenced by r_d02(), and r_dz2().

double RecoTracktoTP::s_d0 ( ) const [inline]

Definition at line 71 of file RecoTracktoTP.h.

References s_dxy().

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

Definition at line 69 of file RecoTracktoTP.h.

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

Referenced by s_d0().

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

Definition at line 67 of file RecoTracktoTP.h.

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

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

Definition at line 65 of file RecoTracktoTP.h.

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

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

Definition at line 59 of file RecoTracktoTP.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 RecoTracktoTP::s_pca ( ) const [inline]

Definition at line 60 of file RecoTracktoTP.h.

References simPCA_.

Referenced by hasPCA(), and s_v().

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

Definition at line 66 of file RecoTracktoTP.h.

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

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

Definition at line 63 of file RecoTracktoTP.h.

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

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

Definition at line 64 of file RecoTracktoTP.h.

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

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

Definition at line 61 of file RecoTracktoTP.h.

References BeamSpot(), s_pca(), ExpressReco_HICollisions_FallBack::x, ExpressReco_HICollisions_FallBack::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 RecoTracktoTP::SetBeamSpot ( math::XYZPoint  bs) [inline]

Definition at line 31 of file RecoTracktoTP.h.

References beamSpot_.

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

{beamSpot_ = bs;}
void RecoTracktoTP::SetRecoTrack ( reco::TrackBaseRef  track) [inline]
void RecoTracktoTP::SetRecoVertex ( reco::VertexRef  vertex) [inline]

Definition at line 30 of file RecoTracktoTP.h.

References recoVertex.

Referenced by TrackAlgoCompareUtil::produce().

{recoVertex = vertex;}
void RecoTracktoTP::SetShared ( const float &  m) [inline]

Definition at line 32 of file RecoTracktoTP.h.

References m, and shared_.

Referenced by TrackAlgoCompareUtil::produce().

{shared_= m;}
void RecoTracktoTP::SetTrackingParticle ( TrackingParticleRef  tp) [inline]

Definition at line 28 of file RecoTracktoTP.h.

References trackingParticle_.

Referenced by TrackAlgoCompareUtil::produce().

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

Definition at line 57 of file RecoTracktoTP.h.

References simPCA_, and v.

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

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

Definition at line 77 of file RecoTracktoTP.h.

References numTPMothers(), and TPMother().

Referenced by TPMother().

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

Definition at line 18 of file RecoTracktoTP.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 91 of file RecoTracktoTP.h.

Referenced by BeamSpot(), and SetBeamSpot().

Definition at line 84 of file RecoTracktoTP.h.

Referenced by matched(), RT(), and SetRecoTrack().

Definition at line 85 of file RecoTracktoTP.h.

Referenced by hasRV(), RV(), and SetRecoVertex().

float RecoTracktoTP::shared_ [protected]

Definition at line 92 of file RecoTracktoTP.h.

Referenced by GetShared(), and SetShared().

Definition at line 89 of file RecoTracktoTP.h.

Referenced by s_p(), and SetTrackingParticleMomentumPCA().

Definition at line 90 of file RecoTracktoTP.h.

Referenced by s_pca(), and SetTrackingParticlePCA().

Definition at line 87 of file RecoTracktoTP.h.

Referenced by matched(), SetTrackingParticle(), and TP().