-
Notifications
You must be signed in to change notification settings - Fork 1
/
dumpSeeds.py
48 lines (35 loc) · 1.58 KB
/
dumpSeeds.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from DataFormats.FWLite import Handle, Events
from ROOT import gROOT, gStyle, TCanvas, TF1, TFile, TTree, gRandom, TH1F, TH2F
import os
eventsRef = Events("step3_ori.root")
tracksRef = Handle("std::vector<reco::Track>")
label = "generalTracks"
quality = "highPurity"
#quality = "tight"
#quality = "loose"
n4=0
n4r=0
for i in range(0, eventsRef.size()):
#for i in range(0, 200):
a= eventsRef.to(i)
print "Event", i
a=eventsRef.getByLabel(label, tracksRef)
trVal = []
for track in tracksRef.product():
# if (track.phi()<0) : continue
# if (track.eta()<0) : continue
# if (track.pt()<5) : continue
if (not track.quality(track.qualityByName(quality))) : continue
# pattern = track.hitPattern()
# if (pattern.numberOfValidHits() != (pattern.numberOfValidPixelHits()+pattern.numberOfValidStripHits())) :
# print pattern.numberOfValidHits(),pattern.numberOfValidPixelHits(),pattern.numberOfValidStripHits(), pattern.numberOfValidPixelHits()+pattern.numberOfValidStripHits()
trVal.append([10*int(100*track.eta())+track.phi(), "ori", track.eta(), track.phi(), track.pt(), track.numberOfValidHits() , track.hitPattern().numberOfValidPixelHits(), track.ndof(),track.chi2(),
track.algo()-4,track.originalAlgo()-4,track.algoMask().to_string(), track.algoMask(), track.quality(track.qualityByName("highPurity"))])
print tracksRef.product().size(), len(trVal)
for tr in trVal :
# print tr
#if (tr[12].count()<1) : print tr
if (tr[12].test(4+4)) :
n4+=1
if (tr[12].count()>1) : n4r+=1 #print tr
print n4, n4r