ATLAS Offline Software
Loading...
Searching...
No Matches
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
9
11
13#include "SGTools/DataProxy.h"
14
16 const std::string& name,
17 const IInterface* parent):
18 GeoModelTool(type,name,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{
55 SG::DataProxy* proxy = detStore()->proxy(ClassID_traits<ForDetEnvelopeManager>::ID(),m_manager->getName());
56 if(proxy) {
57 proxy->reset();
58 m_manager = nullptr;
59 }
60 return StatusCode::SUCCESS;
61}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
static Double_t sc
virtual const ForDetEnvelopeManager * getDetectorManager() const override
virtual void create(GeoPhysVol *world) override
virtual StatusCode clear() override final
const ForDetEnvelopeManager * m_manager
ForDetEnvelopeTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode create() override final
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)