ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MagneticField
MagFieldServices
src
AtlasFieldMapCondAlg.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// AtlasFieldMapCondAlg.h, (c) ATLAS Detector software
8
9
#ifndef MAGFIELDSERVICES_ATLASFIELDMAPCONDALG_H
10
#define MAGFIELDSERVICES_ATLASFIELDMAPCONDALG_H
11
12
// FrameWork includes
13
#include "
AthenaBaseComps/AthCondAlgorithm.h
"
14
#include "
AthenaPoolUtilities/CondAttrListCollection.h
"
15
#include "
StoreGate/ReadCondHandleKey.h
"
16
#include "
StoreGate/WriteCondHandleKey.h
"
17
18
#include "
MagFieldConditions/AtlasFieldMapCondObj.h
"
19
20
namespace
MagField
{
21
22
class
AtlasFieldMapCondAlg
:
public
AthCondAlgorithm
23
{
24
public
:
25
AtlasFieldMapCondAlg
(
const
std::string& name, ISvcLocator* pSvcLocator);
26
virtual
~AtlasFieldMapCondAlg
();
27
28
StatusCode
start
() override final;
29
StatusCode
initialize
() override final;
30
StatusCode
execute
(
const
EventContext& ctx)
const
override final;
31
32
private
:
33
/*
34
* Cache of the variables to be updated before we write the conditions object
35
*/
36
struct
Cache
37
{
38
bool
solenoidOn
() {
return
(
m_mapSoleCurrent
> 0.0); }
39
bool
toroidOn
() {
return
(
m_mapToroCurrent
> 0.0); }
40
// current associated with the map
41
double
m_mapSoleCurrent
{ 7730. };
42
double
m_mapToroCurrent
{ 20400. };
43
// field map names
44
std::string
m_fullMapFilename
{
45
"MagneticFieldMaps/bfieldmap_7730_20400_14m.root"
46
};
// all magnets on
47
std::string
m_soleMapFilename
{
48
"MagneticFieldMaps/bfieldmap_7730_0_14m.root"
49
};
// solenoid on / toroid off
50
std::string
m_toroMapFilename
{
51
"MagneticFieldMaps/bfieldmap_0_20400_14m.root"
52
};
// toroid on / solenoid off
53
// field map - pointer and event id range
54
std::unique_ptr<MagField::AtlasFieldMap>
m_fieldMap
;
55
56
//"infinite in case we do not update from COOL"
57
EventIDRange
m_mapCondObjOutputRange
{
58
EventIDRange()
59
};
// default range covers everything (run/event and timestamp)
60
};
61
62
// get the field map
63
StatusCode
updateFieldMap
(
const
EventContext& ctx, Cache& cache)
const
;
64
65
// get DCS currents to decide which field map file to read
66
StatusCode
checkCurrentFromConditions
(
const
EventContext& ctx,
67
double
& soleCurrent,
68
double
& toroCurrent,
69
EventIDRange& rangeDCS)
const
;
70
72
Gaudi::Property<std::string>
m_fullMapFilename
{
73
this
,
74
"FullMapFile"
,
75
"MagneticFieldMaps/bfieldmap_7730_20400_14m.root"
,
76
"File storing the full magnetic field map"
77
};
78
Gaudi::Property<std::string>
m_soleMapFilename
{
79
this
,
80
"SoleMapFile"
,
81
"MagneticFieldMaps/bfieldmap_7730_0_14m.root"
,
82
"File storing the solenoid-only magnetic field map"
83
};
84
Gaudi::Property<std::string>
m_toroMapFilename
{
85
this
,
86
"ToroMapFile"
,
87
"MagneticFieldMaps/bfieldmap_0_20400_14m.root"
,
88
"File storing the toroid-only magnetic field map"
89
};
90
91
Gaudi::Property<double>
m_mapSoleCurrent
{
this
,
92
"MapSoleCurrent"
,
93
7730.,
94
"Nominal solenoid current (A)"
};
95
Gaudi::Property<double>
m_mapToroCurrent
{
this
,
96
"MapToroCurrent"
,
97
20400.,
98
"Nominal toroid current (A)"
};
99
100
// threshold below which currents are considered zero
101
Gaudi::Property<double>
m_soleMinCurrent
{
102
this
,
103
"SoleMinCurrent"
,
104
1.0,
105
"Minimum solenoid current (A) for which solenoid is considered ON"
106
};
107
Gaudi::Property<double>
m_toroMinCurrent
{
108
this
,
109
"ToroMinCurrent"
,
110
1.0,
111
"Minimum toroid current (A) for which toroid is considered ON"
112
};
113
114
// flag to load map on start
115
Gaudi::Property<bool>
m_loadMapOnStart
{
116
this
,
117
"LoadMapOnStart"
,
118
false
,
119
"Load the magnetic field map at start"
120
};
121
122
// flag to read magnet map filenames from COOL
123
Gaudi::Property<bool>
m_useMapsFromCOOL
{
124
this
,
125
"UseMapsFromCOOL"
,
126
true
,
127
"Get magnetic field map filenames from COOL"
128
};
129
130
// COOL folder name containing field maps
131
// map input key
132
SG::ReadCondHandleKey<CondAttrListCollection>
m_mapsInputKey
{
133
this
,
134
"COOLMapsFolderName"
,
135
"/GLOBAL/BField/Maps"
,
136
"Name of the COOL folder containing field maps"
137
};
138
139
// AtlasFieldMapCondObj - magnet field conditions object containing the map
140
// file names
141
SG::WriteCondHandleKey<AtlasFieldMapCondObj>
m_mapCondObjOutputKey
{
142
this
,
143
"AtlasFieldMapCondObj"
,
144
"fieldMapCondObj"
,
145
"Name of key for the Magnetic Field conditions object with the map file "
146
"names"
147
};
148
149
// COOL folder name containing current information
150
// current input key
151
SG::ReadCondHandleKey<CondAttrListCollection>
m_currInputKey
{
152
this
,
153
"COOLCurrentsFolderName"
,
154
"/EXT/DCS/MAGNETS/SENSORDATA"
,
155
"Name of the COOL folder containing magnet currents"
156
};
157
158
};
159
}
160
161
#endif
//> !MAGFIELDSERVICES_ATLASFIELDMAPCONDALG_H
AthCondAlgorithm.h
Base class for conditions algorithms.
AtlasFieldMapCondObj.h
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
ReadCondHandleKey.h
WriteCondHandleKey.h
AthCondAlgorithm
Base class for conditions algorithms.
Definition
AthCondAlgorithm.h:22
MagField::AtlasFieldMapCondAlg::start
StatusCode start() override final
Definition
AtlasFieldMapCondAlg.cxx:69
MagField::AtlasFieldMapCondAlg::m_toroMapFilename
Gaudi::Property< std::string > m_toroMapFilename
Definition
AtlasFieldMapCondAlg.h:84
MagField::AtlasFieldMapCondAlg::m_mapToroCurrent
Gaudi::Property< double > m_mapToroCurrent
Definition
AtlasFieldMapCondAlg.h:95
MagField::AtlasFieldMapCondAlg::AtlasFieldMapCondAlg
AtlasFieldMapCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
AtlasFieldMapCondAlg.cxx:33
MagField::AtlasFieldMapCondAlg::checkCurrentFromConditions
StatusCode checkCurrentFromConditions(const EventContext &ctx, double &soleCurrent, double &toroCurrent, EventIDRange &rangeDCS) const
Definition
AtlasFieldMapCondAlg.cxx:424
MagField::AtlasFieldMapCondAlg::initialize
StatusCode initialize() override final
Definition
AtlasFieldMapCondAlg.cxx:41
MagField::AtlasFieldMapCondAlg::updateFieldMap
StatusCode updateFieldMap(const EventContext &ctx, Cache &cache) const
Definition
AtlasFieldMapCondAlg.cxx:131
MagField::AtlasFieldMapCondAlg::m_loadMapOnStart
Gaudi::Property< bool > m_loadMapOnStart
Definition
AtlasFieldMapCondAlg.h:115
MagField::AtlasFieldMapCondAlg::~AtlasFieldMapCondAlg
virtual ~AtlasFieldMapCondAlg()
MagField::AtlasFieldMapCondAlg::m_soleMapFilename
Gaudi::Property< std::string > m_soleMapFilename
Definition
AtlasFieldMapCondAlg.h:78
MagField::AtlasFieldMapCondAlg::m_fullMapFilename
Gaudi::Property< std::string > m_fullMapFilename
map file names - if not read from cool
Definition
AtlasFieldMapCondAlg.h:72
MagField::AtlasFieldMapCondAlg::m_mapsInputKey
SG::ReadCondHandleKey< CondAttrListCollection > m_mapsInputKey
Definition
AtlasFieldMapCondAlg.h:132
MagField::AtlasFieldMapCondAlg::m_soleMinCurrent
Gaudi::Property< double > m_soleMinCurrent
Definition
AtlasFieldMapCondAlg.h:101
MagField::AtlasFieldMapCondAlg::m_mapCondObjOutputKey
SG::WriteCondHandleKey< AtlasFieldMapCondObj > m_mapCondObjOutputKey
Definition
AtlasFieldMapCondAlg.h:141
MagField::AtlasFieldMapCondAlg::m_toroMinCurrent
Gaudi::Property< double > m_toroMinCurrent
Definition
AtlasFieldMapCondAlg.h:107
MagField::AtlasFieldMapCondAlg::m_useMapsFromCOOL
Gaudi::Property< bool > m_useMapsFromCOOL
Definition
AtlasFieldMapCondAlg.h:123
MagField::AtlasFieldMapCondAlg::m_mapSoleCurrent
Gaudi::Property< double > m_mapSoleCurrent
nominal current for the maps
Definition
AtlasFieldMapCondAlg.h:91
MagField::AtlasFieldMapCondAlg::m_currInputKey
SG::ReadCondHandleKey< CondAttrListCollection > m_currInputKey
Definition
AtlasFieldMapCondAlg.h:151
MagField::AtlasFieldMapCondAlg::execute
StatusCode execute(const EventContext &ctx) const override final
Definition
AtlasFieldMapCondAlg.cxx:82
SG::ReadCondHandleKey
Definition
ReadCondHandleKey.h:21
SG::WriteCondHandleKey
Definition
WriteCondHandleKey.h:22
const
MagField
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h).
Definition
ForwardRegionFieldSvc.h:27
MagField::AtlasFieldMapCondAlg::Cache
Definition
AtlasFieldMapCondAlg.h:37
MagField::AtlasFieldMapCondAlg::Cache::solenoidOn
bool solenoidOn()
Definition
AtlasFieldMapCondAlg.h:38
MagField::AtlasFieldMapCondAlg::Cache::m_fieldMap
std::unique_ptr< MagField::AtlasFieldMap > m_fieldMap
Definition
AtlasFieldMapCondAlg.h:54
MagField::AtlasFieldMapCondAlg::Cache::m_mapCondObjOutputRange
EventIDRange m_mapCondObjOutputRange
Definition
AtlasFieldMapCondAlg.h:57
MagField::AtlasFieldMapCondAlg::Cache::m_mapToroCurrent
double m_mapToroCurrent
Definition
AtlasFieldMapCondAlg.h:42
MagField::AtlasFieldMapCondAlg::Cache::m_fullMapFilename
std::string m_fullMapFilename
Definition
AtlasFieldMapCondAlg.h:44
MagField::AtlasFieldMapCondAlg::Cache::toroidOn
bool toroidOn()
Definition
AtlasFieldMapCondAlg.h:39
MagField::AtlasFieldMapCondAlg::Cache::m_toroMapFilename
std::string m_toroMapFilename
Definition
AtlasFieldMapCondAlg.h:50
MagField::AtlasFieldMapCondAlg::Cache::m_mapSoleCurrent
double m_mapSoleCurrent
Definition
AtlasFieldMapCondAlg.h:41
MagField::AtlasFieldMapCondAlg::Cache::m_soleMapFilename
std::string m_soleMapFilename
Definition
AtlasFieldMapCondAlg.h:47
private
#define private
Definition
testRead.cxx:27
Generated on
for ATLAS Offline Software by
1.17.0