Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-07 22:34:06

0001 #!/usr/bin/env python3
0002 
0003 from __future__ import print_function
0004 import ROOT
0005 
0006 from Validation.RecoTrack.plotting.ntuple import *
0007 
0008 # The purpose of this file is to demonstrate the printout features of the ntuple library
0009 
0010 def main():
0011     ntuple = TrackingNtuple("trackingNtuple.root")
0012 
0013     printTrack = TrackPrinter(trackingParticlePrinter=TrackingParticlePrinter())
0014     printTP = TrackingParticlePrinter(trackPrinter=TrackPrinter())
0015 
0016     for event in ntuple:
0017         print("Event", event.eventIdStr())
0018         print("Fake tracks")
0019         for track in event.tracks():
0020             if track.nMatchedTrackingParticles() == 0:
0021                 printTrack(track)
0022                 print()
0023 
0024         print("Duplicate tracks")
0025         for tp in event.trackingParticles():
0026             if tp.nMatchedTracks() >= 2:
0027                 printTP(tp)
0028                 print()
0029         print()
0030 
0031         if event.entry() >= 1:
0032             break
0033 
0034 if __name__ == "__main__":
0035     main()