ATLAS Offline Software
TopHeavyFlavorFilterAugmentation.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
9 
10 namespace DerivationFramework {
11 
12 
13 TopHeavyFlavorFilterAugmentation::TopHeavyFlavorFilterAugmentation(const std::string& t, const std::string& n, const IInterface* p):
14  AthAlgTool(t,n,p),
15  m_filterTool("")
16 {
17 
18  declareInterface<DerivationFramework::IAugmentationTool>(this);
19 
20  declareProperty("EventInfoName",m_eventInfoName="EventInfo");
21  declareProperty("FilterTool",m_filterTool);
22 
23 
24 }
25 
26 
27 
29 
30 
31 
33 
34  ATH_MSG_INFO("Initialize " );
35 
36 
37  if(m_filterTool.retrieve().isFailure()){
38  ATH_MSG_ERROR("unable to retrieve filter tool " <<m_filterTool);
39  return StatusCode::FAILURE;
40  }
41 
42  return StatusCode::SUCCESS;
43 
44 }
45 
46 
47 
49 
50  return StatusCode::SUCCESS;
51 
52 }
53 
54 
55 
57 
58  const xAOD::EventInfo* eventInfo;
59 
60  if (evtStore()->retrieve(eventInfo,m_eventInfoName).isFailure()) {
61  ATH_MSG_ERROR("could not retrieve event info " <<m_eventInfoName);
62  return StatusCode::FAILURE;
63  }
64 
65  int flavortype=m_filterTool->filterFlag();
66 
67 
68  static const SG::AuxElement::Decorator<int> decoration("TopHeavyFlavorFilterFlag");
69 
70  decoration(*eventInfo) = flavortype;
71 
72  return StatusCode::SUCCESS;
73 
74 }
75 
76 
77 
78 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
DerivationFramework::TopHeavyFlavorFilterAugmentation::~TopHeavyFlavorFilterAugmentation
~TopHeavyFlavorFilterAugmentation()
Definition: TopHeavyFlavorFilterAugmentation.cxx:28
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
DerivationFramework::TopHeavyFlavorFilterAugmentation::m_filterTool
ToolHandle< DerivationFramework::TTbarPlusHeavyFlavorFilterTool > m_filterTool
Definition: TopHeavyFlavorFilterAugmentation.h:41
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::TopHeavyFlavorFilterAugmentation::finalize
StatusCode finalize()
Definition: TopHeavyFlavorFilterAugmentation.cxx:48
DerivationFramework::TopHeavyFlavorFilterAugmentation::addBranches
virtual StatusCode addBranches() const
Pass the thinning service
Definition: TopHeavyFlavorFilterAugmentation.cxx:56
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TTbarPlusHeavyFlavorFilterTool.h
tool to compute filter flag for ttbar+HF
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:58
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TopHeavyFlavorFilterAugmentation.h
tool to add a variable to the EventInfo corresponding to the ttbar+HF filter flag
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::TopHeavyFlavorFilterAugmentation::m_eventInfoName
std::string m_eventInfoName
Definition: TopHeavyFlavorFilterAugmentation.h:40
DerivationFramework::TopHeavyFlavorFilterAugmentation::TopHeavyFlavorFilterAugmentation
TopHeavyFlavorFilterAugmentation(const std::string &t, const std::string &n, const IInterface *p)
Definition: TopHeavyFlavorFilterAugmentation.cxx:13
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
DerivationFramework::TopHeavyFlavorFilterAugmentation::initialize
StatusCode initialize()
Definition: TopHeavyFlavorFilterAugmentation.cxx:32
AthAlgTool
Definition: AthAlgTool.h:26