Loading [MathJax]/jax/input/TeX/config.js
 |
ATLAS Offline Software
|
MuonAlignmentErrorDbAlg reads raw condition data and writes derived condition data (MuonAlignmentErrorData) to the condition store.
More...
#include <MuonAlignmentErrorDbAlg.h>
|
| MuonAlignmentErrorDbAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
| ~MuonAlignmentErrorDbAlg () override=default |
|
StatusCode | initialize () override |
|
StatusCode | execute (const EventContext &ctx) const override |
|
bool | isReEntrant () const override |
|
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 |
|
MuonAlignmentErrorDbAlg reads raw condition data and writes derived condition data (MuonAlignmentErrorData) to the condition store.
Definition at line 23 of file MuonAlignmentErrorDbAlg.h.
◆ StoreGateSvc_t
◆ MuonAlignmentErrorDbAlg()
MuonAlignmentErrorDbAlg::MuonAlignmentErrorDbAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~MuonAlignmentErrorDbAlg()
MuonAlignmentErrorDbAlg::~MuonAlignmentErrorDbAlg |
( |
| ) |
|
|
overridedefault |
◆ 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 MuonAlignmentErrorDbAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
override |
Definition at line 24 of file MuonAlignmentErrorDbAlg.cxx.
30 if (writeHandle.isValid()) {
31 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
32 <<
". In theory this should not be called, but may happen"
33 <<
" if multiple concurrent events are being processed out of order.");
34 return StatusCode::SUCCESS;
36 std::unique_ptr<MuonAlignmentErrorData> writeCdo{std::make_unique<MuonAlignmentErrorData>()};
38 std::string clobContent;
42 if (clobContent.empty()) {
44 return StatusCode::FAILURE;
47 std::istringstream indata(clobContent);
50 return StatusCode::FAILURE;
57 std::vector<MuonAlignmentErrorData::MuonAlignmentErrorRule> MuonAlignmentErrorRuleVec;
59 while (getline(indata,
line)) {
61 if (
line.compare(0, 1,
"#") == 0) {
68 std::string name_sstring(
"");
69 std::string multilayer_sstring(
"");
70 double translation(0.);
74 if (
line.compare(0, 7,
"version") == 0) {
75 std::string clobVersion;
76 std::istringstream(
line) >>
flag >> clobVersion;
77 ATH_MSG_INFO(
"*****************************************");
79 ATH_MSG_INFO(
"*****************************************");
80 writeCdo->setClobVersion(std::move(clobVersion));
85 if (
line.compare(0, 12,
"has_nsw_hits") == 0) {
86 bool hasNswHits{
false};
87 std::istringstream(
line) >>
flag >> hasNswHits;
88 writeCdo->setHasNswHits(hasNswHits);
95 if (std::istringstream(
line) >>
flag >> name_sstring >> multilayer_sstring >> translation >>
rotation) {
105 MuonAlignmentErrorRuleVec.emplace_back(std::move(aDev));
111 std::vector<MuonAlignmentErrorData::MuonAlignmentErrorRuleCache> MuonAlignmentErrorRuleCacheVec;
115 if (writeCdo->hasNswHits() == 1){
143 MuonAlignmentErrorRuleCacheVec.emplace_back(std::move(aDev_cache));
144 if (MuonAlignmentErrorRuleVec.empty()) {
146 return StatusCode::FAILURE;
149 writeCdo->setAlignmentErrorRules(std::move(MuonAlignmentErrorRuleVec));
150 writeCdo->setMuonAlignmentErrorRuleCache(std::move(MuonAlignmentErrorRuleCacheVec));
152 if (writeHandle.record(rangeW, std::move(writeCdo)).isFailure()) {
153 ATH_MSG_FATAL(
"Could not record MuonAlignmentErrorData " << writeHandle.key() <<
" with EventRange " << rangeW
154 <<
" into Conditions Store");
155 return StatusCode::FAILURE;
157 ATH_MSG_INFO(
"recorded new " << writeHandle.key() <<
" with range " << rangeW <<
" into Conditions Store");
159 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()
◆ generateMap()
Definition at line 162 of file MuonAlignmentErrorDbAlg.cxx.
166 for(
auto itr = helper_obj.detectorElement_begin(); itr!= helper_obj.detectorElement_end(); ++itr){
169 if (!calibId.
isValid())
continue;
173 }
else if (calibId.
is_mmg()) {
175 }
else if (calibId.
is_stg()) {
182 for (
auto& iDev : devVec){
183 if (!boost::regex_match(alignStationName, iDev.stationName)) {
187 if (!boost::regex_match(multilayerName, iDev.multilayer)) {
◆ getDbClobContent()
std::tuple< std::string, EventIDRange > MuonAlignmentErrorDbAlg::getDbClobContent |
( |
const EventContext & |
ctx | ) |
const |
|
private |
Definition at line 197 of file MuonAlignmentErrorDbAlg.cxx.
203 if (readCdo ==
nullptr) {
205 return std::make_tuple(std::string(), EventIDRange());
209 if (!readHandle.range(rangeW)) {
210 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << readHandle.key());
211 return std::make_tuple(std::string(), EventIDRange());
214 ATH_MSG_INFO(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
219 std::string clobContent, dbClobVersion;
221 for (itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
223 clobContent = *(
static_cast<const std::string*
>((atr[
"syserrors"]).addressOfData()));
224 dbClobVersion = *(
static_cast<const std::string*
>((atr[
"version"]).addressOfData()));
226 return std::make_tuple(std::move(clobContent), rangeW);
◆ getFileClobContent()
std::tuple< std::string, EventIDRange > MuonAlignmentErrorDbAlg::getFileClobContent |
( |
| ) |
const |
|
private |
◆ hardwareEta()
Definition at line 303 of file MuonAlignmentErrorDbAlg.cxx.
308 if (
sector(calibId)==13) {
309 switch (calibId.
eta()) {
318 return calibId.
eta();
323 if (
sector(calibId)==13) {
324 if (calibId.
eta()== 7)
return 1;
325 if (calibId.
eta()==-7)
return -1;
327 return calibId.
eta();
331 return calibId.
eta()>0 ? calibId.
eta()*2-1 : calibId.
eta()*2+1;
334 return calibId.
eta()*2;
335 case StationName::EIL:
338 switch (calibId.
eta()) {
346 return calibId.
eta();
348 case StationName::EEL:
351 if ((
sector(calibId) == 5) && (calibId.
eta() == 1))
return 2;
352 if ((
sector(calibId) == 5) && (calibId.
eta() == -1))
return -2;
353 return calibId.
eta();
355 default:
return calibId.
eta();
◆ hardwareName()
◆ initialize()
StatusCode MuonAlignmentErrorDbAlg::initialize |
( |
| ) |
|
|
override |
◆ 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()
bool MuonAlignmentErrorDbAlg::isReEntrant |
( |
| ) |
const |
|
inlineoverride |
◆ isSmallSector()
Definition at line 279 of file MuonAlignmentErrorDbAlg.cxx.
289 case StationName::EES:
290 case StationName::EMS:
291 case StationName::EOS:
292 case StationName::EIS:
294 case StationName::BMG:
295 case StationName::MMS:
296 case StationName::STS:
◆ 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()
◆ sector()
◆ sectorString()
◆ setFilterPassed()
◆ side()
◆ 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.
◆ updateVHKA()
◆ m_clobFileOverride
Gaudi::Property<std::string> MuonAlignmentErrorDbAlg::m_clobFileOverride |
|
private |
Initial value:{this, "clobFileOverride", "",
"Set this to the location of a CLOB file to override the DB setting"}
Definition at line 42 of file MuonAlignmentErrorDbAlg.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_idHelperSvc
◆ m_idTool
◆ m_readKey
Initial value:{this, "ReadKey", "/MUONALIGN/ERRS",
"Key of input muon alignment error condition data"}
Definition at line 38 of file MuonAlignmentErrorDbAlg.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeKey
Initial value:{this, "WriteKey", "MuonAlignmentErrorData",
"Key of output muon alignment error condition data"}
Definition at line 40 of file MuonAlignmentErrorDbAlg.h.
The documentation for this class was generated from the following files:
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey
int mmgMultilayer() const
Mmg specific:
ToolHandle< MuonCalib::IIdToFixedIdTool > m_idTool
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StationName
an enum with the station names
@ BEE
BEE measurement point.
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)
bool isValid() const
check validity of the identifier.
int hardwareEta(MuonCalib::MuonFixedLongId calibId) const
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
int sector(MuonCalib::MuonFixedLongId calibId) const
std::tuple< std::string, EventIDRange > getDbClobContent(const EventContext &ctx) const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
This class is a collection of AttributeLists where each one is associated with a channel number....
virtual void setOwner(IDataHandleHolder *o)=0
An algorithm that can be simultaneously executed in multiple threads.
int stgMultilayer() const
Stg specific:
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
std::string_view stationNameString() const
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
void generateMap(const auto &helper_obj, const auto &idTool, MuonAlignmentErrorData::MuonAlignmentErrorRuleCache &adev_new, std::vector< MuonAlignmentErrorData::MuonAlignmentErrorRule > &devVec) const
SG::WriteCondHandleKey< MuonAlignmentErrorData > m_writeKey
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::unordered_multimap< Identifier, MuonAlignmentErrorRuleIndex > id_rule_map
For each multilayer identifier, cache the indices of the affecting rules.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::string_view side(MuonCalib::MuonFixedLongId calibId) const
std::string to_string(const DetectorType &type)
size_t MuonAlignmentErrorRuleIndex
StatusCode initialize(bool used=true)
std::tuple< std::string, EventIDRange > getFileClobContent() const
std::string hardwareName(MuonCalib::MuonFixedLongId calibId) const
StationName stationName() const
#define ATH_MSG_WARNING(x)
ChanAttrListMap::const_iterator const_iterator
int mdtMultilayer() const
Mdt specific:
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode sysInitialize() override
Override sysInitialize.
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
Gaudi::Property< std::string > m_clobFileOverride
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::string sectorString(MuonCalib::MuonFixedLongId calibId) const
bool isSmallSector(MuonCalib::MuonFixedLongId calibId) const