ATLAS Offline Software
JetGlobalEventSetup.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "JetGlobalEventSetup.h"
6 
7  // Gaudi includes
8 #include "GaudiKernel/IIncidentSvc.h"
9 #include "GaudiKernel/ServiceHandle.h"
10 
11 #include "AthenaKernel/errorcheck.h"
12 #include "JetEvent/JetMomentMap.h"
13 
15 
17  // Constructor
19  JetGlobalEventSetup::JetGlobalEventSetup( const std::string& name, ISvcLocator* pSvcLocator) :
20  AthAlgorithm(name,pSvcLocator)
21  {
22  }
23 
25  // Initialize tool
28  {
29 
30  msg(MSG::INFO) << "initialize()" << endmsg;
31 
32  // Get handle on IncidentSvc
33  ServiceHandle<IIncidentSvc> incidentSvc("IncidentSvc", name());
34  CHECK(incidentSvc.retrieve());
35 
36  // Register listener for BeginRun
37  incidentSvc->addListener(this, "StoreCleared");
38 
39  return StatusCode::SUCCESS;
40  }
41 
42 
44  // Handle incidents
46  void JetGlobalEventSetup::handle(const Incident& inc)
47  {
48 
49  if (inc.type()=="StoreCleared") {
50  ATH_MSG(DEBUG) << " got store cleared event" << endmsg;
51  const StoreClearedIncident* sci
52  = dynamic_cast<const StoreClearedIncident*> (&inc);
53  if (sci && sci->store() == &*evtStore()) {
54  ATH_MSG_DEBUG( " got store cleared event" );
57  //JetMomentMapManager::s_instance.clear();
58  }
59  }
60  }
61 
JetMomentMap.h
ATH_MSG
#define ATH_MSG(lvl)
Definition: AthMsgStreamMacros.h:38
JetGlobalEventSetup::handle
virtual void handle(const Incident &)
Implementation of IIncidentListener::handle.
Definition: JetGlobalEventSetup.cxx:46
OrphanJetCounter::reset
void reset()
Definition: JetMapBase.h:176
OrphanJetMomentMap::instance
static OrphanJetMomentMap instance
Definition: JetMomentMap.h:59
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
JetGlobalEventSetup.h
JetGlobalEventSetup::JetGlobalEventSetup
JetGlobalEventSetup(const std::string &name, ISvcLocator *pSvcLocator)
Definition: JetGlobalEventSetup.cxx:19
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
errorcheck.h
Helpers for checking error return status codes and reporting errors.
StoreClearedIncident::store
const StoreGateSvc * store() const
Return the store that was cleared.
Definition: StoreClearedIncident.cxx:33
StoreClearedIncident.h
Incident sent after a store is cleared.
JetGlobalEventSetup::initialize
virtual StatusCode initialize()
Definition: JetGlobalEventSetup.cxx:27
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
JetMapBase::clear
virtual void clear()
ServiceHandle< IIncidentSvc >
StoreClearedIncident
Incident sent after a store is cleared.
Definition: StoreClearedIncident.h:30