ATLAS Offline Software
AugmentationToolLeadingJets.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // AugmentationToolLeadingJets.cxx, (c) ATLAS Detector software
8 // Author: Louie Corpe (lcorpe@cern.ch)
9 //
10 
12 #include "xAODJet/JetContainer.h"
13 #include <vector>
14 #include <string>
15 
16 namespace DerivationFramework {
17 
19  const std::string& n,
20  const IInterface* p) :
21  AthAlgTool(t,n,p)
22  {
23  declareInterface<DerivationFramework::IAugmentationTool>(this);
24  }
25 
27  {
28 
29  // Set up the decorators
30  SG::AuxElement::Decorator< bool > decorator("DFDecoratorLeadingJets");
31 
32  // CALCULATION OF THE NEW VARIABLE
33  // Get Primary vertex
34  const xAOD::JetContainer* jets = evtStore()->retrieve< const xAOD::JetContainer >("AntiKt4EMTopoJets");
35  int counter=0;
36  for ( unsigned int i =0 ; i < jets->size() ; i++){
37  auto jet = (*jets)[i] ;
38  if (fabs(jet->eta()) < 2.5){
39  decorator(*jet) = (counter <2); // pick the two leading jets only
40  counter+=1;
41  } else {
42  decorator(*jet) = 0; // pick the two leading jets only
43  }
44  }
45  return StatusCode::SUCCESS;
46  }
47 }
DerivationFramework::AugmentationToolLeadingJets::addBranches
virtual StatusCode addBranches() const
Pass the thinning service
Definition: AugmentationToolLeadingJets.cxx:26
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
DerivationFramework::AugmentationToolLeadingJets::AugmentationToolLeadingJets
AugmentationToolLeadingJets(const std::string &t, const std::string &n, const IInterface *p)
Definition: AugmentationToolLeadingJets.cxx:18
JetContainer.h
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
AthAlgTool
Definition: AthAlgTool.h:26
test_pyathena.counter
counter
Definition: test_pyathena.py:15
AugmentationToolLeadingJets.h