17 std::vector<double> pTs;
18 transform(p4s.begin(), p4s.end(), back_inserter(pTs), std::mem_fn(&LorentzV::Pt));
21 const double sumPT = accumulate(pTs.begin(), pTs.end(), double(0));
24 return 0.5 * (sumPT - DsumPT) /
sqrt(sumPT * sumPT - sumP4.Perp2());
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));
33 return fabs(*min_element(
diff.begin(),
diff.end(), [](
auto x,
auto y) {
return fabs(
x) < fabs(
y); }));
static double minimum_deltaSumPT(const std::vector< double > &pTs)
Container::value_type value_type
double operator()(const LVs &p4s) const
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > LorentzV