ATLAS Offline Software
Loading...
Searching...
No Matches
JetConstituentModifierBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5//JetConstituentModifierBase.h
6
7#ifndef JETRECTOOLS_JETCONSTITUENTMODIFIERBASE_H
8#define JETRECTOOLS_JETCONSTITUENTMODIFIERBASE_H
9
12
13#include "AsgTools/AsgTool.h"
16#include "xAODJet/Jet.h"
18
19
20// JetConstituentModifierBase provides default execute () behaviour
21// to all JetConstituentModifier tools. Can be used in Rootcore, without
22// the need for a sequence.
23
26public:
27 JetConstituentModifierBase(const std::string & name);
28
29 // Implement the IJetConstituentModifier interface
30 // Do some type-checking on the input container
31 StatusCode process(xAOD::IParticleContainer* cont, const EventContext& ctx) const override final;
32 // Concrete implementation method to be overridden by child tools
33 // We pass a pointer here, because some of the type-specific tools
34 // will want to cast to the right container type
35 virtual StatusCode process_impl(xAOD::IParticleContainer* /*cont*/, const EventContext& /*ctx*/) const
36 {
37 ATH_MSG_ERROR("This is the JetConstituentModifierBase class, no corrections implemented!");
38 return StatusCode::FAILURE;
39 }
40
41 virtual StatusCode configure_decor_handle_keys() {
42 return StatusCode::SUCCESS;
43 }
44
45 void setInputContainer(const std::string& cont) {m_inputContainer = cont;}
46 void setOutputContainer(const std::string& cont) {m_outputContainer = cont;}
47 void setInputChargedContainer(const std::string& cont) {m_inputChargedContainer = cont;}
48 void setOutputChargedContainer(const std::string& cont) {m_outputChargedContainer = cont;}
49 void setInputNeutralContainer(const std::string& cont) {m_inputNeutralContainer = cont;}
50 void setOutputNeutralContainer(const std::string& cont) {m_outputNeutralContainer = cont;}
51
52
53
54protected:
55 // Define four-momentum setters that will handle type-specific operations
56 // Multiple versions are needed that only correct particular four-vector
57 // components, to avoid producing unnecessary shallow copy branches
58
59 // Setter for eta/phi
60 StatusCode setEtaPhi(xAOD::IParticle* obj, float eta, float phi) const;
61 // Setter for e/pt
62 StatusCode setEnergyPt(xAOD::IParticle* obj, float e, float pt) const;
63 // Setter for full four-vector
64 StatusCode setP4(xAOD::IParticle* obj, const xAOD::JetFourMom_t& p4) const;
65 // Get the correction factor for a given object, based on the corrected energy and pt, or the corrected four-vector
66 float getCorrectionFactor(xAOD::IParticle* obj, const float& corrected_energy, const float& corrected_pt) const;
67 float getCorrectionFactor(xAOD::IParticle* obj, const xAOD::JetFourMom_t& corrected_p4) const;
68
69 // We need to know the output type so that we can set the p4 appropriately,
70 // because IParticle does not specify the p4 encoding.
71 // The user must explicitly set what sort of object they modify
72 // Define as a basic integer type because Gaudi
73 // doesn't support arbitrary property types
75
76 std::string m_inputContainer;
77 std::string m_outputContainer;
82
83
86};
87
88#endif
89
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
#define ATH_MSG_ERROR(x,...)
float getCorrectionFactor(xAOD::IParticle *obj, const float &corrected_energy, const float &corrected_pt) const
StatusCode setEnergyPt(xAOD::IParticle *obj, float e, float pt) const
void setInputNeutralContainer(const std::string &cont)
JetConstituentModifierBase(const std::string &name)
StatusCode setEtaPhi(xAOD::IParticle *obj, float eta, float phi) const
void setOutputNeutralContainer(const std::string &cont)
virtual StatusCode process_impl(xAOD::IParticleContainer *, const EventContext &) const
void setOutputChargedContainer(const std::string &cont)
StatusCode setP4(xAOD::IParticle *obj, const xAOD::JetFourMom_t &p4) const
void setInputContainer(const std::string &cont)
void setOutputContainer(const std::string &cont)
virtual StatusCode configure_decor_handle_keys()
void setInputChargedContainer(const std::string &cont)
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Class providing the definition of the 4-vector interface.
const std::string process
@ Other
An object not falling into any of the other categories.
Definition ObjectType.h:34
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition JetTypes.h:17