test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions
heppy::AlphaT Struct Reference

#include <AlphaT.h>

Static Public Member Functions

static double getAlphaT (const std::vector< double > &et, const std::vector< double > &px, const std::vector< double > &py)
 

Detailed Description

Definition at line 19 of file AlphaT.h.

Member Function Documentation

double AlphaT::getAlphaT ( const std::vector< double > &  et,
const std::vector< double > &  px,
const std::vector< double > &  py 
)
static

Definition at line 9 of file AlphaT.cc.

References i, j, metsig::jet, and mathSSE::sqrt().

11  {
12 
13  // Momentum sums in transverse plane
14  const double sum_et = accumulate( et.begin(), et.end(), 0. );
15  const double sum_px = accumulate( px.begin(), px.end(), 0. );
16  const double sum_py = accumulate( py.begin(), py.end(), 0. );
17 
18  // Minimum Delta Et for two pseudo-jets
19  double min_delta_sum_et = -1.;
20  for ( unsigned i=0; i < unsigned(1<<(et.size()-1)); i++ ) { //@@ iterate through different combinations
21  double delta_sum_et = 0.;
22  std::vector<bool> jet;
23  for ( unsigned j=0; j < et.size(); j++ ) { //@@ iterate through jets
24  delta_sum_et += et[j] * ( 1 - 2 * (int(i>>j)&1) );
25  }
26  if ( ( fabs(delta_sum_et) < min_delta_sum_et || min_delta_sum_et < 0. ) ) {
27  min_delta_sum_et = fabs(delta_sum_et);
28  }
29  }
30  if ( min_delta_sum_et < 0. ) { return 0.; }
31 
32  // Alpha_T
33  return ( 0.5 * ( sum_et - min_delta_sum_et ) / sqrt( sum_et*sum_et - (sum_px*sum_px+sum_py*sum_py) ) );
34 
35  }
int i
Definition: DBlmapReader.cc:9
T sqrt(T t)
Definition: SSEVec.h:48
int j
Definition: DBlmapReader.cc:9