ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
DerivationFramework::TruthD2Decorator Class Reference

#include <TruthD2Decorator.h>

Inheritance diagram for DerivationFramework::TruthD2Decorator:
Collaboration diagram for DerivationFramework::TruthD2Decorator:

Public Member Functions

 TruthD2Decorator (const std::string &t, const std::string &n, const IInterface *p)
 
StatusCode initialize ()
 
virtual StatusCode addBranches () const
 

Private Attributes

SG::ReadHandleKey< xAOD::JetContainerm_jetContainerKey {this, "JetContainerKey", "AntiKt10TruthTrimmedPtFrac5SmallR20Jets", "Name of jet container key for input"}
 
SG::WriteDecorHandleKey< xAOD::JetContainerm_decorationName {this, "DecorationName", "AntiKt10TruthTrimmedPtFrac5SmallR20Jets.D2", "Decoration Name"}
 

Detailed Description

Definition at line 22 of file TruthD2Decorator.h.

Constructor & Destructor Documentation

◆ TruthD2Decorator()

DerivationFramework::TruthD2Decorator::TruthD2Decorator ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 18 of file TruthD2Decorator.cxx.

20  :
21  base_class(t,n,p)
22  {
23 
24  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::TruthD2Decorator::addBranches ( ) const
virtual

Definition at line 38 of file TruthD2Decorator.cxx.

39  {
40 
41  // Event context
42  const EventContext& ctx = Gaudi::Hive::currentContext();
43 
44  // Set up the decorators
46 
47  // Get the Large-R jet Container
49 
50  if(!largeRjets.isValid()) {
51  ATH_MSG_ERROR ("Couldn't retrieve JetContainer with key " << m_jetContainerKey.key());
52  return StatusCode::FAILURE;
53  }
54 
55  // loop over jet collection
56  for( const auto *jet: *largeRjets){
57  //get ECF
58  float ecf1 = jet->getAttribute<float>("ECF1");
59  float ecf2 = jet->getAttribute<float>("ECF2");
60  float ecf3 = jet->getAttribute<float>("ECF3");
61 
62  //calculate D2 and decorate
63  float D2=-999;
64  if(fabs(ecf2)>1e-8)
65  D2=ecf3 * pow(ecf1, 3.0) / pow(ecf2, 3.0);
66  decoratorD2(*jet) = D2;
67  }
68 
69  return StatusCode::SUCCESS;
70  }

◆ initialize()

StatusCode DerivationFramework::TruthD2Decorator::initialize ( )

Definition at line 26 of file TruthD2Decorator.cxx.

27  {
28 
32 
33  return StatusCode::SUCCESS;
34 
35  }

Member Data Documentation

◆ m_decorationName

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::TruthD2Decorator::m_decorationName {this, "DecorationName", "AntiKt10TruthTrimmedPtFrac5SmallR20Jets.D2", "Decoration Name"}
private

Definition at line 31 of file TruthD2Decorator.h.

◆ m_jetContainerKey

SG::ReadHandleKey<xAOD::JetContainer> DerivationFramework::TruthD2Decorator::m_jetContainerKey {this, "JetContainerKey", "AntiKt10TruthTrimmedPtFrac5SmallR20Jets", "Name of jet container key for input"}
private

Definition at line 29 of file TruthD2Decorator.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
DerivationFramework::TruthD2Decorator::m_jetContainerKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerKey
Definition: TruthD2Decorator.h:30
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
DerivationFramework::TruthD2Decorator::m_decorationName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decorationName
Definition: TruthD2Decorator.h:32
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15