Fork me on GitHub

Opened 12 years ago

Last modified 12 years ago

#49 closed Task

math related suggestions — at Version 3

Reported by: Pavel Demin Owned by:
Priority: major Milestone:
Component: Delphes code Version:
Keywords: Cc:

Description (last modified by Pavel Demin)

Looking at the Delphes code, I've noticed a couple of things that could be improved:

  • Most of the underlying libraries operate with double precision numbers. However in Delphes, some variables are single precision. Should not we switch to double for all variables?
  • There are at least 13 calls to something like sqrt(pow(x,2), pow(y,2)). As most of them are inside loops, it would be better to replace them with hypot(x, y). Here is a command to find corresponding lines:
    grep -r "sqrt( *pow" trunk/* | grep c:
    
  • A strange pi constant is defined as 3.14159265358979312 in interface/D_Constants.h and in Utilities/Fastjet/plugins/CDFCones/interface/CalTower.hh. Normally, it should be 3.14159265358979323846. Moreover M_PI is already defined in math.h, pi and twopi are defined in Utilities/CLHEP/Units/PhysicalConstants.h. It would be better to use definitions from PhysicalConstants.h.

Change History (3)

comment:1 by Pavel Demin, 12 years ago

Description: modified (diff)

comment:2 by Pavel Demin, 12 years ago

Description: modified (diff)

comment:3 by Pavel Demin, 12 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.