Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #FIRST PART
- el_hit =0
- el_proto=0
- el_mc=0
- for i in xrange(1000):
- #setting protos
- protos = TES["Rec/ProtoP/MyProtoParticles"]
- protos = filter(lambda x: is_el_from_ks(x),protos)
- protos_keys = map(lambda x: get_mcpar(x).key(),protos)
- #setting mc ks0s and els
- ks0s = TES["MC/Particles"]
- ks0s = filter(lambda x: is_kspipiee(x),ks0s)
- ks0_products = map(lambda x: x.endVertices()[-1].products(),ks0s)
- ks0_els = []
- for el in ks0_products:
- el = filter(lambda x: abs(x.particleID().pid())==11,el)
- ks0_els+=el
- #ks0_els = filter(lambda x: x.momentum().theta()>0.015 and x.momentum().theta()<0.3,ks0_els)
- #setting vclusters
- vclusters = TES["Raw/Velo/Clusters"]
- vclusters = filter(lambda x: is_el_hit_from_ks(x),vclusters)
- els_vclusters = map(lambda x: mcid_to_particle2(x).key(),vclusters)
- for ks0 in ks0_els:
- key = ks0.key()
- el_mc+=1
- if key in els_vclusters: el_hit +=1
- if key in protos_keys: el_proto+=1
- frac_hit = float(el_hit)/el_mc
- frac_proto = float(el_proto)/el_mc
- print "%f %% have hits"%(100*frac_hit)
- print "%f %% have track"%(100*frac_proto)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement