CMS 3D CMS Logo

Typedefs | Functions

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/SimDataFormats/TrackingAnalysis/src/TrackingParticle.cc File Reference

#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"

Go to the source code of this file.

Typedefs

typedef std::vector
< TrackingVertex
TrackingVertexCollection
typedef edm::Ref
< TrackingVertexCollection
TrackingVertexRef
typedef edm::RefVector
< TrackingVertexCollection
TrackingVertexRefVector
typedef
TrackingVertexRefVector::iterator 
tv_iterator

Functions

std::ostream & operator<< (std::ostream &s, TrackingParticle const &tp)

Typedef Documentation

Definition at line 3 of file TrackingParticle.cc.

Definition at line 4 of file TrackingParticle.cc.

Definition at line 5 of file TrackingParticle.cc.

Definition at line 6 of file TrackingParticle.cc.


Function Documentation

std::ostream& operator<< ( std::ostream &  s,
TrackingParticle const &  tp 
)

Concrete TrackingParticle. All track parameters are passed in the constructor and stored internally.

Definition at line 103 of file TrackingParticle.cc.

References EncodedEventId::bunchCrossing(), DetId::Calo, ParticleBase::charge(), TrackingParticle::decayVertices(), TrackingParticle::decayVertices_begin(), TrackingParticle::decayVertices_end(), EncodedEventId::event(), TrackingParticle::eventId(), TrackingParticle::g4Track_begin(), TrackingParticle::g4Track_end(), TrackingParticle::genParticle_begin(), TrackingParticle::genParticle_end(), i, ParticleBase::p4(), TrackingParticle::parentVertex(), TrackingParticle::pdgId(), alignCSCRings::s, edm::RefVector< C, T, F >::size(), TrackingParticle::trackPSimHit(), and ParticleBase::vertex().

{
    s << "TP momentum, q, ID, & Event #: "
    << tp.p4()                      << " " << tp.charge() << " "   << tp.pdgId() << " "
    << tp.eventId().bunchCrossing() << "." << tp.eventId().event() << std::endl;
    s << " Hits for this track: " << tp.trackPSimHit().size() << std::endl;

    for (int i = 1; i < DetId::Calo + 1; ++i)
    {
        int numberOfHits = tp.trackPSimHit((DetId::Detector)i).size();
        if (numberOfHits)
          s << "\t sub-detector id : " << i << " -> " << numberOfHits << std::endl;
    }

    for (TrackingParticle::genp_iterator hepT = tp.genParticle_begin(); hepT !=  tp.genParticle_end(); ++hepT)
    {
        s << " HepMC Track Momentum " << (*hepT)->momentum().rho() << std::endl;
    }

    for (TrackingParticle::g4t_iterator g4T = tp.g4Track_begin(); g4T !=  tp.g4Track_end(); ++g4T)
    {
        s << " Geant Track Momentum  " << g4T->momentum() << std::endl;
        s << " Geant Track ID & type " << g4T->trackId() << " " << g4T->type() << std::endl;
        if (g4T->type() !=  tp.pdgId())
        {
            s << " Mismatch b/t TrackingParticle and Geant types" << std::endl;
        }
    }
    // Loop over decay vertices
    s << " TP Vertex " << tp.vertex() << std::endl;
    s << " Source vertex: " << tp.parentVertex()->position() << std::endl;
    s << " " << tp.decayVertices().size() << " Decay vertices" << std::endl;
    for (tv_iterator iTV = tp.decayVertices_begin(); iTV != tp.decayVertices_end(); ++iTV)
    {
        s << " Decay vertices:      " << (**iTV).position() << std::endl;
    }

    return s;
}