[Rivet] inRange trouble

Andy Buckley andy.buckley at ed.ac.uk
Thu Sep 22 12:07:35 BST 2011


On 22/09/11 11:34, Frank Siegert wrote:
> On 22/09/11 10:18, Hendrik Hoeth wrote:
>> Thus spake Frank Siegert (frank.siegert at cern.ch):
>>> 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?
>>
>> And of course no user has or will ever put an integer value in that
>> function, so we are safe.
>
> I'm not sure where to place the cut of what has to be safe guarded
> against C++ mistakes of analysis authors, but if you and Andy agree that
> the above is a problem, then I'm outvoted.

Not a big problem, but I do believe that part of Rivet's appeal to 
would-be analysis authors has to be in not doing unexpected things. And 
since C++ is full of unexpected things, we have to work a bit to hide 
that. IMO it's a desirable enhancement rather than a bug.

> Is Jenkins doing anything special in the build for this warning to show
> up? I can't reproduce it right now.

Newer/pickier-than-average C++ compiler, maybe?

-- 
Dr Andy Buckley
SUPA Advanced Research Fellow
Particle Physics Experiment Group, University of Edinburgh

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the Rivet mailing list