|
ATLAS Offline Software
|
Tool to create the HLTResultMT at the end of each event.
More...
#include <HLTResultMTMaker.h>
|
| HLTResultMTMaker (const std::string &type, const std::string &name, const IInterface *parent) |
| Standard constructor. More...
|
|
virtual | ~HLTResultMTMaker () override=default |
| Standard destructor. More...
|
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | start () override |
|
virtual StatusCode | finalize () override |
|
StatusCode | makeResult (const EventContext &eventContext) const |
| Create and fill a new HLTResultMT, and record it in the event store. More...
|
|
StatusCode | fillResult (HLT::HLTResultMT &hltResult, const EventContext &eventContext) const |
| Fill an existing HLTResultMT with event information. More...
|
|
const std::string & | resultName () const |
| Return name of the HLTResultMT. More...
|
|
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 | sysInitialize () override |
| Perform system initialization for an algorithm. 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 |
|
Tool to create the HLTResultMT at the end of each event.
Definition at line 29 of file HLTResultMTMaker.h.
◆ StoreGateSvc_t
◆ HLTResultMTMaker()
HLTResultMTMaker::HLTResultMTMaker |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~HLTResultMTMaker()
virtual HLTResultMTMaker::~HLTResultMTMaker |
( |
| ) |
|
|
overridevirtualdefault |
◆ 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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]
◆ 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
◆ fillResult()
StatusCode HLTResultMTMaker::fillResult |
( |
HLT::HLTResultMT & |
hltResult, |
|
|
const EventContext & |
eventContext |
|
) |
| const |
Fill an existing HLTResultMT with event information.
Definition at line 150 of file HLTResultMTMaker.cxx.
155 runtimeMetadataOutput->push_back(std::make_unique<xAOD::TrigComposite>());
156 char hostname [HOST_NAME_MAX];
157 bool errcode = !gethostname(hostname, HOST_NAME_MAX);
158 std::string hostnameString = std::string(hostname);
159 errcode &= runtimeMetadataOutput->back()->setDetail(
"hostname", hostnameString);
160 if (!errcode)
ATH_MSG_WARNING(
"Failed to append hostname to HLT Runtime Metadata TC");
166 finalStatus = StatusCode::FAILURE;
172 ATH_MSG_DEBUG(
"Calling " << maker->name() <<
" for accepted event");
173 if (
StatusCode sc = maker->fill(hltResult, eventContext);
sc.isFailure()) {
182 ATH_MSG_DEBUG(
"Rejected event, further result filling skipped after stream tag maker");
◆ finalize()
StatusCode HLTResultMTMaker::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode HLTResultMTMaker::initialize |
( |
| ) |
|
|
overridevirtual |
◆ 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.
◆ makeResult()
StatusCode HLTResultMTMaker::makeResult |
( |
const EventContext & |
eventContext | ) |
const |
Create and fill a new HLTResultMT, and record it in the event store.
Definition at line 139 of file HLTResultMTMaker.cxx.
141 ATH_CHECK( hltResult.record(std::make_unique<HLT::HLTResultMT>()) );
144 return StatusCode::SUCCESS;
◆ 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()
◆ resultName()
const std::string& HLTResultMTMaker::resultName |
( |
| ) |
const |
|
inline |
◆ start()
StatusCode HLTResultMTMaker::start |
( |
| ) |
|
|
overridevirtual |
Definition at line 80 of file HLTResultMTMaker.cxx.
82 Gaudi::Property<std::vector<uint32_t>> enabledROBsProp(
"EnabledROBs",{});
83 if (enabledROBsProp.fromString(
m_jobOptionsSvc->get(
"DataFlowConfig.DF_Enabled_ROB_IDs",
"[]")).isSuccess()) {
84 m_enabledROBs.insert(enabledROBsProp.value().begin(), enabledROBsProp.value().end());
86 <<
" ROBs from DataFlowConfig.DF_Enabled_ROB_IDs");
89 ATH_MSG_ERROR(
"Could not parse DataFlowConfig.DF_Enabled_ROB_IDs from JobOptionsSvc");
93 Gaudi::Property<std::vector<uint32_t>> enabledSubDetsProp(
"EnabledSubDets",{});
94 if (enabledSubDetsProp.fromString(
m_jobOptionsSvc->get(
"DataFlowConfig.DF_Enabled_SubDet_IDs",
"[]")).isSuccess()) {
96 for (
const uint32_t id : enabledSubDetsProp.value()) {
100 <<
" SubDets from DataFlowConfig.DF_Enabled_SubDet_IDs");
103 ATH_MSG_ERROR(
"Could not parse DataFlowConfig.DF_Enabled_SubDet_IDs from JobOptionsSvc");
108 ATH_MSG_INFO(
"The list of enabled ROBs and SubDets was not provided by DataFlowConfig or is empty. "
109 <<
"StreamTag PEBInfo validation will be skipped.");
125 return StatusCode::SUCCESS;
◆ sysInitialize()
◆ 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()
◆ validateExtraROBsAndSubDets()
StatusCode HLTResultMTMaker::validateExtraROBsAndSubDets |
( |
| ) |
|
|
private |
Check ExtraROBs and ExtraSubDets against the detector mask and drop the masked out IDs.
Definition at line 255 of file HLTResultMTMaker.cxx.
258 return StatusCode::SUCCESS;
266 const eformat::helper::DetectorMask detectorMask{
metadata->getDetectorMask(),
metadata->getDetectorMask2()};
269 std::vector<uint32_t> validatedExtraROBs;
271 const eformat::helper::SourceIdentifier sid{rob_id};
272 const eformat::SubDetector subdet_id = sid.subdetector_id();
273 if (detectorMask.is_set(subdet_id)) {
274 validatedExtraROBs.push_back(rob_id);
278 <<
" because SubDetector " << sid.human_detector() <<
" is disabled in the detector mask");
284 std::vector<uint32_t> validatedExtraSubDets;
286 const eformat::SubDetector subdet_id =
static_cast<eformat::SubDetector
>(subdet_id32 & 0xFF);
287 if (detectorMask.is_set(subdet_id)) {
288 validatedExtraSubDets.push_back(subdet_id32);
292 <<
" because SubDetector " << eformat::helper::SourceIdentifier(subdet_id,0,0).human_detector()
293 <<
" is disabled in the detector mask");
298 return StatusCode::SUCCESS;
◆ validatePEBInfo()
Check ROB and SubDet lists in StreamTags and remove those which are disabled.
Definition at line 194 of file HLTResultMTMaker.cxx.
195 std::vector<eformat::helper::StreamTag> streamTagsToRemove;
198 if (st.robs.empty() && st.dets.empty()) {
continue;}
200 std::set<uint32_t> removedROBs = removeDisabled(st.robs,
m_enabledROBs);
201 if (!removedROBs.empty()) {
202 ATH_MSG_DEBUG(
"StreamTag " << st.type <<
"_" << st.name <<
" requested disabled ROBs: " <<
format(removedROBs)
203 <<
" - these ROBs were removed from the StreamTag by " <<
name());
204 std::vector<eformat::SubDetector> removedSubDets;
205 for (
const uint32_t rob : removedROBs) {
206 eformat::SubDetector
sd{eformat::helper::SourceIdentifier(rob).subdetector_id()};
207 if (
std::find(removedSubDets.begin(),removedSubDets.end(),
sd)==removedSubDets.end()) {
208 removedSubDets.push_back(
sd);
212 "PEB_RemovedROBs_SubDet", removedSubDets,
213 [](
const eformat::SubDetector
sd){
return eformat::helper::SubDetectorDictionary.string(
sd);});
216 ATH_MSG_VERBOSE(
"No disabled ROBs were requested by StreamTag " << st.type <<
"_" << st.name);
219 std::set<eformat::SubDetector> removedSubDets = removeDisabled(st.dets,
m_enabledSubDets);
220 if (!removedSubDets.empty()) {
221 ATH_MSG_DEBUG(
"StreamTag " << st.type <<
"_" << st.name <<
" requested disabled SubDets: " <<
format(removedSubDets)
222 <<
" - these SubDets were removed from the StreamTag by " <<
name());
223 std::vector<eformat::SubDetector> removedSubDetsVec(removedSubDets.begin(),removedSubDets.end());
225 "PEB_RemovedSubDets", removedSubDetsVec,
226 [](
const eformat::SubDetector
sd){
return eformat::helper::SubDetectorDictionary.string(
sd);});
229 ATH_MSG_VERBOSE(
"No disabled SubDets were requested by StreamTag " << st.type <<
"_" << st.name);
233 if (st.robs.empty() && st.dets.empty()) {
236 ATH_MSG_ERROR(
"Event accepted to stream " << st.type <<
"_" << st.name <<
" but the streaming to this stream "
237 <<
"is forcibly prevented, because all requested ROBs/SubDets in the PEB list are disabled. "
238 <<
"ROBs: " <<
format(removedROBs) <<
", SubDets: " <<
format(removedSubDets));
240 streamTagsToRemove.push_back(st);
243 for (
const eformat::helper::StreamTag& st : streamTagsToRemove) {
◆ m_bsMetaDataContRHKey
Initial value:{
this, "ByteStreamMetadataRHKey", "InputMetaDataStore+ByteStreamMetadata",
"Key of the ByteStreamMetadataContainer to retrieve the detector mask"
}
StoreGate key for the ByteStreamMetadata container to retrieve detector mask.
Definition at line 67 of file HLTResultMTMaker.h.
◆ m_detStore
◆ m_emptyPEBInfoErrorPrinted
std::atomic_bool HLTResultMTMaker::m_emptyPEBInfoErrorPrinted {false} |
|
mutableprivate |
◆ m_enabledROBs
std::set<uint32_t> HLTResultMTMaker::m_enabledROBs |
|
private |
◆ m_enabledSubDets
std::set<eformat::SubDetector> HLTResultMTMaker::m_enabledSubDets |
|
private |
List of enabled SubDets retrieved during initialisation.
Definition at line 116 of file HLTResultMTMaker.h.
◆ m_evtStore
◆ m_extraEnabledROBs
Gaudi::Property<std::vector<uint32_t> > HLTResultMTMaker::m_extraEnabledROBs |
|
private |
Initial value:{
this, "ExtraEnabledROBs", {},
"Extra ROBs which can be requested in a stream tag, but are not part of the ROS-ROB map"
}
Extra enabled ROBs.
Definition at line 92 of file HLTResultMTMaker.h.
◆ m_extraEnabledSubDets
Gaudi::Property<std::vector<uint32_t> > HLTResultMTMaker::m_extraEnabledSubDets |
|
private |
Initial value:{
this, "ExtraEnabledSubDets", {},
"Extra SubDets which can be requested in a stream tag, but are not part of the ROS-ROB map"
}
Extra enabled SubDets.
Definition at line 102 of file HLTResultMTMaker.h.
◆ m_extraROBs
Gaudi::Property<std::vector<uint32_t> > HLTResultMTMaker::m_extraROBs |
|
private |
Initial value:{
this, "ExtraROBs", {},
"Same as ExtraEnabledROBs but checked against detector mask and dropped if SubDet is masked out"
}
Extra enabled ROBs checked against detector mask.
Definition at line 97 of file HLTResultMTMaker.h.
◆ m_extraSubDets
Gaudi::Property<std::vector<uint32_t> > HLTResultMTMaker::m_extraSubDets |
|
private |
Initial value:{
this, "ExtraSubDets", {},
"Same as ExtraEnabledSubDets but checked against detector mask and dropped if SubDet is masked out"
}
Extra enabled SubDets checked against detector mask.
Definition at line 107 of file HLTResultMTMaker.h.
◆ m_hltResultWHKey
Initial value:{
this, "HLTResultWHKey", "HLTResultMT",
"Key of the output HLTResultMT object"
}
StoreGate key for the HLTResultMT.
Definition at line 58 of file HLTResultMTMaker.h.
◆ m_jobOptionsSvc
ServiceHandle<Gaudi::Interfaces::IOptionsSvc> HLTResultMTMaker::m_jobOptionsSvc |
|
private |
Initial value:{
this, "JobOptionsSvc", "JobOptionsSvc",
"Job options service to retrieve DataFlowConfig"
}
Handle to JobOptionsSvc used to retrieve the DataFlowConfig property.
Definition at line 87 of file HLTResultMTMaker.h.
◆ m_makerTools
Initial value:{
this, "MakerTools", {},
"Set of additional tools that fill content of the HLTResultMT"
}
Tools filling the HLTResultMT object.
Definition at line 77 of file HLTResultMTMaker.h.
◆ m_monTool
Initial value:{
this, "MonTool", "",
"Monitoring tool"
}
Monitoring tool.
Definition at line 82 of file HLTResultMTMaker.h.
◆ m_runtimeMetadataWHKey
Initial value:{
this, "HLTRuntimeMetadataWHKey", "HLT_RuntimeMetadata",
"Key of the output with additional runtime metadata" }
StoreGate key for HLT Runtime Metadata container.
Definition at line 63 of file HLTResultMTMaker.h.
◆ m_skipValidatePEBInfo
bool HLTResultMTMaker::m_skipValidatePEBInfo {false} |
|
private |
◆ m_streamTagMaker
Initial value:{
this, "StreamTagMaker", "",
"Tool creating stream tags (defines if event is accepted)"
}
Tool creating stream tags (defines if event is accepted)
Definition at line 72 of file HLTResultMTMaker.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
bool isAccepted() const
If there is at least one stream tag set, it means the event is accepted.
Group
Properties of a chain group.
std::set< eformat::SubDetector > m_enabledSubDets
List of enabled SubDets retrieved during initialisation.
bool m_skipValidatePEBInfo
If true, don't call validatePEBInfo.
std::string find(const std::string &s)
return a remapped string
ToolHandle< GenericMonitoringTool > m_monTool
Monitoring tool.
Gaudi::Property< std::vector< uint32_t > > m_extraEnabledROBs
Extra enabled ROBs.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::set< uint32_t > m_enabledROBs
List of enabled ROBs retrieved during initialisation.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Gaudi::Property< std::vector< uint32_t > > m_extraROBs
Extra enabled ROBs checked against detector mask.
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
ServiceHandle< Gaudi::Interfaces::IOptionsSvc > m_jobOptionsSvc
Handle to JobOptionsSvc used to retrieve the DataFlowConfig property.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
virtual void setOwner(IDataHandleHolder *o)=0
ToolHandle< HLTResultMTMakerTool > m_streamTagMaker
Tool creating stream tags (defines if event is accepted)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
SG::WriteHandleKey< HLT::HLTResultMT > m_hltResultWHKey
StoreGate key for the HLTResultMT.
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadHandleKey< ByteStreamMetadataContainer > m_bsMetaDataContRHKey
StoreGate key for the ByteStreamMetadata container to retrieve detector mask.
Gaudi::Property< std::vector< uint32_t > > m_extraSubDets
Extra enabled SubDets checked against detector mask.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void validatePEBInfo(HLT::HLTResultMT &hltResult) const
Check ROB and SubDet lists in StreamTags and remove those which are disabled.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_runtimeMetadataWHKey
StoreGate key for HLT Runtime Metadata container.
Gaudi::Property< std::vector< uint32_t > > m_extraEnabledSubDets
Extra enabled SubDets.
ToolHandleArray< HLTResultMTMakerTool > m_makerTools
Tools filling the HLTResultMT object.
std::vector< eformat::helper::StreamTag > & getStreamTagsNonConst()
Non-const-getter for stream tags needed by the result maker to remove disabled ROBs/SubDets.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::atomic_bool m_emptyPEBInfoErrorPrinted
Flag if empty PEB list error was already printed.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
StatusCode fillResult(HLT::HLTResultMT &hltResult, const EventContext &eventContext) const
Fill an existing HLTResultMT with event information.
StatusCode validateExtraROBsAndSubDets()
Check ExtraROBs and ExtraSubDets against the detector mask and drop the masked out IDs.