Giter VIP home page Giter VIP logo

geom4hep's People

Contributors

grasph avatar moelf avatar ndinsmore avatar peremato avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

geom4hep's Issues

Hunting allocation

if I run through --track-allocation=user, the only allocation I see is:

julia> generateXRay(nav2, world2, 1000, 1);

julia> Profile.clear_malloc_data()

julia> generateXRay(nav2, world2, 1000, 1);

        - function getClosestDaughter(nav::NAV, volume::Volume{T}, point::Point3{T}, dir::Vector3{T}, step_limit::T ) where {T,NAV}
        -     step = step_limit
        -     candidate = 0
        -     #---Linear loop over the daughters-------------------------------------------------
        0     for pvol in intersectedDaughters(nav, volume, point, dir)
        -         #---Assuming that it is not yet inside the daughter (otherwise it returns -1.)
 59378816         dist = distanceToIn(pvol, point, dir)
        0         dist < 0. && return (zero(T), pvol.idx ) 
        0         if dist > 0. && dist != Inf && dist < step
        -             step = dist
        0             candidate = pvol.idx
        -         end
        0     end
        0     return step, candidate
        - end
        - 
        - #---Update the NavigatorState and get the step (distance)
        - function computeStep!(state::NavigatorState{T,NAV}, gpoint::Point3{T}, gdir::Vector3{T}, step_limit::T) where {T,NAV}
        0     lpoint, ldir = transform(state.tolocal, gpoint, gdir) 
        0     volume = currentVolume(state)
        0     step, idx = getClosestDaughter(state.navigator, volume, lpoint, ldir, step_limit)
        -     #---If didn't hit any daughter return distance to out
        0     if idx == 0
  3914320         step = distanceToOut(volume.shape, lpoint, ldir)
        0         if step > -kTolerance(T)
        0             popOut!(state)
        0         elseif step < 0
        0             shape = volume.shape
        0             volstack = state.volstack
        0             error(lazy"Negative distanceToOut. \nstep = $step \nshape = $shape \nvolstack = $volstack \npoint = $lpoint \ndir =   $ldir" )
        -         end
        -     else
        -     #---We hit a daughter, push it into the stack
        0         step += kPushTolerance(T)  # to ensure that do not stay in the surface of the daughter
        0         pvol = volume.daughters[idx]
        0         pushIn!(state, pvol)
        -     end
        0     return step
        - end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.