|
ATLAS Offline Software
|
Checks the consistency between CTP active items and L1 RoIs (TOBs) received from RoIB/readout.
More...
#include <L1DataConsistencyChecker.h>
|
| L1DataConsistencyChecker (const std::string &type, const std::string &name, const IInterface *parent) |
|
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 |
|
Checks the consistency between CTP active items and L1 RoIs (TOBs) received from RoIB/readout.
Definition at line 22 of file L1DataConsistencyChecker.h.
◆ MultiplicityInfo
◆ StoreGateSvc_t
◆ L1DataConsistencyChecker()
L1DataConsistencyChecker::L1DataConsistencyChecker |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
|
inline |
◆ consistencyCheck()
StatusCode L1DataConsistencyChecker::consistencyCheck |
( |
const HLT::IDVec & |
l1SeededChains, |
|
|
const EventContext & |
ctx |
|
) |
| const |
Perform the check and fill the corresponding histograms.
Counter for debug printouts
Definition at line 84 of file L1DataConsistencyChecker.cxx.
91 std::ostringstream ssPassedThresholds;
92 std::unordered_map<TrigCompositeUtils::DecisionID, size_t> tobThresholdCounts;
93 std::unordered_set<std::string> overflowThresholdTypes;
98 ATH_MSG_DEBUG(
"No DecisionContainer " << decisionsKey <<
" for threshold type " << thrType <<
" found in this event");
104 std::vector<TrigCompositeUtils::DecisionID> passedThresholdIDs;
105 const bool hasDetail =
d->getDetail(
"thresholds", passedThresholdIDs);
107 ATH_MSG_ERROR(
"Detail \"thresholds\" missing from Decision in the container " << decisionsKey);
108 return StatusCode::FAILURE;
110 bool overflow{
false};
111 if (
d->hasDetail<
char>(
"overflow")) {
112 overflow =
static_cast<bool>(
d->getDetail<
char>(
"overflow"));
114 if (
doDebug()) {ssPassedThresholds.str(
"");}
119 if (tobThresholdCounts.find(thrNameHash)==tobThresholdCounts.end()) {
120 tobThresholdCounts[thrNameHash] = 1;
123 tobThresholdCounts[thrNameHash] += 1;
126 if (!ssPassedThresholds.str().empty()) ssPassedThresholds <<
", ";
133 if (optTob.has_value()) {
135 ATH_MSG_DEBUG(
"Decision " << decisionsKey <<
"[" << idec <<
"] corresponds to TOB with word / et / eta / phi = 0x"
139 ATH_MSG_DEBUG(
"Decision " << decisionsKey <<
"[" << idec <<
"] TOB type not supported by template code for "
140 <<
"debug printout of word / et / eta / phi");
142 ATH_MSG_DEBUG(
"Decision " << decisionsKey <<
"[" << idec <<
"] TOB passes " << passedThresholdIDs.size()
143 <<
" thresholds: " << ssPassedThresholds.str());
152 std::unordered_map<TrigCompositeUtils::DecisionID, size_t> ctpThresholdCounts;
162 for (
const auto& [thrNameHash, multiplicity] : thresholds) {
163 if (ctpThresholdCounts.find(thrNameHash)==ctpThresholdCounts.end()) {
164 ctpThresholdCounts[thrNameHash] = multiplicity;
166 else if (multiplicity > ctpThresholdCounts[thrNameHash]) {
167 ctpThresholdCounts[thrNameHash] = multiplicity;
175 for (
const auto& [thrNameHash, ctpCount] : ctpThresholdCounts) {
180 ATH_MSG_ERROR(
"Threshold with hash " << thrNameHash <<
" not found in the hash->name map");
181 return StatusCode::FAILURE;
183 const std::string& thrName =
it->second;
187 bool overflow{overflowThresholdTypes.find(thrType)!=overflowThresholdTypes.end()};
189 ATH_MSG_DEBUG(
"Threshold " << thrName <<
" accepted by the CTP with multiplicity " << ctpCount
190 <<
" is flagged as overflow and thus may be missing TOBs");
194 bool missing = (tobThresholdCounts.find(thrNameHash)==tobThresholdCounts.end());
199 <<
" accepted by the CTP with multiplicity " << ctpCount
200 << (overflow ?
", likely due to overflow" :
""));
203 ATH_MSG_ERROR(
"No TOBs found passing the threshold " << thrName
204 <<
" accepted by the CTP with multiplicity " << ctpCount);
205 sc = StatusCode::FAILURE;
209 tobCount = tobThresholdCounts.at(thrNameHash);
211 tooFew = (tobCount < ctpCount);
216 ATH_MSG_WARNING(
"Too few (" << tobCount <<
") TOBs found passing the threshold " << thrName
217 <<
" accepted by the CTP with multiplicity " << ctpCount
218 << (overflow ?
", likely due to overflow" :
""));
220 ATH_MSG_ERROR(
"Too few (" << tobCount <<
") TOBs found passing the threshold " << thrName
221 <<
" accepted by the CTP with multiplicity " << ctpCount);
222 sc = StatusCode::FAILURE;
226 if (missing || tooFew) {
228 Monitored::Scalar monMissingTOBsIncludingOverflow{
"MissingTOBsIncludingOverflow", thrName};
238 ATH_MSG_DEBUG(
"Check passed. Found " << tobCount <<
" TOBs passing the threshold " << thrName
239 <<
" accepted by the CTP with multiplicity " << ctpCount);
245 const auto ctpIt = ctpThresholdCounts.find(thrNameHash);
246 size_t ctpCount = (ctpIt==ctpThresholdCounts.cend()) ? 0 : ctpIt->second;
247 const auto tobIt = tobThresholdCounts.find(thrNameHash);
248 size_t tobCount = (tobIt==tobThresholdCounts.cend()) ? 0 : tobIt->second;
249 int tobMinusCtpCount =
static_cast<int>(ctpCount) -
static_cast<int>(tobCount);
◆ 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()
◆ doDebug()
bool L1DataConsistencyChecker::doDebug |
( |
| ) |
const |
|
inlineprivate |
◆ 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
◆ initialize()
StatusCode L1DataConsistencyChecker::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.
◆ 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()
◆ start()
StatusCode L1DataConsistencyChecker::start |
( |
| ) |
|
|
overridevirtual |
Definition at line 36 of file L1DataConsistencyChecker.cxx.
42 TrigConf::LogicParser logicParser;
53 if (
chain.l1item().empty() ||
chain.l1item().find(
',')!=std::string::npos) {
continue;}
56 std::map<std::string,unsigned int> thresholds = logicParser.parse(
item.definition())->elementsCount();
57 for (
const auto& [thrName, multiplicity] : thresholds) {
69 ATH_MSG_ERROR(
"Exception caught while parsing L1 thresholds for chain " <<
chain.name() <<
": " << ex.what());
70 return StatusCode::FAILURE;
74 for (
const std::shared_ptr<TrigConf::L1Threshold>& thr : l1Menu->thresholds()) {
80 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()
◆ m_detStore
◆ m_errorOnMissingTOB
Gaudi::Property<bool> L1DataConsistencyChecker::m_errorOnMissingTOB |
|
private |
Initial value:{
this, "ErrorOnMissingTOB", true, "Set to true to enable strict-mode which will generate an ERROR on missing (non-overflow) TOB events in HLT-seeding from L1"}
Definition at line 45 of file L1DataConsistencyChecker.h.
◆ m_evtStore
◆ m_excludedThresholdTypes
Gaudi::Property<std::vector<std::string> > L1DataConsistencyChecker::m_excludedThresholdTypes |
|
private |
Initial value:{
this, "ExcludedThresholdTypes", {
"internal",
"TOPO", "R2TOPO", "ZBTopo", "LArSat",
"TE", "XE", "XS", "jTE", "jXE", "gTE", "gXE",
"ALFA", "BCM", "BCMCMB", "BPTX", "CALREQ", "LUCID", "MBTS", "MBTSSI", "NIM", "ZDC", "NSWMon"
},
"L1 threshold types which are not subject to the consistency check "
"(because either there are no corresponding TOBs or HLT doesn't use them)"}
Definition at line 51 of file L1DataConsistencyChecker.h.
◆ m_hltMenuKey
◆ m_l1MenuKey
◆ m_monitoredThresholds
◆ m_monTool
◆ m_thresholdMap
◆ m_thresholdNames
◆ m_thresholdToDecisionMap
Gaudi::Property<std::map<std::string,std::string> > L1DataConsistencyChecker::m_thresholdToDecisionMap |
|
private |
Initial value:{
this, "ThresholdToDecisionMap", {}, "Map between L1 threshold type and the corresponding DecisionContainer name"}
Definition at line 48 of file L1DataConsistencyChecker.h.
◆ m_thresholdTypes
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
std::unordered_map< TrigCompositeUtils::DecisionID, std::string > m_thresholdNames
SG::ReadHandleKey< TrigConf::HLTMenu > m_hltMenuKey
Group
Properties of a chain group.
std::variant< const eFexEM::T_RoI *, const eFexTau::T_RoI *, const jFexFwdEl::T_RoI *, const jFexTau::T_RoI *, const jFexSRJet::T_RoI *, const jFexLRJet::T_RoI *, const gFexSRJet::T_RoI *, const Muon::T_RoI * > AnyRoIPointer
std::variant of const ptr to RoI types. Note identical types are only entered once in the template (e...
constexpr float roiPhi(const AnyRoIPointer &roi)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Group of local monitoring quantities and retain correlation when filling histograms
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
ToolHandle< GenericMonitoringTool > m_monTool
const std::string & initialRecRoIString()
setTeId setLumiBlock setRoiId setRoiSubsystem setRoiNumber roiEta
const std::string & type() const
Accessor to the threshold type.
virtual const std::string & name() const final
virtual void setOwner(IDataHandleHolder *o)=0
std::unordered_map< TrigCompositeUtils::DecisionID, std::string > m_thresholdTypes
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
Gaudi::Property< bool > m_errorOnMissingTOB
std::unordered_map< TrigCompositeUtils::DecisionID, MultiplicityInfo > m_thresholdMap
Gaudi::Property< std::map< std::string, std::string > > m_thresholdToDecisionMap
::StatusCode StatusCode
StatusCode definition for legacy code.
L1 threshold configuration.
std::unordered_map< TrigCompositeUtils::DecisionID, unsigned int > MultiplicityInfo
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.
Class used to describe composite objects in the HLT.
std::optional< AnyRoIPointer > roiFromLink(const xAOD::TrigComposite &tc, const std::string &linkName)
Recursively try each type from AnyRoIPointer variant to retrieve an object from a TrigComposite link.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool doDebug() const
Shorter alias for a check whether we are in DEBUG logging mode.
#define ATH_MSG_WARNING(x)
Gaudi::Property< std::vector< std::string > > m_excludedThresholdTypes
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
constexpr unsigned int roiTobEt(const AnyRoIPointer &roi)
std::set< TrigCompositeUtils::DecisionID > m_monitoredThresholds
Declare a monitored scalar variable.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Standard L1 threshold configuration.