DAS  3.0
Das Analysis System
common.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cmath>
4 #include <type_traits>
5 #include <vector>
6 
7 namespace DAS {
8 
9 static const std::vector<double> binsY = {0., 0.25, .5, 0.75, 1., 1.25, 1.5, 1.75, 2., 2.25, 2.5, 2.75, 3., 3.25, 3.5, 3.75, 4., 4.25, 4.5, 4.75, 5., 5.25, 5.5, 5.75, 6., 6.25, 6.5, 6.75, 7., 7.25, 7.5, 7.75, 8., 8.25, 8.5, 8.75, 9., 9.25, 9.5};
10 static const std::vector<double> binsPhi = {0.,.1*M_PI, .2*M_PI, .3*M_PI, .4*M_PI, .5*M_PI, .6*M_PI, .7*M_PI, .8*M_PI, .9*M_PI, M_PI};
11 
12 } // end of DAS namespace
13 
14 namespace DAS::TPS {
15 
19 template<typename T, typename = void>
20 struct has_p4 : std::false_type {};
21 template<typename T>
22 struct has_p4<T, std::void_t<decltype(std::declval<T>().p4.Eta())>> : std::true_type {};
23 template<class Jet>
24 std::vector<Jet> PhaseSpaceSelection(const std::vector<Jet>& jets, float minpt) {
25  std::vector<Jet> tempjets;
26  for (const auto& jet : jets) {
27  double eta;
28  if constexpr(has_p4<Jet>::value) {
29  eta = jet.p4.Eta();
30  } else {
31  eta = jet.eta();
32  }
33  if (jet.CorrPt() > minpt && eta < 5.0)
34  tempjets.push_back(jet);
35  }
36  return tempjets;
37 }
38 
39 } // end of DAS::TPS namespace
DAS
Definition: applyBTagSF.cc:31
DAS::TPS
Definition: applyEventMixing.cc:35
true_type
integral_type< bool, true > true_type
the bool 'true' value promoted to a type
Definition: fjcore.hh:211
DAS::MN::minpt
static const double minpt
Definition: getMNobservables.cc:39
Ntupliser_cfg.jets
string jets
Definition: Ntupliser_cfg.py:41
false_type
integral_type< bool, false > false_type
the bool 'false' value promoted to a type
Definition: fjcore.hh:212
DAS::TPS::has_p4
Definition: common.h:20
DAS::binsPhi
static const std::vector< double > binsPhi
Definition: common.h:10
DAS::TPS::PhaseSpaceSelection
std::vector< Jet > PhaseSpaceSelection(const std::vector< Jet > &jets, float minpt)
Definition: common.h:24
DAS::binsY
static const std::vector< double > binsY
Definition: common.h:9
jmarExample.eta
eta
DeepAK8/ParticleNet tagging.
Definition: jmarExample.py:19