24 class SumPt2 :
public Sum {
26 virtual float add(
const float a,
const float b,
const float,
const float)
const override final {
30 class SumPt :
public Sum {
32 virtual float add(
const float a,
const float b,
const float,
const float )
const override final {
36 class SumPtw :
public Sum {
38 virtual float add(
const float a,
const float b,
const float jet_pt,
const float mindR )
const override final {
39 return a + (
b *
b * jet_pt *jet_pt )/(mindR+0.0001);
67 ATH_MSG_ERROR(
"RedoHardScatter and ReturnDeco cannot both be set to true.");
68 return StatusCode::FAILURE;
78 m_sum = std::make_unique<::SumPt2>();
82 m_sum = std::make_unique<::SumPt>();
86 m_sum = std::make_unique<::SumPtw>();
94 return StatusCode::FAILURE;
119 return StatusCode::SUCCESS;
130 return StatusCode::SUCCESS;
135 ATH_MSG_DEBUG(
"In getHardScatter(...) for " << name() <<
"...");
137 const EventContext& ctx = Gaudi::Hive::currentContext();
143 ATH_MSG_ERROR(
"Could not open event info, returning nullptr!");
149 ATH_MSG_ERROR(
"Hardscatter vertex link is not valid, returning nullptr!");
160 ATH_MSG_ERROR (
"HardScatterSelectionTool configured to use jet collection "<<
m_jetContKey.key()<<
", but collection is not found!");
162 jetCont = jetContHandle.
cptr();
165 float maxsum = -999.0;
166 float max_gnn_score = -999.0;
168 for (
const auto *
const vtx : *vtxCont) {
173 for (
const auto& trkLink : vtx->trackParticleLinks()) {
174 if (!trkLink.isValid())
continue;
189 sum =
m_sum->add(sum, (*trkLink)->pt(),jetPt,minDr );
199 float gnn_score = acc_gnn(*vtx);
200 if (gnn_score > max_gnn_score) {
201 max_gnn_score = gnn_score;
207 for (
const auto& trkLink : vtx->trackParticleLinks()) {
208 if (trkLink.isValid()) {
210 sum =
m_sum->add(sum, (*trkLink)->pt(),0.,0.);
233 const EventContext& ctx = Gaudi::Hive::currentContext();
236 ATH_MSG_ERROR(
"Could not open primary vertex container, returning nullptr!");
244 ATH_MSG_DEBUG(
"In getHardScatterLink(...) for " << name() <<
"...");
246 const EventContext& ctx = Gaudi::Hive::currentContext();
257 return hardscatterLink;
262 const EventContext& ctx = Gaudi::Hive::currentContext();
265 ATH_MSG_ERROR(
"Could not open primary vertex container, returning empty ElementLink!");
#define ATH_CHECK
Evaluate an expression and check for errors.
ElementLink implementation for ROOT usage.
bool isValid() const
Test to see if the link can be dereferenced.
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
Handle class for reading a decoration on an object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
bool add(const std::string &hname, TKey *tobj)
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Jet_v1 Jet
Definition of the current "jet version".
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
JetContainer_v1 JetContainer
Definition of the current "jet container version".