ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::AugmentationToolLeadingJets Class Reference

#include <AugmentationToolLeadingJets.h>

Inheritance diagram for DerivationFramework::AugmentationToolLeadingJets:
Collaboration diagram for DerivationFramework::AugmentationToolLeadingJets:

Public Member Functions

virtual StatusCode initialize () override final
virtual StatusCode addBranches (const EventContext &ctx) const override final

Private Attributes

SG::ReadHandleKey< xAOD::JetContainerm_jetKey { this, "JetKey", "AntiKt4EMTopoJets", "" }
SG::WriteDecorHandleKey< xAOD::JetContainerm_decorationKey { this, "DecorationKey", m_jetKey, "DFDecoratorLeadingJets", "" }

Detailed Description

Definition at line 18 of file AugmentationToolLeadingJets.h.

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::AugmentationToolLeadingJets::addBranches ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 24 of file AugmentationToolLeadingJets.cxx.

25 {
26 // Set up the decorators
27 SG::WriteDecorHandle<xAOD::JetContainer, bool> decorator (m_decorationKey, ctx);
28
29 // CALCULATION OF THE NEW VARIABLE
30 // Get Primary vertex
31 SG::ReadHandle<xAOD::JetContainer> jets (m_jetKey, ctx);
32 int counter=0;
33 for ( unsigned int i =0 ; i < jets->size() ; i++){
34 auto jet = (*jets)[i] ;
35 if (fabs(jet->eta()) < 2.5){
36 decorator(*jet) = (counter <2); // pick the two leading jets only
37 counter+=1;
38 } else {
39 decorator(*jet) = 0; // pick the two leading jets only
40 }
41 }
42 return StatusCode::SUCCESS;
43 }
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decorationKey

◆ initialize()

StatusCode DerivationFramework::AugmentationToolLeadingJets::initialize ( )
finaloverridevirtual

Definition at line 16 of file AugmentationToolLeadingJets.cxx.

17 {
18 ATH_CHECK( AthAlgTool::initialize() );
19 ATH_CHECK( m_jetKey.initialize() );
20 ATH_CHECK( m_decorationKey.initialize() );
21 return StatusCode::SUCCESS;
22 }
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_decorationKey

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::AugmentationToolLeadingJets::m_decorationKey { this, "DecorationKey", m_jetKey, "DFDecoratorLeadingJets", "" }
private

Definition at line 29 of file AugmentationToolLeadingJets.h.

30{ this, "DecorationKey", m_jetKey, "DFDecoratorLeadingJets", "" };

◆ m_jetKey

SG::ReadHandleKey<xAOD::JetContainer> DerivationFramework::AugmentationToolLeadingJets::m_jetKey { this, "JetKey", "AntiKt4EMTopoJets", "" }
private

Definition at line 27 of file AugmentationToolLeadingJets.h.

28{ this, "JetKey", "AntiKt4EMTopoJets", "" };

The documentation for this class was generated from the following files: