ATLAS Offline Software
DigitizationAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "DigitizationAlg.h"
6 
8 
9 DigitizationAlg::DigitizationAlg(const std::string& name, ISvcLocator* pSvcLocator)
10  : AthAlgorithm(name, pSvcLocator)
11 {
12 }
13 
14 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
15 
17 {
18  ATH_MSG_DEBUG ( "Initializing " << name() );
19  //locate the PileupTools and initialize them
20  ATH_CHECK(m_puTools.retrieve());
21  return StatusCode::SUCCESS;
22 }
23 
24 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
25 
27 {
28  ATH_MSG_DEBUG ("in execute()");
29  for(auto& puToolHandle : m_puTools)
30  {
31  // Reset the filter first
32  puToolHandle->resetFilter();
33  ATH_CHECK(puToolHandle->processAllSubEvents(Gaudi::Hive::currentContext()));
34  // Check if the event was filtered out by the current PileUpTool.
35  if (!puToolHandle->filterPassed())
36  {
37  ATH_MSG_VERBOSE( "Filter " << puToolHandle->name() << " failed - will stop the event" );
38  this->setFilterPassed(false);
39  break;
40  }
41  }
42  return StatusCode::SUCCESS;
43 }
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
46 
48 
49  ATH_MSG_INFO ("in finalize()");
50  return StatusCode::SUCCESS;
51 }
DigitizationAlg::execute
StatusCode execute()
Definition: DigitizationAlg.cxx:26
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
DigitizationAlg::m_puTools
ToolHandleArray< IPileUpTool > m_puTools
Definition: DigitizationAlg.h:29
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DigitizationAlg::initialize
StatusCode initialize()
Definition: DigitizationAlg.cxx:16
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DigitizationAlg::DigitizationAlg
DigitizationAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: DigitizationAlg.cxx:9
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DigitizationAlg::finalize
StatusCode finalize()
Definition: DigitizationAlg.cxx:47
DigitizationAlg.h
an algorithm to run digitization in the original 'algorithm' approach using the common interface of I...