CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes | Friends

TrackingParticle Class Reference

#include <TrackingParticle.h>

Inheritance diagram for TrackingParticle:
ParticleBase

List of all members.

Public Types

typedef std::multimap
< DetId::Detector, PSimHit
DetectorToPSimHit
typedef std::vector< SimTrack >
::const_iterator 
g4t_iterator
typedef
GenParticleRefVector::iterator 
genp_iterator
typedef edm::Ref
< edm::HepMCProduct,
HepMC::GenParticle > 
GenParticleRef
typedef edm::RefVector
< edm::HepMCProduct,
HepMC::GenParticle > 
GenParticleRefVector
 reference to HepMC::GenParticle
typedef std::vector
< TrackingVertex
TrackingVertexCollection
typedef edm::Ref
< TrackingVertexCollection
TrackingVertexRef
typedef edm::RefVector
< TrackingVertexCollection
TrackingVertexRefVector
typedef
TrackingVertexRefVector::iterator 
tv_iterator

Public Member Functions

void addDecayVertex (const TrackingVertexRef &)
void addG4Track (const SimTrack &)
void addGenParticle (const GenParticleRef &)
void addPSimHit (const PSimHit &)
void clearDecayVertices ()
void clearParentVertex ()
const TrackingVertexRefVectordecayVertices () const
tv_iterator decayVertices_begin () const
tv_iterator decayVertices_end () const
EncodedEventId eventId () const
g4t_iterator g4Track_begin () const
g4t_iterator g4Track_end () const
const std::vector< SimTrack > & g4Tracks () const
const GenParticleRefVectorgenParticle () const
genp_iterator genParticle_begin () const
 iterators
genp_iterator genParticle_end () const
int matchedHit () const
const TrackingVertexRefparentVertex () const
int pdgId () const
 PDG id, signal source, crossing number.
const std::vector< PSimHit >
::const_iterator 
pSimHit_begin () const
const std::vector< PSimHit >
::const_iterator 
pSimHit_end () const
void setMatchedHit (const int &)
void setParentVertex (const TrackingVertexRef &)
void setVertex (const Point &vtx, double t)
 TrackingParticle (char q, const LorentzVector &p4, const Point &vtx, double t, const int pdgId, const int status, const EncodedEventId eventId)
 constructor from pointer to generator particle
 TrackingParticle ()
 default constructor
const std::vector< PSimHit > & trackPSimHit () const
std::vector< PSimHittrackPSimHit (DetId::Detector) const
 ~TrackingParticle ()

Private Attributes

TrackingVertexRefVector decayVertices_
EncodedEventId eventId_
std::vector< SimTrackg4Tracks_
 references to G4 and HepMC tracks
GenParticleRefVector genParticles_
int matchedHit_
 Total Number of Hits belonging to the TrackingParticle.
TrackingVertexRef parentVertex_
int pdgId_
 PDG identifier, signal source, crossing number.
float t_
 production time
std::vector< PSimHittrackPSimHit_

Friends

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

Detailed Description

Definition at line 25 of file TrackingParticle.h.


Member Typedef Documentation

Definition at line 43 of file TrackingParticle.h.

typedef std::vector<SimTrack>::const_iterator TrackingParticle::g4t_iterator

Definition at line 36 of file TrackingParticle.h.

Definition at line 35 of file TrackingParticle.h.

Definition at line 34 of file TrackingParticle.h.

reference to HepMC::GenParticle

Definition at line 33 of file TrackingParticle.h.

Definition at line 38 of file TrackingParticle.h.

Definition at line 39 of file TrackingParticle.h.

Definition at line 40 of file TrackingParticle.h.

Definition at line 41 of file TrackingParticle.h.


Constructor & Destructor Documentation

TrackingParticle::TrackingParticle ( ) [inline]

default constructor

Definition at line 46 of file TrackingParticle.h.

{}
TrackingParticle::TrackingParticle ( char  q,
const LorentzVector p4,
const Point vtx,
double  t,
const int  pdgId,
const int  status,
const EncodedEventId  eventId 
)

constructor from pointer to generator particle

Definition at line 8 of file TrackingParticle.cc.

                                                                                                               :
        ParticleBase( q, p4, vtx,pdgId,status ), t_( t ), pdgId_( pdgId ), eventId_( eventId )
{
}
TrackingParticle::~TrackingParticle ( )

Definition at line 14 of file TrackingParticle.cc.

{
}

Member Function Documentation

void TrackingParticle::addDecayVertex ( const TrackingVertexRef ref)
void TrackingParticle::addG4Track ( const SimTrack t)

Definition at line 23 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and TrackingTruthProducer::setTrackingParticle().

{
    g4Tracks_.push_back(t);
}
void TrackingParticle::addGenParticle ( const GenParticleRef )
void TrackingParticle::addPSimHit ( const PSimHit hit)
void TrackingParticle::clearDecayVertices ( )
void TrackingParticle::clearParentVertex ( )
const TrackingVertexRefVector& TrackingParticle::decayVertices ( ) const [inline]

Definition at line 111 of file TrackingParticle.h.

References decayVertices_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and operator<<().

    {
        return decayVertices_;
    }
tv_iterator TrackingParticle::decayVertices_begin ( ) const [inline]
tv_iterator TrackingParticle::decayVertices_end ( ) const [inline]
EncodedEventId TrackingParticle::eventId ( ) const [inline]

Definition at line 60 of file TrackingParticle.h.

References eventId_.

Referenced by TrackingParticleSelector::operator()(), and operator<<().

    {
        return eventId_;
    }
TrackingParticle::g4t_iterator TrackingParticle::g4Track_begin ( ) const

Definition at line 43 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and operator<<().

{
    return g4Tracks_.begin();
}
TrackingParticle::g4t_iterator TrackingParticle::g4Track_end ( ) const

Definition at line 48 of file TrackingParticle.cc.

References g4Tracks_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung(), and operator<<().

{
    return g4Tracks_.end();
}
const std::vector<SimTrack>& TrackingParticle::g4Tracks ( ) const [inline]

Definition at line 93 of file TrackingParticle.h.

References g4Tracks_.

    {
        return g4Tracks_ ;
    }
const GenParticleRefVector& TrackingParticle::genParticle ( ) const [inline]

Definition at line 89 of file TrackingParticle.h.

References genParticles_.

    {
        return genParticles_;
    }
TrackingParticle::genp_iterator TrackingParticle::genParticle_begin ( ) const

iterators

Definition at line 33 of file TrackingParticle.cc.

References edm::RefVector< C, T, F >::begin(), and genParticles_.

Referenced by TrackingParticleSelector::operator()(), and operator<<().

{
    return genParticles_.begin();
}
TrackingParticle::genp_iterator TrackingParticle::genParticle_end ( ) const

Definition at line 38 of file TrackingParticle.cc.

References edm::RefVector< C, T, F >::end(), and genParticles_.

Referenced by TrackingParticleSelector::operator()(), and operator<<().

{
    return genParticles_.end();
}
int TrackingParticle::matchedHit ( ) const [inline]
const TrackingVertexRef& TrackingParticle::parentVertex ( ) const [inline]
int TrackingParticle::pdgId ( ) const [inline]
const std::vector< PSimHit >::const_iterator TrackingParticle::pSimHit_begin ( ) const

Returns the begin of the vector of ALL the PSimHits of the TrackingParticle

Definition at line 53 of file TrackingParticle.cc.

References trackPSimHit_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung().

{
    return trackPSimHit_.begin();
}
const std::vector< PSimHit >::const_iterator TrackingParticle::pSimHit_end ( ) const

Returns the end of the vector of ALL the PSimHits of the TrackingParticle

Definition at line 58 of file TrackingParticle.cc.

References trackPSimHit_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung().

{
    return trackPSimHit_.end();
}
void TrackingParticle::setMatchedHit ( const int &  hitnumb)

Definition at line 92 of file TrackingParticle.cc.

References matchedHit_.

Referenced by TrackingTruthProducer::setTrackingParticle().

{
    matchedHit_ = hitnumb;
}
void TrackingParticle::setParentVertex ( const TrackingVertexRef ref)

Definition at line 72 of file TrackingParticle.cc.

References parentVertex_.

Referenced by TrackingTruthProducer::mergeBremsstrahlung().

{
    parentVertex_ = ref;
}
void TrackingParticle::setVertex ( const Point vtx,
double  t 
)

Definition at line 97 of file TrackingParticle.cc.

References matplotRender::t, and t_.

std::vector< PSimHit > TrackingParticle::trackPSimHit ( DetId::Detector  detector) const

Definition at line 63 of file TrackingParticle.cc.

References DetId::det(), query::result, and trackPSimHit_.

{
    std::vector<PSimHit> result;    
    for (std::vector<PSimHit>::const_iterator iHit = trackPSimHit_.begin(); iHit != trackPSimHit_.end(); ++iHit)
        if ( detector == DetId( (uint32_t)((*iHit).detUnitId()) ).det() )
            result.push_back(*iHit);
    return result;
}
const std::vector<PSimHit>& TrackingParticle::trackPSimHit ( ) const [inline]

Friends And Related Function Documentation

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

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

Definition at line 12 of file TrackingDataPrint.h.

{

    // Compare momenta from sources
    s << "T.P.   Track 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 (TrackingParticle::genp_iterator hepT = tp.genParticle_begin();
            hepT !=  tp.genParticle_end(); ++hepT)
    {
        s << " HepMC Track Momentum " << (*hepT)->momentum().mag() << 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;
        }
    }
    return s;
}

Member Data Documentation

Definition at line 134 of file TrackingParticle.h.

Referenced by eventId().

std::vector<SimTrack> TrackingParticle::g4Tracks_ [private]

references to G4 and HepMC tracks

Definition at line 140 of file TrackingParticle.h.

Referenced by addG4Track(), g4Track_begin(), g4Track_end(), and g4Tracks().

Total Number of Hits belonging to the TrackingParticle.

Definition at line 137 of file TrackingParticle.h.

Referenced by matchedHit(), and setMatchedHit().

Definition at line 147 of file TrackingParticle.h.

Referenced by clearParentVertex(), parentVertex(), and setParentVertex().

int TrackingParticle::pdgId_ [private]

PDG identifier, signal source, crossing number.

Reimplemented from ParticleBase.

Definition at line 133 of file TrackingParticle.h.

Referenced by pdgId().

float TrackingParticle::t_ [private]

production time

Definition at line 131 of file TrackingParticle.h.

Referenced by setVertex().

std::vector<PSimHit> TrackingParticle::trackPSimHit_ [private]

Definition at line 144 of file TrackingParticle.h.

Referenced by addPSimHit(), pSimHit_begin(), pSimHit_end(), and trackPSimHit().