File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 5050 rootfile = UnROOT. samplefile (" NanoAODv5_sample.root" )
5151 t = LazyTree (rootfile, " Events" , " nMuon" )
5252 @test t[2 ] == t[CartesianIndex (2 )]
53+ # need two separate functions so compiler doesn't optimize away
5354 testf (evt) = evt. nMuon == 4
5455 testf2 (evt) = evt. nMuon == 4
5556 # precompile
5657 testf .(t)
5758 testf2 .(t)
5859 findall (@. testf (t) & testf2 (t))
5960 # #########
61+ a1 = testf .(t)
6062 alloc1 = @allocated a1 = testf .(t)
63+ a2 = testf2 .(t)
6164 alloc1 += @allocated a2 = testf2 .(t)
65+ idx1 = findall (a1 .& a2)
6266 alloc1 += @allocated idx1 = findall (a1 .& a2)
67+ idx2 = findall (@. testf (t) & testf2 (t))
6368 alloc2 = @allocated idx2 = findall (@. testf (t) & testf2 (t))
6469 @assert ! isempty (idx1)
6570 @test idx1 == idx2
You can’t perform that action at this time.
0 commit comments