CMS 3D CMS Logo

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 &p4, bool setDHtZero=false, bool use_et=true)
 
template<class T >
 AlphaT (std::vector< T const * > const &p4, bool setDHtZero=false, bool use_et=true)
 
double value (std::vector< bool > &jet_sign) const
 
double value (void) 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 8 of file AlphaT.h.

Constructor & Destructor Documentation

◆ AlphaT() [1/2]

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

◆ AlphaT() [2/2]

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

Definition at line 32 of file AlphaT.h.

32  {
33  std::transform(p4.begin(), p4.end(), back_inserter(et_), std::mem_fn(use_et ? &T::Et : &T::Pt));
34  std::transform(p4.begin(), p4.end(), back_inserter(px_), std::mem_fn(&T::Px));
35  std::transform(p4.begin(), p4.end(), back_inserter(py_), std::mem_fn(&T::Py));
36  setDHtZero_ = setDHtZero;
37 }

References et_, p4, px_, py_, setDHtZero_, and HcalDetIdTransform::transform().

Member Function Documentation

◆ value() [1/2]

double AlphaT::value ( std::vector< bool > &  jet_sign) const
inline

Definition at line 43 of file AlphaT.h.

43 { return value_(&jet_sign); }

References value_().

Referenced by average.Average::average().

◆ value() [2/2]

double AlphaT::value ( void  ) const
inline

Definition at line 40 of file AlphaT.h.

40 { return value_(nullptr); }

References value_().

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

◆ value_()

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

Definition at line 5 of file AlphaT.cc.

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

References funct::abs(), et_, mps_fire::i, createfilelist::int, dqmiolumiharvest::j, SiStripPI::max, px_, py_, setDHtZero_, mathSSE::sqrt(), and mitigatedMETSequence_cff::U.

Referenced by value().

Member Data Documentation

◆ et_

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

Definition at line 17 of file AlphaT.h.

Referenced by AlphaT(), and value_().

◆ px_

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

Definition at line 18 of file AlphaT.h.

Referenced by AlphaT(), and value_().

◆ py_

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

Definition at line 19 of file AlphaT.h.

Referenced by AlphaT(), and value_().

◆ setDHtZero_

bool AlphaT::setDHtZero_
private

Definition at line 27 of file AlphaT.h.

Referenced by AlphaT(), and value_().

mps_fire.i
i
Definition: mps_fire.py:428
AlphaT::px_
std::vector< double > px_
Definition: AlphaT.h:18
AlphaT::value_
double value_(std::vector< bool > *jet_sign) const
Definition: AlphaT.cc:5
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
AlphaT::py_
std::vector< double > py_
Definition: AlphaT.h:19
AlphaT::setDHtZero_
bool setDHtZero_
Definition: AlphaT.h:27
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
AlphaT::et_
std::vector< double > et_
Definition: AlphaT.h:17
createfilelist.int
int
Definition: createfilelist.py:10
p4
double p4[4]
Definition: TauolaWrapper.h:92
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66