CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
TrackingDataPrint.h File Reference
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
#include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h"
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h"
#include <iostream>

Go to the source code of this file.

Functions

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

Function Documentation

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

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

Definition at line 12 of file TrackingDataPrint.h.

13 {
14 
15  // Compare momenta from sources
16  s << "T.P. Track Momentum, q , ID, & Event # "
17  << tp.p4() << " " << tp.charge() << " "
18  << tp.pdgId() << " "
19  << tp.eventId().bunchCrossing() << "." << tp.eventId().event()
20  << std::endl;
21  s << " Hits for this track: " << tp.trackPSimHit().size()
22  << std::endl;
23 
25  hepT != tp.genParticle_end(); ++hepT)
26  {
27  s << " HepMC Track Momentum " << (*hepT)->momentum().mag() << std::endl;
28  }
30  g4T != tp.g4Track_end(); ++g4T)
31  {
32  s << " Geant Track Momentum " << g4T->momentum() << std::endl;
33  s << " Geant Track ID & type " << g4T->trackId() << " "
34  << g4T->type() << std::endl;
35  if (g4T->type() != tp.pdgId())
36  {
37  s << " Mismatch b/t TrackingParticle and Geant types"
38  << std::endl;
39  }
40  }
41  return s;
42 }
genp_iterator genParticle_begin() const
iterators
int event() const
get the contents of the subdetector field (should be protected?)
g4t_iterator g4Track_begin() const
int pdgId() const
PDG ID.
int bunchCrossing() const
get the detector field from this detid
std::vector< SimTrack >::const_iterator g4t_iterator
genp_iterator genParticle_end() const
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
EncodedEventId eventId() const
Signal source, crossing number.
int charge() const
Electric charge. Note this is taken from the first SimTrack only.
g4t_iterator g4Track_end() const