Fork me on GitHub

Opened 13 years ago

Last modified 12 years ago

#49 closed Task

math related suggestions — at Version 1

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 (1)

comment:1 by Pavel Demin, 13 years ago

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