ATLAS Offline Software
MergeTruthJetsTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MCTRUTHSIMALGS_MERGETRUTHJETSTOOL_H
6 #define MCTRUTHSIMALGS_MERGETRUTHJETSTOOL_H
7 
9 
10 #include "xAODJet/JetContainer.h"
12 
13 #include "Gaudi/Property.h"
14 #include "GaudiKernel/ServiceHandle.h"
15 #include "GaudiKernel/ToolHandle.h"
17 #include "GaudiKernel/SystemOfUnits.h"
18 
19 #include <string>
20 
25 public:
26  MergeTruthJetsTool(const std::string& type,
27  const std::string& name,
28  const IInterface* parent);
30  StatusCode initialize() override final;
33  virtual StatusCode prepareEvent(const EventContext& ctx, unsigned int nInputEvents) override final;
36  virtual StatusCode mergeEvent(const EventContext& ctx) override final;
39  virtual StatusCode processBunchXing(int bunchXing,
40  SubEventIterator bSubEvents,
41  SubEventIterator eSubEvents) override final;
43  virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
44 
45  // ///implementation of passing filter
46  // virtual bool filterPassed() const override final { return (!m_vetoOnInTime || m_filterPassed); }
47 
49  virtual void resetFilter() override final { m_first_event=true; m_signal_max_pT=-1.; m_pileup_max_pT=-1.; m_filterPassed=true; }
50 
51 private:
53  virtual double processJetContainer(const xAOD::JetContainer* inputJetContainer, xAOD::JetContainer *outputJetContainer, const double& ptCut, const float& timeOfBCID, int eventNumber);
54  ServiceHandle<PileUpMergeSvc> m_pMergeSvc{this, "PileUpMergeSvc", "PileUpMergeSvc", ""};
55  Gaudi::Property<std::string> m_inputJetCollKey{this, "InputTruthJetCollKey", "AntiKt4TruthJets", ""};
56  Gaudi::Property<std::string> m_inTimeOutputJetCollKey{this, "InTimeOutputTruthJetCollKey", "InTimeAntiKt4TruthJets", ""};
57  Gaudi::Property<std::string> m_outOfTimeOutputJetCollKey{this, "OutOfTimeTruthJetCollKey", "OutOfTimeAntiKt4TruthJets", ""};
58  Gaudi::Property<double> m_inTimePtCut{this, "InTimePtCut", 10.0*Gaudi::Units::GeV, ""};
59  Gaudi::Property<double> m_outOfTimePtCut{this, "OutOfTimePtCut", 15.0*Gaudi::Units::GeV, ""};
60  Gaudi::Property<bool> m_activateFilter{this, "ActivateFilter", false, ""};
61  Gaudi::Property<bool> m_includeSignalJets{this, "IncludeSignalJets", false, ""};
62  std::unique_ptr< xAOD::JetContainer > m_inTimeOutputJetContainer{};
63  std::unique_ptr< xAOD::JetAuxContainer > m_inTimeOutputJetAuxContainer{};
64  std::unique_ptr< xAOD::JetContainer > m_outOfTimeOutputJetContainer{};
65  std::unique_ptr< xAOD::JetAuxContainer > m_outOfTimeOutputJetAuxContainer{};
66  bool m_first_event{true};
67  double m_signal_max_pT{-1.0};
68  double m_pileup_max_pT{-1.0};
69 };
70 #endif //MCTRUTHSIMALGS_MERGETRUTHJETSTOOL_H
MergeTruthJetsTool::m_outOfTimeOutputJetContainer
std::unique_ptr< xAOD::JetContainer > m_outOfTimeOutputJetContainer
Definition: MergeTruthJetsTool.h:64
MergeTruthJetsTool::m_activateFilter
Gaudi::Property< bool > m_activateFilter
Definition: MergeTruthJetsTool.h:60
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
PileUpToolBase::m_filterPassed
bool m_filterPassed
Definition: PileUpToolBase.h:60
MergeTruthJetsTool::m_pMergeSvc
ServiceHandle< PileUpMergeSvc > m_pMergeSvc
Definition: MergeTruthJetsTool.h:54
MergeTruthJetsTool::m_inTimeOutputJetCollKey
Gaudi::Property< std::string > m_inTimeOutputJetCollKey
Definition: MergeTruthJetsTool.h:56
MergeTruthJetsTool::processAllSubEvents
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
Merge the Truth JetContainers using the PileUpMergeSvc.
Definition: MergeTruthJetsTool.cxx:120
MergeTruthJetsTool::processBunchXing
virtual StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
called for each active bunch-crossing to process current SubEvents bunchXing is in ns
Definition: MergeTruthJetsTool.cxx:42
MergeTruthJetsTool::m_includeSignalJets
Gaudi::Property< bool > m_includeSignalJets
Definition: MergeTruthJetsTool.h:61
MergeTruthJetsTool::mergeEvent
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the subevts loop.
Definition: MergeTruthJetsTool.cxx:94
MergeTruthJetsTool::initialize
StatusCode initialize() override final
Initialize.
Definition: MergeTruthJetsTool.cxx:18
MergeTruthJetsTool
an algorithm to merge truth jet collections in the overlay store
Definition: MergeTruthJetsTool.h:24
MergeTruthJetsTool::prepareEvent
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int nInputEvents) override final
called before the subevts loop.
Definition: MergeTruthJetsTool.cxx:25
MergeTruthJetsTool::m_inTimePtCut
Gaudi::Property< double > m_inTimePtCut
Definition: MergeTruthJetsTool.h:58
MergeTruthJetsTool::m_outOfTimeOutputJetCollKey
Gaudi::Property< std::string > m_outOfTimeOutputJetCollKey
Definition: MergeTruthJetsTool.h:57
MergeTruthJetsTool::m_pileup_max_pT
double m_pileup_max_pT
Definition: MergeTruthJetsTool.h:68
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MergeTruthJetsTool::m_inputJetCollKey
Gaudi::Property< std::string > m_inputJetCollKey
Definition: MergeTruthJetsTool.h:55
MergeTruthJetsTool::m_inTimeOutputJetAuxContainer
std::unique_ptr< xAOD::JetAuxContainer > m_inTimeOutputJetAuxContainer
Definition: MergeTruthJetsTool.h:63
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
MergeTruthJetsTool::m_outOfTimePtCut
Gaudi::Property< double > m_outOfTimePtCut
Definition: MergeTruthJetsTool.h:59
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
MergeTruthJetsTool::resetFilter
virtual void resetFilter() override final
implementation of filter reset
Definition: MergeTruthJetsTool.h:49
PileUpToolBase
Definition: PileUpToolBase.h:18
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MergeTruthJetsTool::m_inTimeOutputJetContainer
std::unique_ptr< xAOD::JetContainer > m_inTimeOutputJetContainer
Definition: MergeTruthJetsTool.h:62
MergeTruthJetsTool::MergeTruthJetsTool
MergeTruthJetsTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MergeTruthJetsTool.cxx:11
MergeTruthJetsTool::m_signal_max_pT
double m_signal_max_pT
Definition: MergeTruthJetsTool.h:67
JetContainer.h
PileUpMergeSvc.h
the preferred mechanism to access information from the different event stores in a pileup job.
MergeTruthJetsTool::m_outOfTimeOutputJetAuxContainer
std::unique_ptr< xAOD::JetAuxContainer > m_outOfTimeOutputJetAuxContainer
Definition: MergeTruthJetsTool.h:65
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MergeTruthJetsTool::processJetContainer
virtual double processJetContainer(const xAOD::JetContainer *inputJetContainer, xAOD::JetContainer *outputJetContainer, const double &ptCut, const float &timeOfBCID, int eventNumber)
JetContainer Loop.
Definition: MergeTruthJetsTool.cxx:203
JetAuxContainer.h
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22
PileUpToolBase.h
helper base class IPileUpTool::toProcess().
MergeTruthJetsTool::m_first_event
bool m_first_event
Definition: MergeTruthJetsTool.h:66
ServiceHandle< PileUpMergeSvc >