00001 #ifndef SimDataFormats_TrackingDataPrint_h 00002 #define SimDataFormats_TrackingDataPrint_h 00003 00007 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" 00008 #include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h" 00009 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h" 00010 #include <iostream> 00011 00012 std::ostream& operator<< (std::ostream& s, const TrackingParticle & tp) { 00013 00014 // Compare momenta from sources 00015 s << "T.P. Track Momentum, q , ID, & Event # " 00016 << tp.p4() << " " << tp.charge() << " " 00017 << tp.pdgId() << " " 00018 << tp.eventId().bunchCrossing() << "." << tp.eventId().event() 00019 << std::endl; 00020 s << " Hits for this track: " << tp.trackPSimHit().size() 00021 << std::endl; 00022 00023 for (TrackingParticle::genp_iterator hepT = tp.genParticle_begin(); 00024 hepT != tp.genParticle_end(); ++hepT) { 00025 s << " HepMC Track Momentum " << (*hepT)->momentum().mag() << std::endl; 00026 } 00027 for (TrackingParticle::g4t_iterator g4T = tp.g4Track_begin(); 00028 g4T != tp.g4Track_end(); ++g4T) { 00029 s << " Geant Track Momentum " << g4T->momentum() << std::endl; 00030 s << " Geant Track ID & type " << g4T->trackId() << " " 00031 << g4T->type() << std::endl; 00032 if (g4T->type() != tp.pdgId()) { 00033 s << " Mismatch b/t TrackingParticle and Geant types" 00034 << std::endl; 00035 } 00036 } 00037 return s; 00038 } 00039 00040 #endif // SimDataFormats_TrackingDataPrint_H