|
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()
unsigned int AthReentrantAlgorithm::cardinality |
( |
| ) |
const |
|
overridevirtualinherited |
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 55 of file AthReentrantAlgorithm.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 23 of file MuonAlignmentErrorDbAlg.cxx.
29 if (writeHandle.isValid()) {
30 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
31 <<
". In theory this should not be called, but may happen"
32 <<
" if multiple concurrent events are being processed out of order.");
33 return StatusCode::SUCCESS;
35 std::unique_ptr<MuonAlignmentErrorData> writeCdo{std::make_unique<MuonAlignmentErrorData>()};
37 std::string clobContent;
41 if (clobContent.empty()) {
43 return StatusCode::FAILURE;
46 std::istringstream indata(clobContent);
49 return StatusCode::FAILURE;
56 std::vector<MuonAlignmentErrorData::MuonAlignmentErrorRule> MuonAlignmentErrorRuleVec;
58 while (getline(indata,
line)) {
60 if (
line.compare(0, 1,
"#") == 0) {
67 std::string name_sstring(
"");
68 std::string multilayer_sstring(
"");
69 double translation(0.);
73 if (
line.compare(0, 7,
"version") == 0) {
74 std::string clobVersion;
75 std::istringstream(
line) >>
flag >> clobVersion;
76 ATH_MSG_INFO(
"*****************************************");
78 ATH_MSG_INFO(
"*****************************************");
79 writeCdo->setClobVersion(std::move(clobVersion));
84 if (
line.compare(0, 12,
"has_nsw_hits") == 0) {
85 bool hasNswHits{
false};
86 std::istringstream(
line) >>
flag >> hasNswHits;
87 writeCdo->setHasNswHits(hasNswHits);
94 if (std::istringstream(
line) >>
flag >> name_sstring >> multilayer_sstring >> translation >>
rotation) {
104 MuonAlignmentErrorRuleVec.emplace_back(std::move(aDev));
110 std::vector<MuonAlignmentErrorData::MuonAlignmentErrorRuleCache> MuonAlignmentErrorRuleCacheVec;
114 if (writeCdo->hasNswHits() == 1){
142 MuonAlignmentErrorRuleCacheVec.emplace_back(std::move(aDev_cache));
143 if (MuonAlignmentErrorRuleVec.empty()) {
145 return StatusCode::FAILURE;
148 writeCdo->setAlignmentErrorRules(std::move(MuonAlignmentErrorRuleVec));
149 writeCdo->setMuonAlignmentErrorRuleCache(std::move(MuonAlignmentErrorRuleCacheVec));
151 if (writeHandle.record(rangeW, std::move(writeCdo)).isFailure()) {
152 ATH_MSG_FATAL(
"Could not record MuonAlignmentErrorData " << writeHandle.key() <<
" with EventRange " << rangeW
153 <<
" into Conditions Store");
154 return StatusCode::FAILURE;
156 ATH_MSG_INFO(
"recorded new " << writeHandle.key() <<
" with range " << rangeW <<
" into Conditions Store");
158 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()
const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 79 of file AthReentrantAlgorithm.cxx.
86 return Algorithm::extraOutputDeps();
◆ filterPassed()
virtual bool AthReentrantAlgorithm::filterPassed |
( |
const EventContext & |
ctx | ) |
const |
|
inlinevirtualinherited |
◆ generateMap()
Definition at line 161 of file MuonAlignmentErrorDbAlg.cxx.
165 for(
auto itr = helper_obj.detectorElement_begin(); itr!= helper_obj.detectorElement_end(); ++itr){
168 if (!calibId.
isValid())
continue;
172 }
else if (calibId.
is_mmg()) {
174 }
else if (calibId.
is_stg()) {
181 for (
auto& iDev : devVec){
182 if (!boost::regex_match(alignStationName, iDev.stationName)) {
186 if (!boost::regex_match(multilayerName, iDev.multilayer)) {
◆ getDbClobContent()
std::tuple< std::string, EventIDRange > MuonAlignmentErrorDbAlg::getDbClobContent |
( |
const EventContext & |
ctx | ) |
const |
|
private |
Definition at line 196 of file MuonAlignmentErrorDbAlg.cxx.
202 if (readCdo ==
nullptr) {
204 return std::make_tuple(std::string(), EventIDRange());
208 if (!readHandle.range(rangeW)) {
209 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << readHandle.key());
210 return std::make_tuple(std::string(), EventIDRange());
213 ATH_MSG_INFO(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
218 std::string clobContent, dbClobVersion;
220 for (itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
222 clobContent = *(
static_cast<const std::string*
>((atr[
"syserrors"]).addressOfData()));
223 dbClobVersion = *(
static_cast<const std::string*
>((atr[
"version"]).addressOfData()));
225 return std::make_tuple(std::move(clobContent), rangeW);
◆ getFileClobContent()
std::tuple< std::string, EventIDRange > MuonAlignmentErrorDbAlg::getFileClobContent |
( |
| ) |
const |
|
private |
◆ hardwareEta()
Definition at line 302 of file MuonAlignmentErrorDbAlg.cxx.
307 if (
sector(calibId)==13) {
308 switch (calibId.
eta()) {
317 return calibId.
eta();
322 if (
sector(calibId)==13) {
323 if (calibId.
eta()== 7)
return 1;
324 if (calibId.
eta()==-7)
return -1;
326 return calibId.
eta();
330 return calibId.
eta()>0 ? calibId.
eta()*2-1 : calibId.
eta()*2+1;
333 return calibId.
eta()*2;
334 case StationName::EIL:
337 switch (calibId.
eta()) {
345 return calibId.
eta();
347 case StationName::EEL:
350 if ((
sector(calibId) == 5) && (calibId.
eta() == 1))
return 2;
351 if ((
sector(calibId) == 5) && (calibId.
eta() == -1))
return -2;
352 return calibId.
eta();
354 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()
bool AthReentrantAlgorithm::isClonable |
( |
| ) |
const |
|
overridevirtualinherited |
Specify if the algorithm is clonable.
Reentrant algorithms are clonable.
Reimplemented in Simulation::BeamEffectsAlg, InDet::SiTrackerSpacePointFinder, InDet::SCT_Clusterization, InDet::SiSPSeededTrackFinder, SCTRawDataProvider, InDet::GNNSeedingTrackMaker, SCT_PrepDataToxAOD, RoIBResultToxAOD, SCT_CablingCondAlgFromCoraCool, SCT_ReadCalibDataTestAlg, SCT_CablingCondAlgFromText, InDet::SiSPGNNTrackMaker, SCT_ReadCalibChipDataTestAlg, SCT_TestCablingAlg, SCT_ConfigurationConditionsTestAlg, ITkPixelCablingAlg, ITkStripCablingAlg, SCTEventFlagWriter, SCT_ConditionsSummaryTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_TdaqEnabledTestAlg, SCT_SiliconConditionsTestAlg, SCTSiLorentzAngleTestAlg, SCT_ByteStreamErrorsTestAlg, SCT_ConditionsParameterTestAlg, SCT_FlaggedConditionTestAlg, SCT_StripVetoTestAlg, SCT_RawDataToxAOD, and SCTSiPropertiesTestAlg.
Definition at line 44 of file AthReentrantAlgorithm.cxx.
◆ isReEntrant()
bool MuonAlignmentErrorDbAlg::isReEntrant |
( |
| ) |
const |
|
inlineoverride |
◆ isSmallSector()
Definition at line 278 of file MuonAlignmentErrorDbAlg.cxx.
288 case StationName::EES:
289 case StationName::EMS:
290 case StationName::EOS:
291 case StationName::EIS:
293 case StationName::BMG:
294 case StationName::MMS:
295 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()
virtual void AthReentrantAlgorithm::setFilterPassed |
( |
bool |
state, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
inlinevirtualinherited |
◆ side()
◆ sysExecute()
StatusCode AthReentrantAlgorithm::sysExecute |
( |
const EventContext & |
ctx | ) |
|
|
overridevirtualinherited |
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 67 of file AthReentrantAlgorithm.cxx.
69 return Gaudi::Algorithm::sysExecute (ctx);
◆ sysInitialize()
StatusCode AthReentrantAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
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 96 of file AthReentrantAlgorithm.cxx.
107 if ( cs.retrieve().isFailure() ) {
109 return StatusCode::SUCCESS;
111 if (cs->regHandle(
this,*
h).isFailure()) {
112 sc = StatusCode::FAILURE;
113 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
DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects |
|
privateinherited |
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 153 of file AthReentrantAlgorithm.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
int stgMultilayer() const
Stg specific:
std::string_view stationNameString() const
AthReentrantAlgorithm()
Default constructor:
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
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.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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)
virtual StatusCode sysInitialize() override
Override sysInitialize.
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.
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
Gaudi::Property< std::string > m_clobFileOverride
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