Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <AtlasFieldCacheCondAlg.h>
|
| AtlasFieldCacheCondAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~AtlasFieldCacheCondAlg () |
|
StatusCode | initialize () override final |
|
StatusCode | execute (const EventContext &ctx) const override final |
|
virtual bool | isReEntrant () const override final |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Definition at line 23 of file AtlasFieldCacheCondAlg.h.
◆ StoreGateSvc_t
◆ AtlasFieldCacheCondAlg()
AtlasFieldCacheCondAlg::AtlasFieldCacheCondAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~AtlasFieldCacheCondAlg()
AtlasFieldCacheCondAlg::~AtlasFieldCacheCondAlg |
( |
| ) |
|
|
virtualdefault |
◆ cardinality()
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode AtlasFieldCacheCondAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
finaloverride |
Definition at line 61 of file AtlasFieldCacheCondAlg.cxx.
70 if (writeHandle.isValid()) {
72 << writeHandle.fullKey() <<
" is already valid. "
73 <<
" May happen if multiple concurrent events are being "
74 "processed out of order.");
75 return StatusCode::SUCCESS;
91 if (mapCondObj ==
nullptr) {
92 ATH_MSG_ERROR(
"execute: Could not access conditions map for key: "
94 return StatusCode::FAILURE;
107 auto fieldCondObj = std::make_unique<AtlasFieldCacheCondObj>();
111 fieldCondObj->initialize(
112 cache.m_solScaleFactor, cache.m_torScaleFactor, fieldMap);
116 if (writeHandle.record(cache.m_condObjOutputRange, std::move(fieldCondObj))
119 "execute: Could not record AtlasFieldCacheCondObj object with "
120 << writeHandle.key() <<
" with EventRange " << cache.m_condObjOutputRange
121 <<
" into Conditions Store");
122 return StatusCode::FAILURE;
126 "execute: initialized AtlasFieldCacheCondObj and cache with SFs - sol/tor "
127 << cache.m_solScaleFactor <<
"/" << cache.m_torScaleFactor
128 <<
", EventRange " << cache.m_condObjOutputRange);
135 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.
◆ filterPassed()
◆ initialize()
StatusCode AtlasFieldCacheCondAlg::initialize |
( |
| ) |
|
|
finaloverride |
Definition at line 35 of file AtlasFieldCacheCondAlg.cxx.
47 <<
" has been succesfully registered ");
50 (
m_useDCS ?
"conditions" :
"parameters"));
52 ATH_MSG_INFO(
"Initialize: useDCS, useSoleCurrent, useToroCurrent. "
57 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ isClonable()
◆ isReEntrant()
virtual bool MagField::AtlasFieldCacheCondAlg::isReEntrant |
( |
| ) |
const |
|
inlinefinaloverridevirtual |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ scaleField()
Definition at line 286 of file AtlasFieldCacheCondAlg.cxx.
296 bool mapHasToroid = fieldMap && (fieldMap->
toroidCurrent()>0);
302 if (cache.m_solenoidCurrent > 0.0) {
303 if (mapHasSolenoid &&
304 std::abs(cache.m_solenoidCurrent / fieldMap->
solenoidCurrent() - 1.0) >
306 cache.m_solScaleFactor =
310 << cache.m_solScaleFactor
311 <<
". Desired current and map current: "
312 << cache.m_solenoidCurrent <<
","
317 cache.m_solScaleFactor = 0;
319 << cache.m_solScaleFactor
320 <<
". Desired current and map current: "
321 << cache.m_solenoidCurrent <<
","
327 if (cache.m_toroidCurrent > 0.0) {
329 std::abs(cache.m_toroidCurrent / fieldMap->
toroidCurrent() - 1.0) >
332 cache.m_torScaleFactor =
336 << cache.m_torScaleFactor
337 <<
". Desired current and map current: "
338 << cache.m_toroidCurrent <<
","
341 cache.m_torScaleFactor = 0;
343 << cache.m_torScaleFactor
344 <<
". Desired current and map current: "
345 << cache.m_toroidCurrent <<
","
350 if (mapHasToroid && !mapHasSolenoid) {
351 cache.m_solScaleFactor = cache.m_torScaleFactor;
355 if (!mapHasToroid && mapHasSolenoid) {
356 cache.m_torScaleFactor = cache.m_solScaleFactor;
◆ setFilterPassed()
◆ sysExecute()
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.
◆ sysInitialize()
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.
Reimplemented in InputMakerBase, and HypoBase.
Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateCurrentFromConditions()
StatusCode AtlasFieldCacheCondAlg::updateCurrentFromConditions |
( |
const EventContext & |
ctx, |
|
|
Cache & |
cache |
|
) |
| const |
|
private |
Definition at line 139 of file AtlasFieldCacheCondAlg.cxx.
147 if (attrListColl ==
nullptr) {
148 ATH_MSG_ERROR(
"updateCurrentFromConditions: Failed to retrieve "
149 "CondAttributeListCollection with key "
151 return StatusCode::FAILURE;
156 if (!readHandle.range(rangeW)) {
158 "updateCurrentFromConditions: Failed to retrieve validity range for "
159 << readHandle.key());
160 return StatusCode::FAILURE;
162 cache.m_condObjOutputRange = rangeW;
163 ATH_MSG_INFO(
"UpdateCurrentFromConditions: Range of input/output is "
164 << cache.m_condObjOutputRange);
169 bool gotsol{
false };
170 bool gottor{
false };
177 bool hasChanNames{
false };
178 ATH_MSG_INFO(
"UpdateCurrentFromConditions: Attempt 1 at reading currents "
179 "from DCS (using channel name)");
181 itr != attrListColl->end();
183 const std::string&
name = attrListColl->chanName(itr->first);
184 ATH_MSG_INFO(
"UpdateCurrentFromConditions: Trying to read from DCS: "
185 "[channel name, index, value] "
186 <<
name <<
" , " << itr->first <<
" , "
187 << itr->second[
"value"].data<
float>());
188 if (
name.compare(
"") != 0) {
191 if (
name.compare(
"CentralSol_Current") == 0) {
193 solcur = itr->second[
"value"].data<
float>();
195 }
else if (
name.compare(
"Toroids_Current") == 0) {
197 torcur = itr->second[
"value"].data<
float>();
202 ATH_MSG_INFO(
"UpdateCurrentFromConditions: Attempt 2 at reading currents "
203 "from DCS (using channel index)");
206 itr != attrListColl->end();
209 if (itr->first == 1) {
211 solcur = itr->second[
"value"].data<
float>();
213 }
else if (itr->first == 3) {
215 torcur = itr->second[
"value"].data<
float>();
220 if (!gotsol || !gottor) {
222 ATH_MSG_ERROR(
"UpdateCurrentFromConditions: Missing solenoid current in "
225 ATH_MSG_ERROR(
"UpdateCurrentFromConditions: Missing toroid current in "
227 return StatusCode::FAILURE;
230 ATH_MSG_INFO(
"UpdateCurrentFromConditions: Currents read from DCS - solenoid "
231 << solcur <<
" toroid " << torcur);
236 ATH_MSG_INFO(
"UpdateCurrentFromConditions: Solenoid is off");
240 ATH_MSG_INFO(
"UpdateCurrentFromConditions: Toroids are off");
243 cache.m_solenoidCurrent = solcur;
244 cache.m_toroidCurrent = torcur;
246 return StatusCode::SUCCESS;
◆ updateCurrentFromParameters()
StatusCode AtlasFieldCacheCondAlg::updateCurrentFromParameters |
( |
const EventContext & |
ctx, |
|
|
Cache & |
cache |
|
) |
| const |
|
private |
Definition at line 250 of file AtlasFieldCacheCondAlg.cxx.
260 ATH_MSG_INFO(
"updateCurrentFromParameters: Solenoid is off");
264 ATH_MSG_INFO(
"updateCurrentFromParameters: Toroids are off");
266 cache.m_solenoidCurrent = solcur;
267 cache.m_toroidCurrent = torcur;
272 start.set_run_number(ctx.eventID().run_number());
273 start.set_lumi_block(0);
274 stop.set_run_number(ctx.eventID().run_number() + 1);
275 stop.set_lumi_block(0);
276 cache.m_condObjOutputRange = EventIDRange(
start,
stop);
278 ATH_MSG_INFO(
"updateCurrentFromParameters: Update from job options: Range of "
280 << cache.m_condObjOutputRange);
282 return StatusCode::SUCCESS;
◆ updateVHKA()
◆ m_condObjOutputKey
Initial value:{
this,
"AtlasFieldCacheCondObj",
"fieldCondObj",
"Name of the key for the Magnetic Field conditions object with currents "
"for scaling"
}
Definition at line 106 of file AtlasFieldCacheCondAlg.h.
◆ m_currInputKey
Initial value:{
this,
"COOLCurrentsFolderName",
"/EXT/DCS/MAGNETS/SENSORDATA",
"Name of the COOL folder containing magnet currents"
}
Definition at line 87 of file AtlasFieldCacheCondAlg.h.
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 114 of file AthCommonReentrantAlgorithm.h.
◆ m_lockMapCurrents
Gaudi::Property<bool> MagField::AtlasFieldCacheCondAlg::m_lockMapCurrents |
|
private |
Initial value:{
this,
"LockMapCurrents",
false,
"Skip current rescale and use map currents as they are"
}
Definition at line 78 of file AtlasFieldCacheCondAlg.h.
◆ m_mapCondObjInputKey
Initial value:{
this,
"AtlasFieldMapCondObj",
"fieldMapCondObj",
"Name of key for the Magnetic Field conditions object with the map file "
"names"
}
Definition at line 96 of file AtlasFieldCacheCondAlg.h.
◆ m_soleMinCurrent
Gaudi::Property<double> MagField::AtlasFieldCacheCondAlg::m_soleMinCurrent |
|
private |
Initial value:{
this,
"SoleMinCurrent",
1.0,
"Minimum solenoid current (A) for which solenoid is considered ON"
}
Definition at line 56 of file AtlasFieldCacheCondAlg.h.
◆ m_toroMinCurrent
Gaudi::Property<double> MagField::AtlasFieldCacheCondAlg::m_toroMinCurrent |
|
private |
Initial value:{
this,
"ToroMinCurrent",
1.0,
"Minimum toroid current (A) for which toroid is considered ON"
}
Definition at line 62 of file AtlasFieldCacheCondAlg.h.
◆ m_useDCS
Gaudi::Property<bool> MagField::AtlasFieldCacheCondAlg::m_useDCS |
|
private |
Initial value:{
this,
"UseDCS",
false,
"Get magnet currents from DCS through ConditionsSvc"
}
Definition at line 70 of file AtlasFieldCacheCondAlg.h.
◆ m_useSoleCurrent
Gaudi::Property<double> MagField::AtlasFieldCacheCondAlg::m_useSoleCurrent |
|
private |
Initial value:{ this,
"UseSoleCurrent",
7730.,
"Set actual solenoid current (A)" }
Definition at line 115 of file AtlasFieldCacheCondAlg.h.
◆ m_useToroCurrent
Gaudi::Property<double> MagField::AtlasFieldCacheCondAlg::m_useToroCurrent |
|
private |
Initial value:{ this,
"UseToroCurrent",
20400.,
"Set actual toroid current (A)" }
Definition at line 119 of file AtlasFieldCacheCondAlg.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
void scaleField(Cache &cache, const MagField::AtlasFieldMap *fieldMap) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Gaudi::Property< double > m_toroMinCurrent
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Gaudi::Property< bool > m_lockMapCurrents
const std::string & key() const
Return the StoreGate ID for the referenced object.
This class is a collection of AttributeLists where each one is associated with a channel number....
SG::ReadCondHandleKey< CondAttrListCollection > m_currInputKey
virtual void setOwner(IDataHandleHolder *o)=0
An algorithm that can be simultaneously executed in multiple threads.
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Gaudi::Property< bool > m_useDCS
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
SG::ReadCondHandleKey< AtlasFieldMapCondObj > m_mapCondObjInputKey
Gaudi::Property< double > m_useToroCurrent
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
float toroidCurrent() const
Gaudi::Property< double > m_soleMinCurrent
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Gaudi::Property< double > m_useSoleCurrent
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
StatusCode initialize(bool used=true)
SG::WriteCondHandleKey< AtlasFieldCacheCondObj > m_condObjOutputKey
StatusCode updateCurrentFromParameters(const EventContext &ctx, Cache &cache) const
#define ATH_MSG_WARNING(x)
ChanAttrListMap::const_iterator const_iterator
int solenoidZoneId() const
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode sysInitialize() override
Override sysInitialize.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StatusCode updateCurrentFromConditions(const EventContext &ctx, Cache &cache) const
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
float solenoidCurrent() const