ATLAS Offline Software
PileUpToolBase.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 
3 /*
4  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef PILEUPTOOLS_PILEUPTOOLBASE_H
8 #define PILEUPTOOLS_PILEUPTOOLBASE_H
9 
17 
18 class PileUpToolBase : public extends<AthAlgTool, IPileUpTool> {
19 public:
21 
22  PileUpToolBase(const std::string& type,
23  const std::string& name,
24  const IInterface* parent);
25 
26  virtual StatusCode initialize() override {
27  return StatusCode::SUCCESS;
28  }
30 
32  virtual bool toProcess(int bunchXing) const override {
33  //closed interval [m_firstXing,m_lastXing]
34  return !((m_firstXing > bunchXing) || (bunchXing > m_lastXing));
35  }
39  virtual StatusCode processAllSubEvents(const EventContext&) override {
40  return StatusCode::SUCCESS;
41  }
42  virtual StatusCode
43  processBunchXing(int /*bunchXing*/,
44  SubEventIterator /*bSubEvents*/,
45  SubEventIterator /*eSubEvents*/) override {
46  return StatusCode::SUCCESS;
47  }
49  virtual bool filterPassed() const override { return m_filterPassed; }
51  virtual void resetFilter() override { m_filterPassed=true; }
52 
53 protected:
54  Gaudi::Property<int> m_firstXing{this, "FirstXing", -999,
55  "First bunch-crossing in which det is live"};
56  Gaudi::Property<int> m_lastXing {this, "LastXing", 999,
57  "Last bunch-crossing in which det is live"};
58  Gaudi::Property<int> m_vetoPileUpTruthLinks{this, "VetoPileUpTruthLinks", true,
59  "Ignore links to suppressed pile-up truth"};
60  bool m_filterPassed{true};
61 };
62 #endif
PileUpToolBase::m_filterPassed
bool m_filterPassed
Definition: PileUpToolBase.h:60
PileUpToolBase::toProcess
virtual bool toProcess(int bunchXing) const override
the method this base class helps implementing
Definition: PileUpToolBase.h:32
PileUpToolBase::processBunchXing
virtual StatusCode processBunchXing(int, SubEventIterator, SubEventIterator) override
Definition: PileUpToolBase.h:43
PileUpToolBase::m_lastXing
Gaudi::Property< int > m_lastXing
Definition: PileUpToolBase.h:56
PileUpToolBase::filterPassed
virtual bool filterPassed() const override
dummy implementation of passing filter
Definition: PileUpToolBase.h:49
PileUpToolBase::m_vetoPileUpTruthLinks
Gaudi::Property< int > m_vetoPileUpTruthLinks
Definition: PileUpToolBase.h:58
PileUpToolBase::initialize
virtual StatusCode initialize() override
Definition: PileUpToolBase.h:26
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
IPileUpTool.h
a call-back interface for tools that merge pileup events information An IPileUpTool is called back fo...
PileUpToolBase::PileUpToolBase
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PileUpToolBase.cxx:7
IPileUpTool::processAllSubEvents
virtual StatusCode processAllSubEvents(const EventContext &ctx)=0
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
PileUpToolBase
Definition: PileUpToolBase.h:18
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MagicNumbers.h
PileUpToolBase::processAllSubEvents
virtual StatusCode processAllSubEvents(const EventContext &) override
Definition: PileUpToolBase.h:39
PileUpToolBase::resetFilter
virtual void resetFilter() override
dummy implementation of filter reset
Definition: PileUpToolBase.h:51
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
PileUpToolBase::m_firstXing
Gaudi::Property< int > m_firstXing
Definition: PileUpToolBase.h:54
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22