13#include <TLorentzVector.h>
17 const std::string &decName_pb,
18 const std::string &decName_pc,
19 const std::string &decName_pu,
20 const std::string &decName_isValid) :
32 const std::unique_ptr<ITrigJetHypoInfoCollector> &collector,
33 const std::string &decName)
const
36 float momentValue = -1;
37 if (!(ip->getAttribute(decName, momentValue)))
41 auto j_addr =
static_cast<const void *
>(ip.get());
43 std::stringstream ss0;
44 ss0 <<
"DipsCondition: "
45 <<
" unable to retrieve " << decName <<
'\n';
46 std::stringstream ss1;
47 ss1 <<
" jet : (" << j_addr <<
")";
48 collector->collect(ss0.str(), ss1.str());
51 throw std::runtime_error(
"Impossible to retrieve decorator \'" + decName +
"\' for jet hypo");
59 const float &dips_pu)
const {
64 const std::unique_ptr<ITrigJetHypoInfoCollector> &collector)
const
72 if (!
jet)
throw std::runtime_error(
"Fast dips has to run on xAOD::Jet");
74 if (valid == 0)
return false;
81 float dips_output =
evaluateDips(dips_pb, dips_pc, dips_pu);
87 const void *address =
static_cast<const void *
>(
this);
89 std::stringstream ss0;
90 ss0 <<
"DipsCondition: (" << address
92 <<
" pass: " << std::boolalpha << pass <<
'\n';
94 auto j_addr =
static_cast<const void *
>(ip.get());
95 std::stringstream ss1;
96 ss1 <<
" jet : (" << j_addr <<
") "
100 collector->collect(ss0.str(), ss1.str());
108 const std::unique_ptr<ITrigJetHypoInfoCollector>& c)
const {
115 std::stringstream
ss;
116 ss <<
"DipsCondition (" <<
this <<
") "
117 <<
" Cleaning decs: "
std::vector< pHypoJet > HypoJetVector
std::shared_ptr< const HypoJet::IJet > pHypoJet
float evaluateDips(const float &dips_pb, const float &dips_pc, const float &dips_pu) const
std::string m_decName_isValid
DipsCondition(double workingPoint, const float &cfrac, const std::string &decName_pb, const std::string &decName_pc, const std::string &decName_pu, const std::string &decName_isValid="")
std::string toString() const override
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
float getDipsDecValue(const pHypoJet &ip, const std::unique_ptr< ITrigJetHypoInfoCollector > &collector, const std::string &decName) const
float safeLogRatio(float num, float denom)