ATLAS Offline Software
ForDetEnvelopeTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "ForDetEnvelopeTool.h"
9 
10 #include "StoreGate/StoreGateSvc.h"
11 
13 #include "SGTools/DataProxy.h"
14 
16  const std::string& name,
17  const IInterface* parent):
19  m_manager(nullptr)
20 {
21 }
22 
24 {
25  ATH_MSG_INFO("Building Forward Detectors Envelope");
26 
27  GeoModelExperiment* theExpt;
28  if (StatusCode::SUCCESS != detStore()->retrieve(theExpt,"ATLAS")) {
29  ATH_MSG_ERROR("Could not find GeoModelExperiment ATLAS");
30  return StatusCode::FAILURE;
31  }
32 
33  if(nullptr==m_manager) {
34  GeoPhysVol *world=&*theExpt->getPhysVol();
35 
36  ForDetEnvelopeFactory theFactory(detStore().operator->());
37  theFactory.create(world);
38 
39  m_manager = theFactory.getDetectorManager();
40  theExpt->addManager(m_manager);
41  StatusCode sc = detStore()->record(m_manager,
42  m_manager->getName());
43 
44  if (sc.isFailure()) {
45  ATH_MSG_ERROR("Could not register ForDetEnvelope detector manager");
46  return StatusCode::FAILURE;
47  }
48  return StatusCode::SUCCESS;
49  }
50  return StatusCode::FAILURE;
51 }
52 
54 {
56  if(proxy) {
57  proxy->reset();
58  m_manager = nullptr;
59  }
60  return StatusCode::SUCCESS;
61 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition: GeoModelExperiment.cxx:21
ForDetEnvelopeTool.h
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
GeoModelExperiment
Definition: GeoModelExperiment.h:32
ForDetEnvelopeFactory
Definition: ForDetEnvelopeFactory.h:16
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
GeoModelExperiment.h
ForDetEnvelopeFactory::create
virtual void create(GeoPhysVol *world) override
Definition: ForDetEnvelopeFactory.cxx:30
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
GeoModelTool
Definition: GeoModelTool.h:17
ForDetEnvelopeTool::ForDetEnvelopeTool
ForDetEnvelopeTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ForDetEnvelopeTool.cxx:15
ForDetEnvelopeManager.h
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition: GeoModelExperiment.cxx:40
ForDetEnvelopeFactory.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ForDetEnvelopeTool::clear
virtual StatusCode clear() override final
Definition: ForDetEnvelopeTool.cxx:53
ForDetEnvelopeTool::m_manager
const ForDetEnvelopeManager * m_manager
Definition: ForDetEnvelopeTool.h:24
ForDetEnvelopeTool::create
virtual StatusCode create() override final
Definition: ForDetEnvelopeTool.cxx:23
SG::DataProxy
Definition: DataProxy.h:45
StoreGateSvc.h
DataProxy.h