I think you could do something like
```
for (uint32_t d = 0; d < simDim; ++d)
 windowFactor *= winFkt(particle_locationNow[d], simBoxSize[d] * CELL_SIZE[d]);
```