ATLAS Offline Software
Loading...
Searching...
No Matches
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
17
19
20namespace MagField {
21
23{
24public:
25 AtlasFieldMapCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
27
28 StatusCode start() override final;
29 StatusCode initialize() override final;
30 StatusCode execute(const EventContext& ctx) const override final;
31
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"
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
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
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
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
Base class for conditions algorithms.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
Base class for conditions algorithms.
StatusCode start() override final
Gaudi::Property< std::string > m_toroMapFilename
Gaudi::Property< double > m_mapToroCurrent
AtlasFieldMapCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode checkCurrentFromConditions(const EventContext &ctx, double &soleCurrent, double &toroCurrent, EventIDRange &rangeDCS) const
StatusCode initialize() override final
StatusCode updateFieldMap(const EventContext &ctx, Cache &cache) const
Gaudi::Property< bool > m_loadMapOnStart
Gaudi::Property< std::string > m_soleMapFilename
Gaudi::Property< std::string > m_fullMapFilename
map file names - if not read from cool
SG::ReadCondHandleKey< CondAttrListCollection > m_mapsInputKey
Gaudi::Property< double > m_soleMinCurrent
SG::WriteCondHandleKey< AtlasFieldMapCondObj > m_mapCondObjOutputKey
Gaudi::Property< double > m_toroMinCurrent
Gaudi::Property< bool > m_useMapsFromCOOL
Gaudi::Property< double > m_mapSoleCurrent
nominal current for the maps
SG::ReadCondHandleKey< CondAttrListCollection > m_currInputKey
StatusCode execute(const EventContext &ctx) const override final
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
std::unique_ptr< MagField::AtlasFieldMap > m_fieldMap
#define private