CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
AlphaT Class Reference

#include <AlphaT.h>

Public Member Functions

template<class T >
 AlphaT (std::vector< T const * > const &p4, bool setDHtZero=false, bool use_et=true)
 
template<class T >
 AlphaT (std::vector< T > const &p4, bool setDHtZero=false, bool use_et=true)
 
double value (void) const
 
double value (std::vector< bool > &jet_sign) const
 

Private Member Functions

double value_ (std::vector< bool > *jet_sign) const
 

Private Attributes

std::vector< double > et_
 
std::vector< double > px_
 
std::vector< double > py_
 
bool setDHtZero_
 

Detailed Description

Definition at line 9 of file AlphaT.h.

Constructor & Destructor Documentation

template<class T >
AlphaT::AlphaT ( std::vector< T const * > const &  p4,
bool  setDHtZero = false,
bool  use_et = true 
)

Definition at line 34 of file AlphaT.h.

References et_, reco::tau::disc::Pt(), px_, py_, HLT_25ns14e33_v1_cff::setDHtZero, setDHtZero_, and create_public_lumi_plots::transform.

34  {
35  std::transform( p4.begin(), p4.end(), back_inserter(et_), ( use_et ? std::mem_fun(&T::Et) : std::mem_fun(&T::Pt) ) );
36  std::transform( p4.begin(), p4.end(), back_inserter(px_), std::mem_fun(&T::Px) );
37  std::transform( p4.begin(), p4.end(), back_inserter(py_), std::mem_fun(&T::Py) );
39 }
std::vector< double > px_
Definition: AlphaT.h:19
std::vector< double > py_
Definition: AlphaT.h:20
std::vector< double > et_
Definition: AlphaT.h:18
double p4[4]
Definition: TauolaWrapper.h:92
bool setDHtZero_
Definition: AlphaT.h:28
long double T
template<class T >
AlphaT::AlphaT ( std::vector< T > const &  p4,
bool  setDHtZero = false,
bool  use_et = true 
)

Definition at line 43 of file AlphaT.h.

References et_, reco::tau::disc::Pt(), px_, py_, HLT_25ns14e33_v1_cff::setDHtZero, setDHtZero_, and create_public_lumi_plots::transform.

43  {
44  std::transform( p4.begin(), p4.end(), back_inserter(et_), std::mem_fun_ref( use_et ? &T::Et : &T::Pt ) );
45  std::transform( p4.begin(), p4.end(), back_inserter(px_), std::mem_fun_ref(&T::Px) );
46  std::transform( p4.begin(), p4.end(), back_inserter(py_), std::mem_fun_ref(&T::Py) );
48 }
std::vector< double > px_
Definition: AlphaT.h:19
std::vector< double > py_
Definition: AlphaT.h:20
std::vector< double > et_
Definition: AlphaT.h:18
double p4[4]
Definition: TauolaWrapper.h:92
bool setDHtZero_
Definition: AlphaT.h:28

Member Function Documentation

double AlphaT::value ( void  ) const
inline

Definition at line 53 of file AlphaT.h.

References value_().

Referenced by SUSY_HLT_alphaT::analyze(), and average.Average::average().

53  {
54  return value_(0);
55 }
double value_(std::vector< bool > *jet_sign) const
Definition: AlphaT.cc:3
double AlphaT::value ( std::vector< bool > &  jet_sign) const
inline

Definition at line 59 of file AlphaT.h.

References value_().

Referenced by average.Average::average().

59  {
60  return value_(& jet_sign);
61 }
double value_(std::vector< bool > *jet_sign) const
Definition: AlphaT.cc:3
double AlphaT::value_ ( std::vector< bool > *  jet_sign) const
private

Definition at line 3 of file AlphaT.cc.

References funct::abs(), et_, i, j, bookConverter::max, px_, py_, setDHtZero_, and mathSSE::sqrt().

Referenced by value().

3  {
4 
5  // Clear pseudo-jet container
6  if (jet_sign) {
7  jet_sign->clear();
8  jet_sign->resize(et_.size());
9  }
10 
11  // check the size of the input collection
12  if (et_.size() == 0)
13  // empty jet collection, return AlphaT = 0
14  return 0.;
15 
16  if (et_.size() > (unsigned int) std::numeric_limits<unsigned int>::digits)
17  // too many jets, return AlphaT = a very large number
19 
20  // Momentum sums in transverse plane
21  const double sum_et = std::accumulate( et_.begin(), et_.end(), 0. );
22  const double sum_px = std::accumulate( px_.begin(), px_.end(), 0. );
23  const double sum_py = std::accumulate( py_.begin(), py_.end(), 0. );
24 
25  // Minimum Delta Et for two pseudo-jets
26  double min_delta_sum_et = sum_et;
27 
28  if(setDHtZero_){
29  min_delta_sum_et = 0.;
30  }else{
31  for (unsigned int i = 0; i < (1U << (et_.size() - 1)); i++) { //@@ iterate through different combinations
32  double delta_sum_et = 0.;
33  for (unsigned int j = 0; j < et_.size(); ++j) { //@@ iterate through jets
34  if (i & (1U << j))
35  delta_sum_et -= et_[j];
36  else
37  delta_sum_et += et_[j];
38  }
39  delta_sum_et = std::abs(delta_sum_et);
40  if (delta_sum_et < min_delta_sum_et) {
41  min_delta_sum_et = delta_sum_et;
42  if (jet_sign) {
43  for (unsigned int j = 0; j < et_.size(); ++j)
44  (*jet_sign)[j] = ((i & (1U << j)) == 0);
45  }
46  }
47  }
48  }
49  // Alpha_T
50  return (0.5 * (sum_et - min_delta_sum_et) / sqrt( sum_et*sum_et - (sum_px*sum_px+sum_py*sum_py) ));
51 }
std::vector< double > px_
Definition: AlphaT.h:19
int i
Definition: DBlmapReader.cc:9
std::vector< double > py_
Definition: AlphaT.h:20
std::vector< double > et_
Definition: AlphaT.h:18
T sqrt(T t)
Definition: SSEVec.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
bool setDHtZero_
Definition: AlphaT.h:28

Member Data Documentation

std::vector<double> AlphaT::et_
private

Definition at line 18 of file AlphaT.h.

Referenced by AlphaT(), and value_().

std::vector<double> AlphaT::px_
private

Definition at line 19 of file AlphaT.h.

Referenced by AlphaT(), and value_().

std::vector<double> AlphaT::py_
private

Definition at line 20 of file AlphaT.h.

Referenced by AlphaT(), and value_().

bool AlphaT::setDHtZero_
private

Definition at line 28 of file AlphaT.h.

Referenced by AlphaT(), and value_().