The KinematicHelper class

This collects together a few commom functions which are applied often to kinematic quantities (i.e. qunatities honouring the IKinematic interface. It was clear that these functions are not specific to Atlfast and so have been collected together ijn a helper class at least temporarily in order to make them easily  accessable to users.

This list is clearly rather rudimentary at present as it represents only those operations needed for the prototype Atlfast code. Clearly many more summations could be included. However we are developing a more generic approach which would provide only one sum() method , and use function objects to specify what it to be summed and what is to be included.
 

Include file : "AtlfastCode/KinematicHelper.h"
 

Source code:   .cxx

 

Method Argument description Operation
double deltaR( 
  IKinematic* a, 
  IKinematic* b 
)
Pointers to any two objects honouring the IKinematic interface. Calculates the distance in R-space (eta-phi space) between the directions of the operands. 
double deltaR( 
  IKinematic& a, 
  IKinematic& b 
)
References to any two objects honouring the IKinematic interface. As above
template< class Itr > 
sumETInCone( 
  Itr begin, 
  Itr end, 
  IKinematic* reference, 
  double rConeSize 
)
begin and end are any iterators to the ends of a list containing items which de-reference to type IKinematic* 

reference is a pointer to an IKinematic to specify the centre of the cone 

rConeSize specifies the maximum distance in eta-phi space between reference and each item in the list  for inclusion in the sum.

Sums the transverse energy of each item in the iterated list which is within the specified cone
 

Examples:

1) To find the distance in R-space between two objects (here Clusters)

Cluster  c1 ;      // Cluster honours IKinematic interface
Cluster  c2 ;

KinematicHelper myHelp ;
 
double delta =  myHelp.deltaR( c1, c2 ) ;
 

2) To sum eT within a collection of Cells ,in a cone around a particle.

vector<Cell*> myCells ;
... assume vector filled with pointers to Cells...

ReconstructedParticle particle ;
....

double coneSize = 0.4 ;

double eTsum = myHelp.sumETInCone( myCells.begin(), myCells.end(), &particle, coneSize );