[Rivet] inRange trouble

Frank Siegert frank.siegert at cern.ch
Thu Sep 22 09:00:53 BST 2011


Hi Hendrik,

On 22/09/11 09:58, Hendrik Hoeth wrote:
>    if (inRange(jetpt/GeV, 10, 15)) { ... }

Isn't that wrong and should be
      if (inRange(jetpt/GeV, 10.0, 15.0)) { ... }
?
With that you shouldn't run into the problems you describe below, right?

Cheers,
Frank

> and the compiler tells us that it's not a good idea to put a double into
> a function that takes an integer argument:
>
>    passing 'double' for argument 1 to 'bool Rivet::inRange(int, int, int, Rivet::RangeBoundary, Rivet::RangeBoundary)'
>
> So, what do we do? Right now the function is templated, so that the
> first three arguments have the same type. Adding an inRange(double,<T>,<T>)
> won't work, because it introduces an ambiguity. Getting rid of the
> templates altogether means we need to introduce a loooong list of
> inRange functions.
>
> Any ideas, other than porting Rivet to python?
>
> Cheers,
>
>     Hendrik
>


More information about the Rivet mailing list