Logical error of a function passing a pointer to an array

The parameter list looks strange. What exactly are you trying to achieve? Even if voxels and sie are compile time constants, the value is ignored in the parameter! You could as well write:
H(Double_t lambda[], Double_t s2s[], ...)
or even
H(Double_t *lambda, Double_t *s2s, ...)

Arrays decay to pointer in function arguments. If you really want C style array passing, you should pass the corresponding length as separate argument!
When using std::vector or std::array, argument passing works the way you would expect it. Please note that you are copying L! Is that what you really want to do?

Also, where does “ar” come from? It seems to be a global variable. Don’t do that. I don’t exactly understand what you are trying to achieve. Maybe pass “ar” as argument so that you can change it? Most probably the best solution would be to return a std::vector<Double_t> instead of a pointer to double!