ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Utils
src
VP1JobConfigInfo.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
7
// //
8
// Implementation of class VP1JobConfigInfo //
9
// //
10
// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11
// Initial version: March 2008 //
12
// //
14
15
#include "
VP1Utils/VP1JobConfigInfo.h
"
16
#include "
VP1Utils/VP1DetInfo.h
"
17
#include "
VP1Utils/VP1SGAccessHelper.h
"
18
#include "
VP1Utils/VP1SGContentsHelper.h
"
19
#include "
VP1Base/IVP1System.h
"
20
#include "
VP1Base/VP1Msg.h
"
21
#include "
VP1Base/VP1AthenaPtrs.h
"
22
23
#include "GeoModelKernel/GeoVolumeCursor.h"
24
#include "
GeoModelUtilities/GeoModelExperiment.h
"
25
26
#include <QString>
27
28
//____________________________________________________________________
29
class
VP1JobConfigInfo::Imp
{
30
public
:
31
static
void
ensureInit
();
32
static
bool
actualInit
(
StoreGateSvc
* detStore);
33
static
bool
initialised
;
34
35
static
GeoPVConstLink
geoModelWorld
;
36
static
bool
hasGeoModelExperiment
;
37
static
bool
hasITkGeometry
;
38
static
bool
hasPixelGeometry
;
39
static
bool
hasSCTGeometry
;
40
static
bool
hasTRTGeometry
;
41
static
bool
hasHGTDGeometry
;
42
static
bool
hasInDetServiceMaterialGeometry
;
43
static
bool
hasBeamPipeGeometry
;
44
static
bool
hasLArGeometry
;
45
static
bool
hasTileGeometry
;
46
static
bool
hasMuonGeometry
;
47
static
bool
hasMuonNSWGeometry
;
48
static
bool
hasLUCIDGeometry
;
49
static
bool
hasBCMGeometry
;
50
static
bool
hasCavernInfraGeometry
;
51
52
static
void
turnOffAll
();
53
};
54
55
GeoPVConstLink
VP1JobConfigInfo::Imp::geoModelWorld
;
56
// init default values
57
bool
VP1JobConfigInfo::Imp::initialised
=
false
;
58
bool
VP1JobConfigInfo::Imp::hasGeoModelExperiment
=
false
;
59
bool
VP1JobConfigInfo::Imp::hasITkGeometry
=
false
;
60
bool
VP1JobConfigInfo::Imp::hasHGTDGeometry
=
false
;
61
bool
VP1JobConfigInfo::Imp::hasPixelGeometry
=
false
;
62
bool
VP1JobConfigInfo::Imp::hasSCTGeometry
=
false
;
63
bool
VP1JobConfigInfo::Imp::hasTRTGeometry
=
false
;
64
bool
VP1JobConfigInfo::Imp::hasInDetServiceMaterialGeometry
=
false
;
65
bool
VP1JobConfigInfo::Imp::hasBeamPipeGeometry
=
false
;
66
bool
VP1JobConfigInfo::Imp::hasLArGeometry
=
false
;
67
bool
VP1JobConfigInfo::Imp::hasTileGeometry
=
false
;
68
bool
VP1JobConfigInfo::Imp::hasMuonGeometry
=
false
;
69
bool
VP1JobConfigInfo::Imp::hasMuonNSWGeometry
=
false
;
70
bool
VP1JobConfigInfo::Imp::hasLUCIDGeometry
=
false
;
71
bool
VP1JobConfigInfo::Imp::hasBCMGeometry
=
false
;
72
bool
VP1JobConfigInfo::Imp::hasCavernInfraGeometry
=
false
;
73
74
//____________________________________________________________________
75
void
VP1JobConfigInfo::Imp::turnOffAll
()
76
{
77
hasGeoModelExperiment
=
false
;
78
hasITkGeometry
=
false
;
79
hasHGTDGeometry
=
false
;
80
hasPixelGeometry
=
false
;
81
hasSCTGeometry
=
false
;
82
hasTRTGeometry
=
false
;
83
hasInDetServiceMaterialGeometry
=
false
;
84
hasBeamPipeGeometry
=
false
;
85
hasLArGeometry
=
false
;
86
hasTileGeometry
=
false
;
87
hasMuonGeometry
=
false
;
88
hasLUCIDGeometry
=
false
;
89
hasBCMGeometry
=
false
;
90
hasCavernInfraGeometry
=
false
;
91
}
92
93
//____________________________________________________________________
94
void
VP1JobConfigInfo::Imp::ensureInit
()
95
{
96
if
(
initialised
)
97
return
;
98
if
(
VP1Msg::verbose
())
99
VP1Msg::messageVerbose
(
"VP1JobConfigInfo initialising"
);
100
initialised
=
true
;
101
if
(!
actualInit
(
VP1AthenaPtrs::detectorStore
())) {
102
VP1Msg::message
(
"VP1JobConfigInfo ERROR: Problems initialising. "
103
"Will assume all subsystems are off in this job!"
);
104
turnOffAll
();
105
}
106
if
(
VP1Msg::verbose
()) {
107
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => Found job configuration:"
);
108
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasGeoModelExperiment = "
+QString(
hasGeoModelExperiment
?
"On"
:
"Off"
));
109
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasITkGeometry = "
+QString(
hasITkGeometry
?
"On"
:
"Off"
));
110
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasHGTDGeometry = "
+QString(
hasHGTDGeometry
?
"On"
:
"Off"
));
111
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasPixelGeometry = "
+QString(
hasPixelGeometry
?
"On"
:
"Off"
));
112
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasSCTGeometry = "
+QString(
hasSCTGeometry
?
"On"
:
"Off"
));
113
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasTRTGeometry = "
+QString(
hasTRTGeometry
?
"On"
:
"Off"
));
114
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasInDetServiceMaterialGeometry = "
+QString(
hasInDetServiceMaterialGeometry
?
"On"
:
"Off"
));
115
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasBeamPipeGeometry = "
+QString(
hasBeamPipeGeometry
?
"On"
:
"Off"
));
116
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasLArGeometry = "
+QString(
hasLArGeometry
?
"On"
:
"Off"
));
117
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasTileGeometry = "
+QString(
hasTileGeometry
?
"On"
:
"Off"
));
118
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasMuonGeometry = "
+QString(
hasMuonGeometry
?
"On"
:
"Off"
));
119
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasMuonNSWGeometry = "
+QString(
hasMuonNSWGeometry
?
"On"
:
"Off"
));
120
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasLUCIDGeometry = "
+QString(
hasLUCIDGeometry
?
"On"
:
"Off"
));
121
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasBCMGeometry = "
+QString(
hasBCMGeometry
?
"On"
:
"Off"
));
122
VP1Msg::messageVerbose
(
"VP1JobConfigInfo => hasCavernInfraGeometry = "
+QString(
hasCavernInfraGeometry
?
"On"
:
"Off"
));
123
}
124
125
}
126
127
//____________________________________________________________________
128
bool
VP1JobConfigInfo::hasGeoModelExperiment
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasGeoModelExperiment
; }
129
bool
VP1JobConfigInfo::hasITkGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasITkGeometry
; }
130
bool
VP1JobConfigInfo::hasPixelGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasPixelGeometry
; }
131
bool
VP1JobConfigInfo::hasHGTDGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasHGTDGeometry
; }
132
bool
VP1JobConfigInfo::hasSCTGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasSCTGeometry
; }
133
bool
VP1JobConfigInfo::hasTRTGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasTRTGeometry
; }
134
bool
VP1JobConfigInfo::hasInDetServiceMaterialGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasInDetServiceMaterialGeometry
; }
135
bool
VP1JobConfigInfo::hasBeamPipeGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasBeamPipeGeometry
; }
136
bool
VP1JobConfigInfo::hasLArGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasLArGeometry
; }
137
bool
VP1JobConfigInfo::hasTileGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasTileGeometry
; }
138
bool
VP1JobConfigInfo::hasMuonGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasMuonGeometry
; }
139
bool
VP1JobConfigInfo::hasMuonNSWGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasMuonNSWGeometry
; }
140
bool
VP1JobConfigInfo::hasLUCIDGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasLUCIDGeometry
; }
141
bool
VP1JobConfigInfo::hasBCMGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasBCMGeometry
; }
142
bool
VP1JobConfigInfo::hasCavernInfraGeometry
() {
if
(!
Imp::initialised
)
Imp::ensureInit
();
return
Imp::hasCavernInfraGeometry
; }
143
144
//____________________________________________________________________
145
bool
VP1JobConfigInfo::Imp::actualInit
(
StoreGateSvc
* detStore )
146
{
147
if
(!detStore)
148
return
false
;
149
150
VP1SGContentsHelper
sg_contents(detStore);
151
const
QString geomodelkey =
"ATLAS"
;
152
if
(!sg_contents.
contains
<
GeoModelExperiment
>(geomodelkey)) {
153
if
(
VP1Msg::verbose
())
154
VP1Msg::messageVerbose
(
"VP1JobConfigInfo: No GeoModelExperiment in detectorStore. Concluding all subsystems are off."
);
155
turnOffAll
();
156
return
true
;
157
}
158
159
VP1SGAccessHelper
sg_access(detStore);
160
161
const
GeoModelExperiment
* theExpt;
162
if
(!sg_access.
retrieve
(theExpt,geomodelkey)) {
163
if
(
VP1Msg::verbose
())
164
VP1Msg::messageVerbose
(
"VP1JobConfigInfo: No GeoModelExperiment in detectorStore. Concluding all subsystems are off."
);
165
turnOffAll
();
166
return
true
;
167
}
168
if
(
VP1Msg::verbose
())
169
VP1Msg::messageVerbose
(
"VP1JobConfigInfo: Retrieved GeoModelExperiment/"
+geomodelkey);
170
171
const
GeoPhysVol * worldPhysVol = theExpt->
getPhysVol
();
172
if
(!worldPhysVol) {
173
VP1Msg::message
(
"VP1JobConfigInfo: ERROR: GeoModelExperiment has null physical volume."
);
174
turnOffAll
();
175
return
false
;
176
}
177
if
(
VP1Msg::verbose
())
178
VP1Msg::messageVerbose
(
"VP1JobConfigInfo: Retrieved GeoModelExperiment physical volumes"
);
179
180
hasGeoModelExperiment
=
true
;
181
PVConstLink world(worldPhysVol);
182
183
GeoVolumeCursor av(world);
184
185
186
while
(!av.atEnd()) {
187
std::string name = av.getName();
188
189
if
( !
hasITkGeometry
&& name==
"ITkPixel"
) {
hasITkGeometry
=
true
; }
190
if
( !
hasITkGeometry
&& name==
"ITkStrip"
) {
hasITkGeometry
=
true
; }
191
if
( !
hasHGTDGeometry
&& name==
"HGTD"
) {
hasHGTDGeometry
=
true
; }
192
if
( !
hasPixelGeometry
&& name==
"Pixel"
) {
193
hasPixelGeometry
=
true
;
194
if
(not
hasITkGeometry
and name ==
"ITkPixel"
) {
195
VP1Msg::messageWarningAllRed
(
"WARNING!!! --- The GeoVolume has name 'ITkPixel' but the flag 'hasITkGeometry' is false ---> CHECK IT!!"
);
196
}
197
if
( !
hasBCMGeometry
) {
198
//Loop under the top Pixel volume to check if there are BCM volumes
199
//present in the current config:
200
GeoVolumeCursor pv(av.getVolume());
201
while
(!pv.atEnd()) {
202
if
(pv.getVolume()->getLogVol()->getName()==
"bcmModLog"
) {
203
hasBCMGeometry
=
true
;
204
break
;
205
}
206
pv.next();
207
}
208
}
209
}
210
if
( !
hasSCTGeometry
&& name==
"SCT"
) {
211
hasSCTGeometry
=
true
;
212
if
(not
hasITkGeometry
and name ==
"ITkStrip"
) {
213
VP1Msg::messageWarningAllRed
(
"WARNING!!! --- The GeoVolume has name 'ITkStrip' but the flag 'hasITkGeometry' is false ---> CHECK IT!!"
);
214
}
215
}
216
if
( !
hasTRTGeometry
&& name==
"TRT"
)
hasTRTGeometry
=
true
;
217
if
( !
hasInDetServiceMaterialGeometry
&& name==
"InDetServMat"
)
hasInDetServiceMaterialGeometry
=
true
;
218
if
( !
hasBeamPipeGeometry
&& name==
"BeamPipe"
)
hasBeamPipeGeometry
=
true
;
219
if
( !
hasLArGeometry
&& name==
"LArBarrel"
)
hasLArGeometry
=
true
;
220
if
( !
hasLArGeometry
&& name==
"LArEndcapPos"
)
hasLArGeometry
=
true
;
221
if
( !
hasLArGeometry
&& name==
"LArEndcapNeg"
)
hasLArGeometry
=
true
;
222
if
( !
hasTileGeometry
&& name==
"Tile"
)
hasTileGeometry
=
true
;
223
if
( !
hasMuonGeometry
&& name==
"Muon"
) {
224
hasMuonGeometry
=
true
;
225
if
( !
hasMuonNSWGeometry
) {
226
//Loop under the top Muon volume to check if there are NSW volumes
227
//present in the current config:
228
GeoVolumeCursor pv(av.getVolume());
229
while
(!pv.atEnd()) {
230
if
(pv.getVolume()->getLogVol()->getName()==
"NewSmallWheel"
) {
231
hasMuonNSWGeometry
=
true
;
232
break
;
233
}
234
pv.next();
235
}
236
}
237
}
238
if
( !
hasLUCIDGeometry
&& (name==
"LucidSideA"
||name==
"LucidSideC"
))
hasLUCIDGeometry
=
true
;
239
//FIXME: Look for CavernInfra as well!!!
240
241
av.next();
// increment volume cursor.
242
}
243
244
Imp::geoModelWorld
= worldPhysVol;
245
246
return
true
;
247
}
248
249
//____________________________________________________________________
250
const
GeoPVConstLink *
VP1JobConfigInfo::geoModelWorld
()
251
{
252
Imp::ensureInit
();
253
return
Imp::geoModelWorld
== GeoPVConstLink() ? 0 : &
Imp::geoModelWorld
;
254
}
GeoModelExperiment.h
IVP1System.h
VP1AthenaPtrs.h
VP1DetInfo.h
VP1JobConfigInfo.h
VP1Msg.h
VP1SGAccessHelper.h
VP1SGContentsHelper.h
GeoModelExperiment
Definition
GeoModelExperiment.h:32
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition
GeoModelExperiment.cxx:21
StoreGateSvc
The Athena Transient Store API.
Definition
StoreGateSvc.h:120
VP1AthenaPtrs::detectorStore
static StoreGateSvc * detectorStore()
Definition
VP1AthenaPtrs.h:28
VP1JobConfigInfo::Imp
Definition
VP1JobConfigInfo.cxx:29
VP1JobConfigInfo::Imp::hasCavernInfraGeometry
static bool hasCavernInfraGeometry
Definition
VP1JobConfigInfo.cxx:50
VP1JobConfigInfo::Imp::hasHGTDGeometry
static bool hasHGTDGeometry
Definition
VP1JobConfigInfo.cxx:41
VP1JobConfigInfo::Imp::initialised
static bool initialised
Definition
VP1JobConfigInfo.cxx:33
VP1JobConfigInfo::Imp::hasBeamPipeGeometry
static bool hasBeamPipeGeometry
Definition
VP1JobConfigInfo.cxx:43
VP1JobConfigInfo::Imp::hasGeoModelExperiment
static bool hasGeoModelExperiment
Definition
VP1JobConfigInfo.cxx:36
VP1JobConfigInfo::Imp::hasITkGeometry
static bool hasITkGeometry
Definition
VP1JobConfigInfo.cxx:37
VP1JobConfigInfo::Imp::hasTRTGeometry
static bool hasTRTGeometry
Definition
VP1JobConfigInfo.cxx:40
VP1JobConfigInfo::Imp::ensureInit
static void ensureInit()
Definition
VP1JobConfigInfo.cxx:94
VP1JobConfigInfo::Imp::hasLUCIDGeometry
static bool hasLUCIDGeometry
Definition
VP1JobConfigInfo.cxx:48
VP1JobConfigInfo::Imp::hasMuonGeometry
static bool hasMuonGeometry
Definition
VP1JobConfigInfo.cxx:46
VP1JobConfigInfo::Imp::hasMuonNSWGeometry
static bool hasMuonNSWGeometry
Definition
VP1JobConfigInfo.cxx:47
VP1JobConfigInfo::Imp::hasPixelGeometry
static bool hasPixelGeometry
Definition
VP1JobConfigInfo.cxx:38
VP1JobConfigInfo::Imp::turnOffAll
static void turnOffAll()
Definition
VP1JobConfigInfo.cxx:75
VP1JobConfigInfo::Imp::hasLArGeometry
static bool hasLArGeometry
Definition
VP1JobConfigInfo.cxx:44
VP1JobConfigInfo::Imp::hasSCTGeometry
static bool hasSCTGeometry
Definition
VP1JobConfigInfo.cxx:39
VP1JobConfigInfo::Imp::hasTileGeometry
static bool hasTileGeometry
Definition
VP1JobConfigInfo.cxx:45
VP1JobConfigInfo::Imp::hasBCMGeometry
static bool hasBCMGeometry
Definition
VP1JobConfigInfo.cxx:49
VP1JobConfigInfo::Imp::hasInDetServiceMaterialGeometry
static bool hasInDetServiceMaterialGeometry
Definition
VP1JobConfigInfo.cxx:42
VP1JobConfigInfo::Imp::actualInit
static bool actualInit(StoreGateSvc *detStore)
Definition
VP1JobConfigInfo.cxx:145
VP1JobConfigInfo::Imp::geoModelWorld
static GeoPVConstLink geoModelWorld
Definition
VP1JobConfigInfo.cxx:35
VP1JobConfigInfo::hasTileGeometry
static bool hasTileGeometry()
Definition
VP1JobConfigInfo.cxx:137
VP1JobConfigInfo::hasTRTGeometry
static bool hasTRTGeometry()
Definition
VP1JobConfigInfo.cxx:133
VP1JobConfigInfo::hasInDetServiceMaterialGeometry
static bool hasInDetServiceMaterialGeometry()
Definition
VP1JobConfigInfo.cxx:134
VP1JobConfigInfo::hasMuonNSWGeometry
static bool hasMuonNSWGeometry()
Definition
VP1JobConfigInfo.cxx:139
VP1JobConfigInfo::hasLArGeometry
static bool hasLArGeometry()
Definition
VP1JobConfigInfo.cxx:136
VP1JobConfigInfo::hasLUCIDGeometry
static bool hasLUCIDGeometry()
Definition
VP1JobConfigInfo.cxx:140
VP1JobConfigInfo::hasBCMGeometry
static bool hasBCMGeometry()
Definition
VP1JobConfigInfo.cxx:141
VP1JobConfigInfo::hasGeoModelExperiment
static bool hasGeoModelExperiment()
Definition
VP1JobConfigInfo.cxx:128
VP1JobConfigInfo::hasPixelGeometry
static bool hasPixelGeometry()
Definition
VP1JobConfigInfo.cxx:130
VP1JobConfigInfo::hasSCTGeometry
static bool hasSCTGeometry()
Definition
VP1JobConfigInfo.cxx:132
VP1JobConfigInfo::hasHGTDGeometry
static bool hasHGTDGeometry()
Definition
VP1JobConfigInfo.cxx:131
VP1JobConfigInfo::hasCavernInfraGeometry
static bool hasCavernInfraGeometry()
Definition
VP1JobConfigInfo.cxx:142
VP1JobConfigInfo::hasITkGeometry
static bool hasITkGeometry()
Definition
VP1JobConfigInfo.cxx:129
VP1JobConfigInfo::hasMuonGeometry
static bool hasMuonGeometry()
Definition
VP1JobConfigInfo.cxx:138
VP1JobConfigInfo::hasBeamPipeGeometry
static bool hasBeamPipeGeometry()
Definition
VP1JobConfigInfo.cxx:135
VP1JobConfigInfo::geoModelWorld
static const GeoPVConstLink * geoModelWorld()
Definition
VP1JobConfigInfo.cxx:250
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition
VP1Msg.cxx:84
VP1Msg::verbose
static bool verbose()
Definition
VP1Msg.h:31
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition
VP1Msg.cxx:30
VP1Msg::messageWarningAllRed
static void messageWarningAllRed(const QString &str, IVP1System *sys=0)
Definition
VP1Msg.cxx:70
VP1SGAccessHelper
Definition
VP1SGAccessHelper.h:25
VP1SGAccessHelper::retrieve
bool retrieve(const T *&, const QString &key) const
VP1SGContentsHelper
Definition
VP1SGContentsHelper.h:26
VP1SGContentsHelper::contains
bool contains(const QString &key) const
Definition
VP1SGContentsHelper.h:61
Generated on
for ATLAS Offline Software by
1.17.0