21 if opts.track
is None and opts.trackingParticle
is None and opts.seed
is None and opts.pixelHit
is None and opts.stripHit
is None:
24 ntpl = ntuple.TrackingNtuple(opts.file)
26 if opts.entry
is not None:
27 event = ntpl.getEvent(opts.entry)
28 print event.eventIdStr()
29 elif opts.event
is not None:
31 print "Entry %d" % event.entry()
33 hasHits = ntpl.hasHits()
34 hasSeeds = ntpl.hasSeeds()
36 if not hasSeeds
and opts.seed
is not None:
37 print "Ntuple %s does not have seeds saved!" % opts.file
39 if not hasHits
and (opts.pixelHit
is not None or opts.stripHit
is not None):
40 print "Ntuple %s does not have hits saved!" % opts.file
43 seedArgs =
dict(hits=hasHits, bestMatchingTrackingParticle=hasHits)
44 trackArgs =
dict(hits=hasHits, bestMatchingTrackingParticle=hasHits)
45 tpArgs =
dict(hits=hasHits, bestMatchingTrack=hasHits)
47 trackArgs[
"seedPrinter"] =
None 48 tpArgs[
"seedPrinter"] =
None 50 trackArgs[
"seedPrinter"] = ntuple.SeedPrinter(**seedArgs)
51 tpArgs[
"seedPrinter"] = ntuple.SeedPrinter(**seedArgs)
53 printSeed = ntuple.SeedPrinter(trackingParticles=
True, trackingParticlePrinter=ntuple.TrackingParticlePrinter(**tpArgs), **seedArgs)
54 printTrack = ntuple.TrackPrinter(trackingParticlePrinter=ntuple.TrackingParticlePrinter(**tpArgs), **trackArgs)
55 printTrackingParticle = ntuple.TrackingParticlePrinter(trackPrinter=ntuple.TrackPrinter(**trackArgs), **tpArgs)
57 if opts.track
is not None:
58 trk = event.tracks()[opts.track]
61 if opts.trackingParticle
is not None:
62 tp = event.trackingParticles()[opts.trackingParticle]
63 printTrackingParticle(tp)
65 if opts.seed
is not None:
67 if opts.seedIteration
is not None:
68 seed = seeds.seedForAlgo(getattr(ntuple.Algo, opts.seedIteration), opts.seed)
70 seed = seeds[opts.seed]
73 if opts.pixelHit
is not None:
74 hit = event.pixelHits()[opts.pixelHit]
75 print "Pixel hit %d tracks" % opts.pixelHit
76 for t
in hit.tracks():
79 print "Pixel hit %d seeds" % opts.pixelHit
83 if opts.stripHit
is not None:
84 hit = event.stripHits()[opts.stripHit]
85 print "Strip hit %d tracks" % opts.stripHit
86 for t
in hit.tracks():
89 print "Strip hit %d seeds" % opts.stripHit
def findEvent(ntpl, event)