ATLAS Offline Software
Loading...
Searching...
No Matches
ForwardRegionGeoModelTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
9#include "GaudiKernel/IService.h"
10#include "GaudiKernel/ISvcLocator.h"
11#include "GaudiKernel/MsgStream.h"
12#include "GaudiKernel/SystemOfUnits.h"
14
18ForwardRegionGeoModelTool::ForwardRegionGeoModelTool( const std::string& type, const std::string& name, const IInterface* parent )
19: GeoModelTool( type, name, parent )
20{
21}
22
27{
28 // This will need to be modified once we register the DetectorNode in
29 // the Transient Detector Store
30 if ( 0 != m_detector ) {
31 delete m_detector;
32 m_detector = 0;
33 }
34}
35
40{
41 m_Config.clear();
42 m_Config.TCL4JawDistB1I = m_tcl4JawDistB1I;
43 m_Config.TCL4JawDistB2I = m_tcl4JawDistB2I;
44 m_Config.TCL5JawDistB1I = m_tcl5JawDistB1I;
45 m_Config.TCL5JawDistB2I = m_tcl5JawDistB2I;
46 m_Config.TCL6JawDistB1I = m_tcl6JawDistB1I;
47 m_Config.TCL6JawDistB2I = m_tcl6JawDistB2I;
48 m_Config.TCL4JawDistB1O = m_tcl4JawDistB1O;
49 m_Config.TCL4JawDistB2O = m_tcl4JawDistB2O;
50 m_Config.TCL5JawDistB1O = m_tcl5JawDistB1O;
51 m_Config.TCL5JawDistB2O = m_tcl5JawDistB2O;
52 m_Config.TCL6JawDistB1O = m_tcl6JawDistB1O;
53 m_Config.TCL6JawDistB2O = m_tcl6JawDistB2O;
54 m_Config.vp1Compatibility = m_vp1Compatibility;
55 m_Config.buildTCL4 = m_buildTCL4;
56 m_Config.buildTCL6 = m_buildTCL6;
57 m_Config.ALFAInNewPosition = m_alfaInNewPosition;
58 m_Config.newPosB7L1 = m_newPosB7L1;
59 m_Config.newPosB7R1 = m_newPosB7R1;
60 m_Config.posAFPL1 = m_posAFPL1;
61 m_Config.posAFPR1 = m_posAFPR1;
62 m_Config.posAFPL2 = m_posAFPL2;
63 m_Config.posAFPR2 = m_posAFPR2;
64 m_Config.posZDC1 = m_posZDC1;
65 m_Config.posZDC2 = m_posZDC2;
66}
67
71StatusCode
73{
74 MsgStream log(msgSvc(), name());
75 //
76 // Locate the top level experiment node
77 //
78 GeoModelExperiment* theExpt = nullptr;
79 StatusCode sc = detStore()->retrieve( theExpt, "ATLAS" );
80 if (StatusCode::SUCCESS != sc) {
81 log << MSG::ERROR
82 << "Could not find GeoModelExperiment ATLAS"
83 << endmsg;
84 return (StatusCode::FAILURE);
85 }
86
87 fillConfig();
88
89 ForwardRegionGeoModelFactory theFactory(detStore().operator->(), &m_Config);
90 if ( 0 == m_detector ) {
91 // Create the DetectorNode instance
92 try {
93 //
94 // This strange way of casting is to avoid an
95 // utterly brain damaged compiler warning.
96 //
97 GeoPhysVol *world=&*theExpt->getPhysVol();
98 theFactory.create(world);
99 } catch (const std::bad_alloc&) {
100 log << MSG::FATAL << "Could not create new DetectorNode!" << endmsg;
101 return StatusCode::FAILURE;
102 }
103 // Register the DetectorNode instance with the Transient Detector Store
104 theExpt->addManager(theFactory.getDetectorManager());
105 sc = detStore()->record(theFactory.getDetectorManager(),theFactory.getDetectorManager()->getName());
106 if (StatusCode::SUCCESS != sc) {
107 log << MSG::ERROR
108 << "Could not register DetectorNode"
109 << endmsg;
110 return (StatusCode::FAILURE);
111 }
112 return StatusCode::SUCCESS;
113 }
114 return StatusCode::FAILURE;
115}
#define endmsg
static Double_t sc
virtual void create(GeoPhysVol *world)
virtual const ForwardRegionGeoModelManager * getDetectorManager() const
Gaudi::Property< double > m_tcl6JawDistB2I
Gaudi::Property< double > m_posZDC2
Gaudi::Property< double > m_tcl6JawDistB1I
Gaudi::Property< bool > m_buildTCL4
Gaudi::Property< double > m_posAFPL1
Gaudi::Property< double > m_posAFPR2
Gaudi::Property< double > m_tcl4JawDistB1O
Gaudi::Property< double > m_tcl6JawDistB1O
Gaudi::Property< double > m_posAFPL2
Gaudi::Property< bool > m_vp1Compatibility
virtual StatusCode create() override final
Create the Detector Node corresponding to this tool.
Gaudi::Property< bool > m_buildTCL6
Gaudi::Property< double > m_tcl4JawDistB2I
Gaudi::Property< double > m_tcl5JawDistB1I
Gaudi::Property< double > m_tcl6JawDistB2O
Gaudi::Property< double > m_tcl4JawDistB1I
Gaudi::Property< double > m_posAFPR1
void fillConfig()
Copy the property values into the configuration structure.
virtual ~ForwardRegionGeoModelTool() override final
Destructor.
Gaudi::Property< double > m_newPosB7L1
Gaudi::Property< bool > m_alfaInNewPosition
Gaudi::Property< double > m_tcl5JawDistB1O
Gaudi::Property< double > m_tcl4JawDistB2O
ForwardRegionGeoModelTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor(s).
Gaudi::Property< double > m_posZDC1
Gaudi::Property< double > m_newPosB7R1
Gaudi::Property< double > m_tcl5JawDistB2O
Gaudi::Property< double > m_tcl5JawDistB2I
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)
GeoVDetectorManager * m_detector