ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
ForwardSimulation
ForwardRegionGeoModel
src
ForwardRegionGeoModelTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
ForwardRegionGeoModelTool.h
"
6
#include "
ForwardRegionGeoModelFactory.h
"
7
#include "
ForwardRegionGeoModelManager.h
"
8
#include "
GeoModelUtilities/GeoModelExperiment.h
"
9
#include "GaudiKernel/IService.h"
10
#include "GaudiKernel/ISvcLocator.h"
11
#include "GaudiKernel/MsgStream.h"
12
#include "GaudiKernel/SystemOfUnits.h"
13
#include "
StoreGate/StoreGateSvc.h
"
14
18
ForwardRegionGeoModelTool::ForwardRegionGeoModelTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent )
19
:
GeoModelTool
(
type
, name, parent )
20
{
21
m_Config
.clear();
22
declareProperty(
"TCL4JawDistB1I"
,
m_Config
.TCL4JawDistB1I=57*Gaudi::Units::mm);
23
declareProperty(
"TCL4JawDistB2I"
,
m_Config
.TCL4JawDistB2I=57*Gaudi::Units::mm);
24
declareProperty(
"TCL5JawDistB1I"
,
m_Config
.TCL5JawDistB1I=57*Gaudi::Units::mm);
25
declareProperty(
"TCL5JawDistB2I"
,
m_Config
.TCL5JawDistB2I=57*Gaudi::Units::mm);
26
declareProperty(
"TCL6JawDistB1I"
,
m_Config
.TCL6JawDistB1I=57*Gaudi::Units::mm);
27
declareProperty(
"TCL6JawDistB2I"
,
m_Config
.TCL6JawDistB2I=57*Gaudi::Units::mm);
28
declareProperty(
"TCL4JawDistB1O"
,
m_Config
.TCL4JawDistB1O=57*Gaudi::Units::mm);
29
declareProperty(
"TCL4JawDistB2O"
,
m_Config
.TCL4JawDistB2O=57*Gaudi::Units::mm);
30
declareProperty(
"TCL5JawDistB1O"
,
m_Config
.TCL5JawDistB1O=57*Gaudi::Units::mm);
31
declareProperty(
"TCL5JawDistB2O"
,
m_Config
.TCL5JawDistB2O=57*Gaudi::Units::mm);
32
declareProperty(
"TCL6JawDistB1O"
,
m_Config
.TCL6JawDistB1O=57*Gaudi::Units::mm);
33
declareProperty(
"TCL6JawDistB2O"
,
m_Config
.TCL6JawDistB2O=57*Gaudi::Units::mm);
34
declareProperty(
"vp1Compatibility"
,
m_Config
.vp1Compatibility=
false
);
35
declareProperty(
"buildTCL4"
,
m_Config
.buildTCL4=
false
);
36
declareProperty(
"buildTCL6"
,
m_Config
.buildTCL6=
false
);
37
declareProperty(
"ALFAInNewPosition"
,
m_Config
.ALFAInNewPosition=
false
);
38
declareProperty(
"newPosB7L1"
,
m_Config
.newPosB7L1=245656.77*Gaudi::Units::mm);
39
declareProperty(
"newPosB7R1"
,
m_Config
.newPosB7R1=-245656.11*Gaudi::Units::mm);
40
declareProperty(
"posAFPL1"
,
m_Config
.posAFPL1=204500*Gaudi::Units::mm);
41
declareProperty(
"posAFPR1"
,
m_Config
.posAFPR1=-204500*Gaudi::Units::mm);
42
declareProperty(
"posAFPL2"
,
m_Config
.posAFPL2=212675*Gaudi::Units::mm);
43
declareProperty(
"posAFPR2"
,
m_Config
.posAFPR2=-212675*Gaudi::Units::mm);
44
declareProperty(
"posZDC1"
,
m_Config
.posZDC1=141580*Gaudi::Units::mm);
45
declareProperty(
"posZDC2"
,
m_Config
.posZDC2=-141580*Gaudi::Units::mm);
46
}
47
51
ForwardRegionGeoModelTool::~ForwardRegionGeoModelTool
()
52
{
53
// This will need to be modified once we register the DetectorNode in
54
// the Transient Detector Store
55
if
( 0 !=
m_detector
) {
56
delete
m_detector
;
57
m_detector
= 0;
58
}
59
}
60
64
StatusCode
65
ForwardRegionGeoModelTool::create
()
66
{
67
MsgStream log(msgSvc(), name());
68
//
69
// Locate the top level experiment node
70
//
71
GeoModelExperiment
* theExpt =
nullptr
;
72
StatusCode
sc
= detStore()->retrieve( theExpt,
"ATLAS"
);
73
if
(StatusCode::SUCCESS !=
sc
) {
74
log << MSG::ERROR
75
<<
"Could not find GeoModelExperiment ATLAS"
76
<<
endmsg
;
77
return
(StatusCode::FAILURE);
78
}
79
80
ForwardRegionGeoModelFactory
theFactory(detStore().operator->(), &
m_Config
);
81
if
( 0 ==
m_detector
) {
82
// Create the DetectorNode instance
83
try
{
84
//
85
// This strange way of casting is to avoid an
86
// utterly brain damaged compiler warning.
87
//
88
GeoPhysVol *world=&*theExpt->
getPhysVol
();
89
theFactory.
create
(world);
90
}
catch
(
const
std::bad_alloc&) {
91
log << MSG::FATAL <<
"Could not create new DetectorNode!"
<<
endmsg
;
92
return
StatusCode::FAILURE;
93
}
94
// Register the DetectorNode instance with the Transient Detector Store
95
theExpt->
addManager
(theFactory.
getDetectorManager
());
96
sc
= detStore()->record(theFactory.
getDetectorManager
(),theFactory.
getDetectorManager
()->getName());
97
if
(StatusCode::SUCCESS !=
sc
) {
98
log << MSG::ERROR
99
<<
"Could not register DetectorNode"
100
<<
endmsg
;
101
return
(StatusCode::FAILURE);
102
}
103
return
StatusCode::SUCCESS;
104
}
105
return
StatusCode::FAILURE;
106
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ForwardRegionGeoModelFactory.h
ForwardRegionGeoModelManager.h
ForwardRegionGeoModelTool.h
GeoModelExperiment.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
StoreGateSvc.h
ForwardRegionGeoModelFactory
Definition
ForwardRegionGeoModelFactory.h:49
ForwardRegionGeoModelFactory::create
virtual void create(GeoPhysVol *world)
Definition
ForwardRegionGeoModelFactory.cxx:373
ForwardRegionGeoModelFactory::getDetectorManager
virtual const ForwardRegionGeoModelManager * getDetectorManager() const
Definition
ForwardRegionGeoModelFactory.cxx:442
ForwardRegionGeoModelTool::m_Config
FWD_CONFIGURATION m_Config
Definition
ForwardRegionGeoModelTool.h:24
ForwardRegionGeoModelTool::create
virtual StatusCode create() override final
Create the Detector Node corresponding to this tool.
Definition
ForwardRegionGeoModelTool.cxx:65
ForwardRegionGeoModelTool::~ForwardRegionGeoModelTool
virtual ~ForwardRegionGeoModelTool() override final
Destructor.
Definition
ForwardRegionGeoModelTool.cxx:51
ForwardRegionGeoModelTool::ForwardRegionGeoModelTool
ForwardRegionGeoModelTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor(s).
Definition
ForwardRegionGeoModelTool.cxx:18
GeoModelExperiment
Definition
GeoModelExperiment.h:32
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition
GeoModelExperiment.cxx:21
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition
GeoModelExperiment.cxx:40
GeoModelTool
Definition
GeoModelTool.h:15
GeoModelTool::m_detector
GeoVDetectorManager * m_detector
Definition
GeoModelTool.h:28
type
Generated on
for ATLAS Offline Software by
1.17.0