ATLAS Offline Software
Loading...
Searching...
No Matches
JetCleaningTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef JETSELECTORTOOLS_JETCLEANINGTOOL_H
6#define JETSELECTORTOOLS_JETCLEANINGTOOL_H
7
15
16// Stdlib includes
17#include <string>
18#include <vector>
19#include <unordered_map>
20
21// Base classes
22#include "AsgTools/AsgTool.h"
28
29
30// The xAOD jet type
31#include "xAODJet/Jet.h"
32
33// Return object
34#include "PATCore/AcceptInfo.h"
35#include "PATCore/AcceptData.h"
36
37namespace JCT { class HotCell; }
38
39class JetCleaningTool : public asg::AsgTool, virtual public IJetDecorator, virtual public IJetSelector
40{
41
43
44public:
56
58 JetCleaningTool(const std::string &name = "JetCleaningTool");
59
61 JetCleaningTool(const CleaningLevel alevel, const bool doUgly = false);
62
64 JetCleaningTool(const std::string &name, const CleaningLevel alevel, const bool doUgly = false);
65
68
70 virtual StatusCode initialize() override;
71
73 {
74 return m_accept;
75 }
76
78 asg::AcceptData accept( const int isJetClean, const int fmaxIndex ) const;
79
81 asg::AcceptData accept( const int isJetClean,
82 const double sumpttrk, //in MeV, same as sumpttrk
83 const double fmax,
84 const double eta,
85 const double pt,
86 const int fmaxIndex ) const;
87
89 asg::AcceptData accept( const double emf,
90 const double hecf,
91 const double larq,
92 const double hecq,
93 const double sumpttrk, //in MeV, same as sumpttrk
94 const double eta, //emscale Eta
95 const double pt, //in MeV, same as sumpttrk
96 const double fmax,
97 const double negE , //in MeV
98 const double AverageLArQF,
99 const int fMaxIndex ) const;
100
102 asg::AcceptData accept( const xAOD::Jet& jet) const;
103
104 int keep(const xAOD::Jet& jet) const final
105 { return static_cast<bool>(accept(jet)); }
106
107 virtual StatusCode decorate(const xAOD::JetContainer &jets) const override;
108
110 bool containsHotCells( const xAOD::Jet& jet, const unsigned int runNumber) const;
111
113 CleaningLevel getCutLevel( const std::string& ) const;
114 std::string getCutName( const CleaningLevel ) const;
115
116 private:
117
119 Gaudi::Property<std::string> m_cutName{this, "CutLevel", "" };
121 Gaudi::Property<bool> m_doUgly{this, "DoUgly", false};
122 Gaudi::Property<bool> m_useDecorations{this, "UseDecorations", true};
123 Gaudi::Property<bool> m_useLooseDecorForTightCut{this, "UseLooseDecorForTightCut", false};
124 SG::ConstAccessor<char> m_acc_jetClean{"DFCommonJets_jetClean_LooseBad"};
125
126 //
127 Gaudi::Property<std::string> m_jetContainerName{this, "JetContainer", "", "SG key for input jet container"};
128 SG::WriteDecorHandleKey<xAOD::JetContainer> m_jetCleanKey{this, "JetCleaningName", "isClean", "SG key for output jet cleaning decoration"};
130
132 Gaudi::Property<std::string> m_hotCellsFile{this, "HotCellsFile", ""};
133 std::unordered_map<unsigned int, std::vector<std::unique_ptr<JCT::HotCell>>> m_hotCellsMap;
134 StatusCode readHotCells();
135
136 void missingVariable(const std::string& varName) const;
137
138}; // End: class definition
139
140
141
142#endif
Scalar eta() const
pseudorapidity method
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Interface for adding a decoration to a jet container.
IJetSelector is a dual-use tool interface for a tool that selects a jet.
const asg::AcceptInfo & getAcceptInfo() const
asg::AcceptInfo m_accept
asg::AcceptData accept(const int isJetClean, const int fmaxIndex) const
The DFCommonJets decoration accept method.
JetCleaningTool(const std::string &name="JetCleaningTool")
Standard constructor.
Gaudi::Property< std::string > m_jetContainerName
SG::ConstAccessor< char > m_acc_jetClean
void missingVariable(const std::string &varName) const
CleaningLevel getCutLevel(const std::string &) const
Helpers for cut names.
Gaudi::Property< std::string > m_cutName
Name of the cut.
std::string getCutName(const CleaningLevel) const
Gaudi::Property< bool > m_useDecorations
std::unordered_map< unsigned int, std::vector< std::unique_ptr< JCT::HotCell > > > m_hotCellsMap
bool containsHotCells(const xAOD::Jet &jet, const unsigned int runNumber) const
Hot cell checks.
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
int keep(const xAOD::Jet &jet) const final
Method to select.
Gaudi::Property< std::string > m_hotCellsFile
Hot cells caching.
CleaningLevel m_cutLevel
CleaningLevel
Levels of cut.
Gaudi::Property< bool > m_doUgly
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jetCleanKey
Gaudi::Property< bool > m_useLooseDecorForTightCut
virtual ~JetCleaningTool()
Standard destructor.
StatusCode readHotCells()
Hot cells reading helper.
virtual StatusCode initialize() override
Initialize method.
Helper class to provide constant type-safe access to aux data.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".