ATLAS Offline Software
Loading...
Searching...
No Matches
JetRecTool.h
Go to the documentation of this file.
1// JetRecTool.h. This file is -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5*/
6
7
8#ifndef JetRecTool_H
9#define JetRecTool_H
10
50
51#include "AsgTools/ToolHandle.h"
52#include "AsgTools/AsgTool.h"
64#if !defined(GENERATIONBASE) && !defined(XAOD_ANALYSIS)
66#endif
67
69: public asg::AsgTool,
70 virtual public IJetBuildTool,
71 virtual public IJetExecuteTool {
73
74public:
75
76 JetRecTool(const std::string& myname);
77
79 StatusCode initialize() override;
80
83 virtual const xAOD::JetContainer* build() const override;
84
86 int execute() const override;
87
89 void print() const override;
90
95 int inputContainerNames(std::vector<std::string>& connames) override;
96
101 int outputContainerNames(std::vector<std::string>& connames) override;
102
103
106
107private:
108
109 std::unique_ptr<xAOD::JetContainer> fillOutputContainer() const;
110 // Collect all input PseudoJetContainers into a single container
111 std::unique_ptr<PseudoJetContainer> collectPseudoJets() const;
112 const xAOD::JetContainer* getOldJets() const;
113 std::unique_ptr<xAOD::JetContainer> makeOutputContainer() const;
114
115 std::unique_ptr<xAOD::JetContainer> findJets() const;
116 std::unique_ptr<xAOD::JetContainer> groomJets() const;
117 std::unique_ptr<xAOD::JetContainer> copyJets() const;
118
119
120 // Properties.
123 // The template argument should become PseudoJetContainer
125
126 ToolHandle<IJetExecuteTool> m_intool;
127 ToolHandle<IJetPseudojetRetriever> m_hpjr;
128 ToolHandle<IJetFinder> m_finder;
129 ToolHandle<IJetGroomer> m_groomer;
130 ToolHandleArray<IJetModifier> m_modifiers {this, "JetModifiers", {}};
131 ToolHandleArray<IJetConsumer> m_consumers {this, "JetConsumers", {}};
132 bool m_trigger{};
133
134 // Cached state.
136 bool m_find{};
137 bool m_groom{};
138 bool m_copy{};
141 std::vector<std::string> m_incolls;
142 std::vector<std::string> m_outcolls;
144
145 // trigger hacks
146 const xAOD::JetContainer* m_trigInputJetsForGrooming{}; // used in trigger context only
147
148#if !defined (GENERATIONBASE) && !defined (XAOD_ANALYSIS)
149 ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"};
150#endif
151
152 // not used in AnalysisBase
153#ifdef __clang__
154 [[maybe_unused]]
155#endif
156 const double m_mevtogev = 0.001;
157
158};
159
160#endif
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Property holding a SG store/key/clid from which a WriteHandle is made.
IJetBuildTool is a dual-use tool interface for a tool that builds a jet collection.
IJetExecuteTool is a dual-use tool interface for generic tools, i.e. those that behave like algorithm...
std::vector< std::string > NameList
Type for ghost labels.
Definition IJetFinder.h:36
SG::WriteHandleKey< xAOD::JetContainer > m_outcoll
Definition JetRecTool.h:121
std::vector< std::string > m_incolls
Definition JetRecTool.h:141
std::unique_ptr< xAOD::JetContainer > findJets() const
ToolHandle< IJetFinder > m_finder
Definition JetRecTool.h:128
int execute() const override
Call build and put jets in event store.
xAOD::JetInput::Type m_inputtype
Definition JetRecTool.h:139
ToolHandleArray< IJetConsumer > m_consumers
Definition JetRecTool.h:131
std::vector< std::string > m_outcolls
Definition JetRecTool.h:142
SG::ReadHandleKeyArray< PseudoJetContainer > m_psjsin
Definition JetRecTool.h:124
ToolHandle< GenericMonitoringTool > m_monTool
Definition JetRecTool.h:149
std::unique_ptr< xAOD::JetContainer > makeOutputContainer() const
const double m_mevtogev
Definition JetRecTool.h:156
const xAOD::JetContainer * m_trigInputJetsForGrooming
Definition JetRecTool.h:146
std::unique_ptr< xAOD::JetContainer > fillOutputContainer() const
void print() const override
Display the configuration.
ToolHandle< IJetPseudojetRetriever > m_hpjr
Definition JetRecTool.h:127
ToolHandle< IJetExecuteTool > m_intool
Definition JetRecTool.h:126
int m_initCount
Definition JetRecTool.h:135
int outputContainerNames(std::vector< std::string > &connames) override
Method to return the list of output containers.
SG::ReadHandleKey< xAOD::JetContainer > m_incoll
Definition JetRecTool.h:122
virtual const xAOD::JetContainer * build() const override
Retrieve inputs with tools and construct new jet collection.
void setInputJetContainer(const xAOD::JetContainer *cont)
For trigger usage in grooming mode only : give the input ungroomed jet container.
std::unique_ptr< xAOD::JetContainer > copyJets() const
bool m_trigger
Definition JetRecTool.h:132
JetRecTool(const std::string &myname)
std::unique_ptr< PseudoJetContainer > collectPseudoJets() const
int inputContainerNames(std::vector< std::string > &connames) override
Method to return the list of input containers.
StatusCode initialize() override
Initialization. Check all tools here.
std::unique_ptr< xAOD::JetContainer > groomJets() const
const IJetPseudojetRetriever * m_ppjr
Definition JetRecTool.h:143
ToolHandle< IJetGroomer > m_groomer
Definition JetRecTool.h:129
IJetFinder::NameList m_ghostlabs
Definition JetRecTool.h:140
ToolHandleArray< IJetModifier > m_modifiers
Definition JetRecTool.h:130
const xAOD::JetContainer * getOldJets() const
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
JetContainer_v1 JetContainer
Definition of the current "jet container version".