ATLAS Offline Software
Loading...
Searching...
No Matches
AugmentationToolLeadingJets.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Author: Louie Corpe (lcorpe@cern.ch)
6
11#include <vector>
12#include <string>
13
14namespace DerivationFramework {
15
17 {
18 ATH_CHECK( AthAlgTool::initialize() );
19 ATH_CHECK( m_jetKey.initialize() );
20 ATH_CHECK( m_decorationKey.initialize() );
21 return StatusCode::SUCCESS;
22 }
23
24 StatusCode AugmentationToolLeadingJets::addBranches(const EventContext& ctx) const
25 {
26 // Set up the decorators
28
29 // CALCULATION OF THE NEW VARIABLE
30 // Get Primary vertex
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 }
44}
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decorationKey
virtual StatusCode addBranches(const EventContext &ctx) const override final
Handle class for adding a decoration to an object.
THE reconstruction tool.