ATLAS Offline Software
GenFilterTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*
6  * @file GenFilterTool.h
7  * @author TJ Khoo
8  * @date July 2015
9  * @brief tool to decorate EventInfo with quantities needed to disentangle generator filtered samples
10 */
11 
12 #ifndef DerivationFrameworkMCTruth_GenFilterTool_H
13 #define DerivationFrameworkMCTruth_GenFilterTool_H
14 
15 // Base classes
18 #include "GaudiKernel/SystemOfUnits.h"
19 
20 // EDM include -- typedef, so has to be included
23 #include "xAODJet/JetContainer.h"
27 // Defs for the particle origin
29 
30 class IMCTruthClassifier;
31 
32 namespace DerivationFramework {
33 
34  class GenFilterTool : public AthAlgTool, public IAugmentationTool {
35 
36  public:
37  GenFilterTool(const std::string& t, const std::string& n, const IInterface* p);
39  virtual StatusCode addBranches() const override final;
40  virtual StatusCode initialize() override final;
41 
42  private:
43  StatusCode getGenFiltVars(const EventContext& ctx, float& genFiltHT, float& genFiltHTinclNu, float& genFiltMET, float& genFiltPTZ, float& genFiltFatJ) const;
44 
46 
47 
48  SG::ReadHandleKey<xAOD::EventInfo>m_eventInfoKey{this,"EventInfoName" , "EventInfo"};
49  SG::ReadHandleKey<xAOD::TruthParticleContainer>m_mcKey{this, "MCCollectionName", "TruthParticles"};
50  SG::ReadHandleKey<xAOD::JetContainer>m_truthJetsKey{this, "TruthJetCollectionName", "AntiKt4TruthWZJets"};
51  SG::ReadHandleKey<xAOD::JetContainer>m_truthFatJetsKey{this, "TruthFatJetCollectionName", "AntiKt10TruthJets"};
52 
54 
55 
56  SG::WriteDecorHandleKeyArray<xAOD::EventInfo> m_decorKeys{this, "DecorationKeys", {} , "Decorations added to the eventinfo"};
57  Gaudi::Property<float> m_MinJetPt{this, "MinJetPt", 35.* Gaudi::Units::GeV};
58  Gaudi::Property<float> m_MaxJetEta{this, "MaxJetEta", 2.5};
59  Gaudi::Property<float> m_MinLepPt{this,"MinLeptonPt", 25.*Gaudi::Units::GeV};
60  Gaudi::Property<float> m_MaxLepEta{this, "MaxLeptonEta", 2.5};
61 
62  PublicToolHandle<IMCTruthClassifier> m_classif{this, "TruthClassifier", "MCTruthClassifier/DFCommonTruthClassifier"};
63  };
64 
65 }
66 
67 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
DerivationFramework::GenFilterTool::GenFilterTool
GenFilterTool(const std::string &t, const std::string &n, const IInterface *p)
Definition: GenFilterTool.cxx:41
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
IAugmentationTool.h
TruthParticleContainer.h
TruthParticle
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticle.h:58
ParticleTest.tp
tp
Definition: ParticleTest.py:25
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
DerivationFramework::GenFilterTool::m_truthFatJetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_truthFatJetsKey
Definition: GenFilterTool.h:51
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
SG::ReadHandleKey< xAOD::TruthParticleContainer >
DerivationFramework::GenFilterTool::m_mcReadDecor
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_mcReadDecor
Definition: GenFilterTool.h:53
DerivationFramework::GenFilterTool::m_MaxJetEta
Gaudi::Property< float > m_MaxJetEta
Max eta for the truth jets.
Definition: GenFilterTool.h:58
DerivationFramework::IAugmentationTool
Definition: IAugmentationTool.h:24
DerivationFramework::GenFilterTool::m_MinJetPt
Gaudi::Property< float > m_MinJetPt
Min pT for the truth jets.
Definition: GenFilterTool.h:57
DerivationFramework::GenFilterTool::m_decorKeys
SG::WriteDecorHandleKeyArray< xAOD::EventInfo > m_decorKeys
Definition: GenFilterTool.h:56
DerivationFramework::GenFilterTool::m_classif
PublicToolHandle< IMCTruthClassifier > m_classif
Definition: GenFilterTool.h:62
MCTruthClassifierDefs.h
DerivationFramework::GenFilterTool::~GenFilterTool
~GenFilterTool()
DerivationFramework::GenFilterTool::getGenFiltVars
StatusCode getGenFiltVars(const EventContext &ctx, float &genFiltHT, float &genFiltHTinclNu, float &genFiltMET, float &genFiltPTZ, float &genFiltFatJ) const
Definition: GenFilterTool.cxx:120
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
DerivationFramework::GenFilterTool::m_MaxLepEta
Gaudi::Property< float > m_MaxLepEta
Max eta for the truth leptons.
Definition: GenFilterTool.h:60
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::GenFilterTool::m_truthJetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_truthJetsKey
Definition: GenFilterTool.h:50
DerivationFramework::GenFilterTool::isPrompt
bool isPrompt(const xAOD::TruthParticle *tp) const
Definition: GenFilterTool.cxx:51
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:42
IMCTruthClassifier
Definition: IMCTruthClassifier.h:103
EventInfo.h
DerivationFramework::GenFilterTool::m_mcKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_mcKey
Definition: GenFilterTool.h:49
DerivationFramework::GenFilterTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: GenFilterTool.h:48
JetContainer.h
DerivationFramework::GenFilterTool
Definition: GenFilterTool.h:34
WriteDecorHandleKeyArray.h
DerivationFramework::GenFilterTool::m_MinLepPt
Gaudi::Property< float > m_MinLepPt
Min pT for the truth leptons.
Definition: GenFilterTool.h:59
DerivationFramework::GenFilterTool::addBranches
virtual StatusCode addBranches() const override final
Pass the thinning service
Definition: GenFilterTool.cxx:96
AthAlgTool
Definition: AthAlgTool.h:26
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer >
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
DerivationFramework::GenFilterTool::initialize
virtual StatusCode initialize() override final
Definition: GenFilterTool.cxx:81