Closed jchelly closed 5 months ago
We need to decide what to do when there aren't enough collisionless particles. We could either use the most bound of the other particles, or just use fewer particles.
This may not matter if we also impose a minimum number of collisionless particles per halo.
This now prefers to use tracers to compute the halo position and velocity for merging, but will use non-tracer types if there are fewer than NumPartCoreMax=20 tracer type particles.
I've also added a unit test for the DMO case. New unit tests can be added by placing a source file in ./tests/ and adding it's name in tests/CMakeLists.txt. Tests can be run with "make test" in the build directory.
There are already some tests in src/tests (which I hadn't spotted until now!), but they seem to test basic language and library features rather than HBT itself.
In DMO runs the only thing that changes is the number of particles used to compute satellite positions and velocities. This has very little effect on the mass function in L1000N0900/DMO_FIDUCIAL, so at least nothing has been dramatically broken:
And for just FoF groups with masses 1e13 to 1e14 Msolar/h:
Is it ok if I review this now or are you still working on it @jchelly?
I haven't tried it out on a hydro run yet. I'll set that up now.
Here's the effect on the mass function on L1000N0900/HYDRO_FIDUCIAL.
And the stellar mass function:
This PR will limit the particles used in the merging calculation to collisionless types. We would also like to avoid using the velocity of a single particle as the velocity of the satellite when checking for mergers.
I've started by modifying the code to use the BuildPosition and BuildVelocity functions for both satellites and centrals when determining if halos have merged. Central and satellite position/velocity is then the mass weighted mean of the most bound NumPartCoreMax=20 particles.