CMS 3D CMS Logo

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

#include <alpha_T.h>

Public Member Functions

template<class LVs >
double operator() (const LVs &p4s) const
 

Static Public Member Functions

static double minimum_deltaSumPT (const std::vector< double > &pTs)
 

Detailed Description

Definition at line 10 of file alpha_T.h.

Member Function Documentation

static double alpha_T::minimum_deltaSumPT ( const std::vector< double > &  pTs)
inlinestatic

Definition at line 27 of file alpha_T.h.

References change_name::diff, mps_fire::i, dqmiolumiharvest::j, x, and y.

Referenced by operator()().

27  {
28  std::vector<double> diff(1 << (pTs.size() - 1), 0.);
29  for (unsigned i = 0; i < diff.size(); i++)
30  for (unsigned j = 0; j < pTs.size(); j++)
31  diff[i] += pTs[j] * (1 - 2 * (int(i >> j) & 1));
32 
33  return fabs(*min_element(diff.begin(), diff.end(), [](auto x, auto y) { return fabs(x) < fabs(y); }));
34  }
template<class LVs >
double alpha_T::operator() ( const LVs &  p4s) const
inline

Definition at line 12 of file alpha_T.h.

References minimum_deltaSumPT(), mathSSE::sqrt(), and HcalDetIdTransform::transform().

12  {
13  typedef typename LVs::value_type LorentzV;
14  if (p4s.size() < 2)
15  return 0;
16 
17  std::vector<double> pTs;
18  transform(p4s.begin(), p4s.end(), back_inserter(pTs), std::mem_fn(&LorentzV::Pt));
19 
20  const double DsumPT = minimum_deltaSumPT(pTs);
21  const double sumPT = accumulate(pTs.begin(), pTs.end(), double(0));
22  const LorentzV sumP4 = accumulate(p4s.begin(), p4s.end(), LorentzV());
23 
24  return 0.5 * (sumPT - DsumPT) / sqrt(sumPT * sumPT - sumP4.Perp2());
25  }
static double minimum_deltaSumPT(const std::vector< double > &pTs)
Definition: alpha_T.h:27
T sqrt(T t)
Definition: SSEVec.h:19
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > LorentzV
unsigned transform(const HcalDetId &id, unsigned transformCode)