|
ATLAS Offline Software
|
#include <RoIsUnpackingEmulationTool.h>
|
| RoIsUnpackingEmulationTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual StatusCode | unpack (const EventContext &ctx, const ROIB::RoIBResult &roib, const HLT::IDSet &activeChains) const override |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | start () override |
|
virtual StatusCode | unpack (const EventContext &, const ROIB::RoIBResult &, const HLT::IDSet &) const override |
|
virtual StatusCode | unpack (const EventContext &, const xAOD::TrigComposite &, const HLT::IDSet &) const override |
|
virtual StatusCode | unpack (const EventContext &, const xAOD::TrigComposite &, const HLT::IDSet &) const override |
|
◆ ThrVec
◆ ThrVecRef
◆ RoIsUnpackingEmulationTool()
RoIsUnpackingEmulationTool::RoIsUnpackingEmulationTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ addChainsToDecision()
Definition at line 88 of file RoIsUnpackingToolBase.cxx.
98 for (
auto chainId:
chains->second ) {
99 if ( activeChains.find(chainId) != activeChains.end() ) {
100 ids.insert( chainId.numeric() );
101 ATH_MSG_DEBUG(
"Added " << chainId <<
" to the RoI/threshold decision " << thresholdId );
106 if ( activeChains.find( legIterator->second ) != activeChains.end() ) {
107 ids.insert( chainId.numeric() );
108 ATH_MSG_DEBUG(
"Added " << chainId <<
" to the RoI/threshold decision " << thresholdId );
114 ATH_MSG_DEBUG(
"Number of decisions in this RoI after adding chains using threshold " << thresholdId
◆ decodeMapping()
StatusCode RoIsUnpackingToolBase::decodeMapping |
( |
std::function< bool(const std::string &)> && |
filter | ) |
|
|
protectedinherited |
Fills mapping from L1 threshold -> to HLT chain.
- filter Function that, using the threshold name, defines if this decoder instance should take care of this threshold
Definition at line 52 of file RoIsUnpackingToolBase.cxx.
60 const std::vector<std::string> thresholds{
chain.l1thresholds() };
61 const std::vector<size_t> legMultiplicities{
chain.legMultiplicities() };
62 if (thresholds.size() != legMultiplicities.size()) {
63 ATH_MSG_ERROR(
"Encountered a chain " <<
chain.name() <<
" with " << legMultiplicities.size()
64 <<
" legs but only " << thresholds.size() <<
" thresholds. These should be the same.");
65 return StatusCode::FAILURE;
68 for (
const std::string&
th: thresholds ) {
72 ATH_MSG_DEBUG(
"Associating " << chainIdentifier <<
" with threshold " <<
th );
73 if ( thresholds.size() > 1 ) {
77 ATH_MSG_DEBUG(
"Associating additional chain leg " << legIdentifier
78 <<
" with threshold " << thresholdIdentifier );
84 return StatusCode::SUCCESS;
◆ getL1Thresholds()
Retrieve a vector of thresholds with type thrType
from L1Menu.
- Parameters
-
[in] | l1Menu | The L1Menu object |
[in] | thrType | The threshold type, e.g. EM, MU, eTAU |
[out] | thrVec | The output will be passed into this parameter |
- Returns
- FAILURE on exception reading the menu (e.g. thrType not in menu), SUCCESS otherwise
Definition at line 33 of file RoIsUnpackingToolBase.cxx.
40 ATH_MSG_ERROR(
"Failed to retrieve " << thrType <<
" thresholds from L1 menu. Exception:" << ex.what());
41 return StatusCode::FAILURE;
43 return StatusCode::SUCCESS;
◆ getProbeThresholdName()
std::string RoIsUnpackingToolBase::getProbeThresholdName |
( |
const std::string & |
thresholdName | ) |
|
|
staticprotectedinherited |
Concatenate the probe identifier string with the threshold name string.
Creates an alternate threshold name, used by lower pT probe legs of tag+probe chains.
Definition at line 47 of file RoIsUnpackingToolBase.cxx.
48 return "PROBE" + thresholdName;
◆ initialize()
StatusCode RoIsUnpackingEmulationTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ parseInputFile()
Definition at line 71 of file RoIsUnpackingEmulationTool.cxx.
72 const char* whiteSpaceChars =
" \t\n\r\f\v";
73 auto rtrim = [whiteSpaceChars](std::string&
s) {
s.erase(
s.find_last_not_of(whiteSpaceChars) + 1); };
74 auto ltrim = [whiteSpaceChars](std::string&
s) {
s.erase(0,
s.find_first_not_of(whiteSpaceChars)); };
75 auto trim = [&rtrim, <rim](std::string&
s) { ltrim(
s); rtrim(
s); };
77 std::vector<std::vector<RoIsUnpackingEmulationTool::FakeRoI>>
result;
78 unsigned lineNumber = 0;
83 throw std::invalid_argument(
"File " +
m_inputFilename +
"does not exists or is corrupted");
88 if (
line.empty()) {
continue;}
93 throw std::invalid_argument(
"File " +
m_inputFilename +
" does not contain any RoI");
◆ parseInputFileLine()
Definition at line 101 of file RoIsUnpackingEmulationTool.cxx.
102 std::vector<RoIsUnpackingEmulationTool::FakeRoI>
result;
104 std::stringstream inputLine(
line);
107 while (getline(inputLine, roi,
';')) {
112 if (roi.find (
',') != std::string::npos) {
◆ parseInputRoI()
Definition at line 121 of file RoIsUnpackingEmulationTool.cxx.
123 std::stringstream inputRoi(roi);
124 std::string roiElement;
125 unsigned roiElementNumber = 0;
127 std::vector<std::function<void(
const std::string&)>> fillResultFunctors;
128 fillResultFunctors.emplace_back([&](
const std::string&
eta) {
result.eta = stod(
eta); });
129 fillResultFunctors.emplace_back([&](
const std::string&
phi) {
result.phi = stod(
phi); });
130 fillResultFunctors.emplace_back([&](
const std::string& word) {
result.roIWord = stoul(word); });
131 fillResultFunctors.emplace_back([&](
const std::string& passedThresholdID) {
132 result.passedThresholdIDs.push_back(passedThresholdID); });
134 while (getline(inputRoi, roiElement,
',')) {
135 if (roiElementNumber > 2) { roiElementNumber = 3; }
139 fillResultFunctors[roiElementNumber++](roiElement);
142 throw std::invalid_argument(
"Exception encountered while parsing line " +
std::to_string(lineNumber) +
◆ readEmulatedData()
StatusCode RoIsUnpackingEmulationTool::readEmulatedData |
( |
| ) |
|
|
private |
Definition at line 35 of file RoIsUnpackingEmulationTool.cxx.
38 return StatusCode::RECOVERABLE;
46 return StatusCode::RECOVERABLE;
53 for (
auto& fakeRoI : fragment) {
54 const char*
const delim =
", ";
55 std::ostringstream debugPassedTresholdIDs;
56 std::copy(fakeRoI.passedThresholdIDs.begin(),
57 fakeRoI.passedThresholdIDs.end(),
58 std::ostream_iterator<std::string>(debugPassedTresholdIDs, delim));
63 ", PassedThresholdIDs: " + debugPassedTresholdIDs.str());
67 return StatusCode::SUCCESS;
◆ start()
StatusCode RoIsUnpackingEmulationTool::start |
( |
| ) |
|
|
overridevirtual |
◆ unpack() [1/4]
virtual StatusCode RoIsUnpackingToolBase::unpack |
|
inlineoverride |
◆ unpack() [2/4]
virtual StatusCode RoIsUnpackingToolBase::unpack |
|
inlineoverride |
◆ unpack() [3/4]
|
inlineoverridevirtualinherited |
◆ unpack() [4/4]
Reimplemented from RoIsUnpackingToolBase.
Definition at line 151 of file RoIsUnpackingEmulationTool.cxx.
162 ATH_MSG_ERROR(
"No input dataset found. Cannot decode RoI emulation");
163 return StatusCode::FAILURE;
169 for (
auto& roi : FakeRoIs) {
171 trigRoIs->
push_back( std::make_unique<TrigRoiDescriptor>(
176 ATH_MSG_DEBUG(
"RoI word: 0x" << MSG::hex << std::setw(8) << roIWord << MSG::dec );
180 std::vector<TrigCompositeUtils::DecisionID> passedThresholdIDs;
182 for (
const auto&
th: roi.passedThresholdIDs ) {
183 ATH_MSG_DEBUG(
"Passed Threshold " <<
th <<
" enabling respective chains " );
190 decision->setDetail(
"thresholds", passedThresholdIDs );
193 for (
auto roi: *trigRoIs ) {
194 ATH_MSG_DEBUG(
"RoI Eta: " << roi->eta() <<
" Phi: " << roi->phi() <<
" RoIWord: " << roi->roiWord());
197 return StatusCode::SUCCESS;
◆ m_currentRowNumber
unsigned RoIsUnpackingEmulationTool::m_currentRowNumber {0} |
|
private |
◆ m_decisionsKey
Initial value:{
this, "Decisions", "RoIDecisions", "Decisions for each RoI"}
Definition at line 51 of file RoIsUnpackingToolBase.h.
◆ m_decisionsKeyProbe
Initial value:{
this, "DecisionsProbe", "", "Optional secondary set of Decisions for each RoI for probe a.k.a. delayed a.k.a. rerun chains"}
Definition at line 54 of file RoIsUnpackingToolBase.h.
◆ m_HLTMenuKey
Initial value:{
this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "Name of the HLTMenu object to read configuration from"}
Definition at line 63 of file RoIsUnpackingToolBase.h.
◆ m_inputData
◆ m_inputFilename
Gaudi::Property<std::string> RoIsUnpackingEmulationTool::m_inputFilename |
|
private |
◆ m_l1MenuKey
Initial value:{
this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "Name of the L1Menu object to read configuration from"}
Definition at line 60 of file RoIsUnpackingToolBase.h.
◆ m_legToChainMapping
◆ m_monTool
◆ m_roiupdater
ToolHandle<IRoiUpdaterTool> RoIsUnpackingToolBase::m_roiupdater { this, "RoiUpdater", "", "Roi Updater" } |
|
protectedinherited |
◆ m_roIWidth
Gaudi::Property<float> RoIsUnpackingEmulationTool::m_roIWidth |
|
private |
◆ m_thresholdPrefix
Gaudi::Property<std::string> RoIsUnpackingEmulationTool::m_thresholdPrefix |
|
private |
Initial value:{
this, "ThresholdPrefix", "EM",
"Activate chains that are seed from threshold that have this prefix in the name"}
Definition at line 34 of file RoIsUnpackingEmulationTool.h.
◆ m_thresholdToChainMapping
◆ m_trigRoIsKey
Initial value:{
this, "OutputTrigRoIs", "", "Name of the RoIs collection produced by the unpacker"}
Definition at line 57 of file RoIsUnpackingToolBase.h.
The documentation for this class was generated from the following files:
Scalar phi() const
phi method
const std::string & hltSeedingNodeName()
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
Scalar eta() const
pseudorapidity method
void insertDecisionIDs(const Decision *src, Decision *dest)
Appends the decision IDs of src to the dest decision object.
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
const std::string & key() const
Return the StoreGate ID for the referenced object.
@ u
Enums for curvilinear frames.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const std::string & initialRoIString()
pointer_type ptr()
Dereference the pointer.
SG::WriteHandle< CONT > createAndStoreNoAux(const SG::WriteHandleKey< CONT > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Creates and right away records the Container CONT with the key.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::string to_string(const DetectorType &type)
setTeId setLumiBlock setRoiId setRoiSubsystem roiNumber
value_type push_back(value_type pElem)
Add an element to the end of the collection.
HLT::Identifier createLegName(const HLT::Identifier &chainIdentifier, size_t counter)
Generate the HLT::Identifier which corresponds to a specific leg of a given chain.
std::set< DecisionID > DecisionIDContainer
#define ATH_MSG_WARNING(x)
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
void trim(std::string &input)
size_type size() const noexcept
Returns the number of elements in the collection.