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"
17
18// JetConstituentModifierBase provides default execute () behaviour
19// to all JetConstituentModifier tools. Can be used in Rootcore, without
20// the need for a sequence.
21
24public:
25 JetConstituentModifierBase(const std::string & name);
26
27 // Implement the IJetConstituentModifier interface
28 // Do some type-checking on the input container
29 StatusCode process(xAOD::IParticleContainer* cont) const override final;
30 // Concrete implementation method to be overridden by child tools
31 // We pass a pointer here, because some of the type-specific tools
32 // will want to cast to the right container type
33 virtual StatusCode process_impl(xAOD::IParticleContainer* /*cont*/) const
34 {
35 ATH_MSG_ERROR("This is the JetConstituentModifierBase class, no corrections implemented!");
36 return StatusCode::FAILURE;
37 }
38
39protected:
40 // Define four-momentum setters that will handle type-specific operations
41 // Multiple versions are needed that only correct particular four-vector
42 // components, to avoid producing unnecessary shallow copy branches
43
44 // Setter for eta/phi
45 StatusCode setEtaPhi(xAOD::IParticle* obj, float eta, float phi) const;
46 // Setter for e/pt, and optionally a weight
47 // We pass the weight accessor so that the child can determine the name.
48 StatusCode setEnergyPt(xAOD::IParticle* obj, float e, float pt,
49 const SG::AuxElement::Accessor<float>* weightAcc=nullptr) const;
50 // Setter for full four-vector, and optionally a weight
51 // We pass the weight accessor so that the child can determine the name.
52 StatusCode setP4(xAOD::IParticle* obj, const xAOD::JetFourMom_t& p4,
53 const SG::AuxElement::Accessor<float>* weightAcc=nullptr) const;
54
55 // We need to know the output type so that we can set the p4 appropriately,
56 // because IParticle does not specify the p4 encoding.
57 // The user must explicitly set what sort of object they modify
58 // Define as a basic integer type because Gaudi
59 // doesn't support arbitrary property types
61
64};
65
66#endif
67
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
#define ATH_MSG_ERROR(x)
JetConstituentModifierBase(const std::string &name)
StatusCode setEtaPhi(xAOD::IParticle *obj, float eta, float phi) const
StatusCode setP4(xAOD::IParticle *obj, const xAOD::JetFourMom_t &p4, const SG::AuxElement::Accessor< float > *weightAcc=nullptr) const
StatusCode setEnergyPt(xAOD::IParticle *obj, float e, float pt, const SG::AuxElement::Accessor< float > *weightAcc=nullptr) const
virtual StatusCode process_impl(xAOD::IParticleContainer *) const
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
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