ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MagneticField
MagFieldServices
src
AtlasFieldCacheCondAlg.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
// AtlasFieldCacheCondAlg.h, (c) ATLAS Detector software
8
9
#ifndef MAGFIELDSERVICES_ATLASFIELDCACHECONDALG_H
10
#define MAGFIELDSERVICES_ATLASFIELDCACHECONDALG_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/AtlasFieldCacheCondObj.h
"
19
#include "
MagFieldConditions/AtlasFieldMapCondObj.h
"
20
21
namespace
MagField
{
22
23
class
AtlasFieldCacheCondAlg
:
public
AthCondAlgorithm
24
{
25
public
:
26
AtlasFieldCacheCondAlg
(
const
std::string& name, ISvcLocator* pSvcLocator);
27
virtual
~AtlasFieldCacheCondAlg
();
28
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
float
m_solenoidCurrent
{ 0 };
// solenoid current in ampere
39
float
m_toroidCurrent
{ 0 };
// toroid current in ampere
40
double
m_solScaleFactor
{ 1 };
// solenoid current scale factor
41
double
m_torScaleFactor
{ 1 };
// toroid current scale factor
42
43
//"infinite in case we do not update from DCS" - full run/event range
44
EventIDRange
m_condObjOutputRange
{ EventIDRange(
45
EventIDBase(0, 0),
46
EventIDBase(EventIDBase::UNDEFNUM - 1, EventIDBase::UNDEFEVT - 1)) };
47
};
48
StatusCode
updateCurrentFromConditions
(
const
EventContext& ctx,
49
Cache& cache)
const
;
50
StatusCode
updateCurrentFromParameters
(
const
EventContext& ctx,
51
Cache& cache)
const
;
52
void
scaleField
(Cache& cache,
const
MagField::AtlasFieldMap
* fieldMap)
const
;
53
54
// threshold below which currents are considered zero
55
Gaudi::Property<double>
m_soleMinCurrent
{
56
this
,
57
"SoleMinCurrent"
,
58
1.0,
59
"Minimum solenoid current (A) for which solenoid is considered ON"
60
};
61
Gaudi::Property<double>
m_toroMinCurrent
{
62
this
,
63
"ToroMinCurrent"
,
64
1.0,
65
"Minimum toroid current (A) for which toroid is considered ON"
66
};
67
68
// flag to use magnet current from DCS in COOL
69
Gaudi::Property<bool>
m_useDCS
{
70
this
,
71
"UseDCS"
,
72
false
,
73
"Get magnet currents from DCS through ConditionsSvc"
74
};
75
76
// flag to skip current rescale and use map currents as they are
77
Gaudi::Property<bool>
m_lockMapCurrents
{
78
this
,
79
"LockMapCurrents"
,
80
false
,
81
"Skip current rescale and use map currents as they are"
82
};
83
84
// COOL folder name containing current information
85
// current input key
86
SG::ReadCondHandleKey<CondAttrListCollection>
m_currInputKey
{
87
this
,
88
"COOLCurrentsFolderName"
,
89
"/EXT/DCS/MAGNETS/SENSORDATA"
,
90
"Name of the COOL folder containing magnet currents"
91
};
92
93
// AtlasFieldMapCondObj - read handle to access magnet field conditions object
94
// containing the map file names
95
SG::ReadCondHandleKey<AtlasFieldMapCondObj>
m_mapCondObjInputKey
{
96
this
,
97
"AtlasFieldMapCondObj"
,
98
"fieldMapCondObj"
,
99
"Name of key for the Magnetic Field conditions object with the map file "
100
"names"
101
};
102
103
// AtlasFieldCacheCondObj - magnet field conditions object containing the
104
// current scale factors
105
SG::WriteCondHandleKey<AtlasFieldCacheCondObj>
m_condObjOutputKey
{
106
this
,
107
"AtlasFieldCacheCondObj"
,
108
"fieldCondObj"
,
109
"Name of the key for the Magnetic Field conditions object with currents "
110
"for scaling"
111
};
112
113
// actual current if DCS is not in use
114
Gaudi::Property<double>
m_useSoleCurrent
{
this
,
115
"UseSoleCurrent"
,
116
7730.,
117
"Set actual solenoid current (A)"
};
118
Gaudi::Property<double>
m_useToroCurrent
{
this
,
119
"UseToroCurrent"
,
120
20400.,
121
"Set actual toroid current (A)"
};
122
};
123
}
124
125
#endif
//> !MAGFIELDSERVICES_ATLASFIELDCACHECONDALG_H
AthCondAlgorithm.h
Base class for conditions algorithms.
AtlasFieldCacheCondObj.h
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::AtlasFieldCacheCondAlg::~AtlasFieldCacheCondAlg
virtual ~AtlasFieldCacheCondAlg()
MagField::AtlasFieldCacheCondAlg::scaleField
void scaleField(Cache &cache, const MagField::AtlasFieldMap *fieldMap) const
Definition
AtlasFieldCacheCondAlg.cxx:286
MagField::AtlasFieldCacheCondAlg::m_useSoleCurrent
Gaudi::Property< double > m_useSoleCurrent
Definition
AtlasFieldCacheCondAlg.h:114
MagField::AtlasFieldCacheCondAlg::m_useToroCurrent
Gaudi::Property< double > m_useToroCurrent
Definition
AtlasFieldCacheCondAlg.h:118
MagField::AtlasFieldCacheCondAlg::m_condObjOutputKey
SG::WriteCondHandleKey< AtlasFieldCacheCondObj > m_condObjOutputKey
Definition
AtlasFieldCacheCondAlg.h:105
MagField::AtlasFieldCacheCondAlg::m_soleMinCurrent
Gaudi::Property< double > m_soleMinCurrent
Definition
AtlasFieldCacheCondAlg.h:55
MagField::AtlasFieldCacheCondAlg::updateCurrentFromConditions
StatusCode updateCurrentFromConditions(const EventContext &ctx, Cache &cache) const
Definition
AtlasFieldCacheCondAlg.cxx:139
MagField::AtlasFieldCacheCondAlg::updateCurrentFromParameters
StatusCode updateCurrentFromParameters(const EventContext &ctx, Cache &cache) const
Definition
AtlasFieldCacheCondAlg.cxx:250
MagField::AtlasFieldCacheCondAlg::m_currInputKey
SG::ReadCondHandleKey< CondAttrListCollection > m_currInputKey
Definition
AtlasFieldCacheCondAlg.h:86
MagField::AtlasFieldCacheCondAlg::m_toroMinCurrent
Gaudi::Property< double > m_toroMinCurrent
Definition
AtlasFieldCacheCondAlg.h:61
MagField::AtlasFieldCacheCondAlg::m_useDCS
Gaudi::Property< bool > m_useDCS
Definition
AtlasFieldCacheCondAlg.h:69
MagField::AtlasFieldCacheCondAlg::initialize
StatusCode initialize() override final
Definition
AtlasFieldCacheCondAlg.cxx:35
MagField::AtlasFieldCacheCondAlg::AtlasFieldCacheCondAlg
AtlasFieldCacheCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
AtlasFieldCacheCondAlg.cxx:26
MagField::AtlasFieldCacheCondAlg::m_lockMapCurrents
Gaudi::Property< bool > m_lockMapCurrents
Definition
AtlasFieldCacheCondAlg.h:77
MagField::AtlasFieldCacheCondAlg::m_mapCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldMapCondObj > m_mapCondObjInputKey
Definition
AtlasFieldCacheCondAlg.h:95
MagField::AtlasFieldCacheCondAlg::execute
StatusCode execute(const EventContext &ctx) const override final
Definition
AtlasFieldCacheCondAlg.cxx:61
MagField::AtlasFieldMap
Map for magnetic field.
Definition
AtlasFieldMap.h:39
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::AtlasFieldCacheCondAlg::Cache
Definition
AtlasFieldCacheCondAlg.h:37
MagField::AtlasFieldCacheCondAlg::Cache::m_solScaleFactor
double m_solScaleFactor
Definition
AtlasFieldCacheCondAlg.h:40
MagField::AtlasFieldCacheCondAlg::Cache::m_solenoidCurrent
float m_solenoidCurrent
Definition
AtlasFieldCacheCondAlg.h:38
MagField::AtlasFieldCacheCondAlg::Cache::m_condObjOutputRange
EventIDRange m_condObjOutputRange
Definition
AtlasFieldCacheCondAlg.h:44
MagField::AtlasFieldCacheCondAlg::Cache::m_torScaleFactor
double m_torScaleFactor
Definition
AtlasFieldCacheCondAlg.h:41
MagField::AtlasFieldCacheCondAlg::Cache::m_toroidCurrent
float m_toroidCurrent
Definition
AtlasFieldCacheCondAlg.h:39
private
#define private
Definition
testRead.cxx:27
Generated on
for ATLAS Offline Software by
1.17.0