ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/grimes/TrackingTruthCode/SimDataFormats/TrackingAnalysis/interface/TrackingDataPrint.h
Revision: 1.1
Committed: Wed Mar 20 17:13:47 2013 UTC (12 years, 1 month ago) by grimes
Content type: text/plain
Branch: MAIN
CVS Tags: OldTrackingParticles_v0, base_6_0_0, HEAD
Branch point for: NewTrackingParticles
Log Message:
First commit of the base 6.0.0 files

File Contents

# User Rev Content
1 grimes 1.1 #ifndef SimDataFormats_TrackingDataPrint_h
2     #define SimDataFormats_TrackingDataPrint_h
3     /** Concrete TrackingParticle.
4     * All track parameters are passed in the constructor and stored internally.
5     */
6    
7     #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
8     #include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h"
9     #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h"
10     #include <iostream>
11    
12     std::ostream& operator<< (std::ostream& s, const TrackingParticle & tp)
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    
24     for (TrackingParticle::genp_iterator hepT = tp.genParticle_begin();
25     hepT != tp.genParticle_end(); ++hepT)
26     {
27     s << " HepMC Track Momentum " << (*hepT)->momentum().mag() << std::endl;
28     }
29     for (TrackingParticle::g4t_iterator g4T = tp.g4Track_begin();
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     }
43    
44     #endif // SimDataFormats_TrackingDataPrint_H