ATLAS Offline Software
Loading...
Searching...
No Matches
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
17
20
21namespace MagField {
22
24{
25public:
26 AtlasFieldCacheCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
28
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 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
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
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
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
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.
void scaleField(Cache &cache, const MagField::AtlasFieldMap *fieldMap) const
Gaudi::Property< double > m_useSoleCurrent
Gaudi::Property< double > m_useToroCurrent
SG::WriteCondHandleKey< AtlasFieldCacheCondObj > m_condObjOutputKey
Gaudi::Property< double > m_soleMinCurrent
StatusCode updateCurrentFromConditions(const EventContext &ctx, Cache &cache) const
StatusCode updateCurrentFromParameters(const EventContext &ctx, Cache &cache) const
SG::ReadCondHandleKey< CondAttrListCollection > m_currInputKey
Gaudi::Property< double > m_toroMinCurrent
StatusCode initialize() override final
AtlasFieldCacheCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< bool > m_lockMapCurrents
SG::ReadCondHandleKey< AtlasFieldMapCondObj > m_mapCondObjInputKey
StatusCode execute(const EventContext &ctx) const override final
Map for magnetic field.
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
#define private