![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <TrigThresholdDecisionTool.h>
|
| TrigThresholdDecisionTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | start () override |
|
virtual uint64_t | getPattern (const xAOD::MuonRoI &roi, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const override |
|
virtual uint64_t | getPattern (uint32_t dataWord, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const |
|
virtual std::vector< std::pair< std::shared_ptr< TrigConf::L1Threshold >, bool > > | getThresholdDecisions (uint32_t dataWord, const EventContext &eventContext) const override |
|
virtual std::vector< std::pair< std::shared_ptr< TrigConf::L1Threshold >, bool > > | getThresholdDecisions (uint32_t dataWord, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const override |
|
virtual std::pair< std::string, double > | getMinThresholdNameAndValue (const std::vector< std::pair< std::shared_ptr< TrigConf::L1Threshold >, bool > > &decisions, const double &eta=0) const override |
|
|
bool | isExcludedRPCROI (const TrigConf::L1ThrExtraInfo_MU &menuExtraInfo, const std::string &rpcExclROIList, unsigned roi, unsigned sectorID, bool isSideC) const |
|
bool | getTGCDecision (const std::string &tgcFlags, bool F, bool C, bool H) const |
|
void | makeTGCDecision (const std::string &tgcFlags, bool F, bool C, bool H) |
|
bool | getRPCDecision (const std::string &rpcFlags, bool M) const |
|
void | makeRPCDecision (const std::string &rpcFlags, bool M) |
|
void | parseFlags (const std::string &flags) |
|
std::vector< std::string > | parseString (const std::string &str, const std::string &sep) const |
|
std::string | getShapedFlags (const std::string &flags) const |
|
Definition at line 39 of file TrigThresholdDecisionTool.h.
◆ TrigThresholdDecisionTool()
LVL1::TrigThresholdDecisionTool::TrigThresholdDecisionTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ getMinThresholdNameAndValue()
std::pair< std::string, double > LVL1::TrigThresholdDecisionTool::getMinThresholdNameAndValue |
( |
const std::vector< std::pair< std::shared_ptr< TrigConf::L1Threshold >, bool > > & |
decisions, |
|
|
const double & |
eta = 0 |
|
) |
| const |
|
overridevirtual |
Definition at line 209 of file TrigThresholdDecisionTool.cxx.
212 std::string thrName=
"";
214 double thrVal=999999999999;
215 for (
unsigned idec=0;idec<
decisions.size();++idec) {
217 std::shared_ptr<TrigConf::L1Threshold> thr =
decisions[idec].first;
221 thrName = thr->
name();
225 if (thrVal==999999999999) thrVal=0;
226 return std::make_pair(thrName, thrVal);
◆ getPattern() [1/2]
◆ getPattern() [2/2]
Definition at line 84 of file TrigThresholdDecisionTool.cxx.
93 else roiTool = &(*m_tgcTool);
99 unsigned roi, sectorID;
113 bool F=
false,
C=
false,
H=
false, M=
false;
126 for (
const std::shared_ptr<TrigConf::L1Threshold>& thrBase : menuThresholds) {
127 std::shared_ptr<TrigConf::L1Threshold_MU> thr = std::static_pointer_cast<TrigConf::L1Threshold_MU>(thrBase);
132 if (thr->
region().find(
"ALL") == std::string::npos &&
133 thr->
region().find(
"BA") == std::string::npos)
continue;
149 if (thr->
region().find(
"ALL") == std::string::npos &&
150 thr->
region().find(
"EC") == std::string::npos)
continue;
159 if (thr->
region().find(
"ALL") == std::string::npos &&
160 thr->
region().find(
"FW") == std::string::npos)
continue;
173 thresholdsPattern |= (1 << thr->
mapping());
178 return thresholdsPattern;
◆ getRPCDecision()
bool LVL1::TrigThresholdDecisionTool::getRPCDecision |
( |
const std::string & |
rpcFlags, |
|
|
bool |
M |
|
) |
| const |
|
protected |
Definition at line 309 of file TrigThresholdDecisionTool.cxx.
312 RPCFlagDecision decision(M);
316 auto previous_decision_itr = previous_decisions->second.find(decision);
317 if (previous_decision_itr != previous_decisions->second.end())
return previous_decision_itr->pass;
◆ getShapedFlags()
std::string LVL1::TrigThresholdDecisionTool::getShapedFlags |
( |
const std::string & |
flags | ) |
const |
|
protected |
Definition at line 396 of file TrigThresholdDecisionTool.cxx.
398 std::string shapedFlags =
flags;
399 shapedFlags.erase(std::remove_if(shapedFlags.begin(),shapedFlags.end(),::isspace),shapedFlags.end());
400 std::vector<std::string> vec_ors =
parseString(shapedFlags,
"|");
401 std::set<std::string> set_ors;
402 for(
const auto& ors : vec_ors){
403 std::vector<std::string> vec_ands =
parseString(ors,
"&");
404 std::set<std::string> set_ands;
405 for(
const auto& ands : vec_ands){
406 set_ands.insert(ands);
409 for(
const auto& ands : set_ands){
413 std::string bb =
aa.substr(0,
aa.size()-1);
417 for(
const auto& ors : set_ors){
421 std::string bb =
aa.substr(0,
aa.size()-1);
◆ getTGCDecision()
bool LVL1::TrigThresholdDecisionTool::getTGCDecision |
( |
const std::string & |
tgcFlags, |
|
|
bool |
F, |
|
|
bool |
C, |
|
|
bool |
H |
|
) |
| const |
|
protected |
Definition at line 262 of file TrigThresholdDecisionTool.cxx.
265 TGCFlagDecision decision(F,C,H);
269 auto previous_decision_itr = previous_decisions->second.find(decision);
270 if (previous_decision_itr != previous_decisions->second.end())
return previous_decision_itr->pass;
◆ getThresholdDecisions() [1/2]
std::vector< std::pair< std::shared_ptr< TrigConf::L1Threshold >, bool > > LVL1::TrigThresholdDecisionTool::getThresholdDecisions |
( |
uint32_t |
dataWord, |
|
|
const EventContext & |
eventContext |
|
) |
| const |
|
overridevirtual |
Definition at line 182 of file TrigThresholdDecisionTool.cxx.
186 std::optional<ThrVecRef> menuThresholds = getMenuThresholds(*l1Menu);
187 std::optional<ExtraInfoRef> menuExtraInfo = getMenuThresholdExtraInfo(*l1Menu);
◆ getThresholdDecisions() [2/2]
Definition at line 193 of file TrigThresholdDecisionTool.cxx.
200 std::vector<std::pair<std::shared_ptr<TrigConf::L1Threshold>,
bool> > threshold_decisions;
201 threshold_decisions.resize(menuThresholds.size());
202 for (
const std::shared_ptr<TrigConf::L1Threshold>& thr : menuThresholds) {
203 const bool decision =
pattern & (1 << thr->mapping());
204 threshold_decisions[thr->mapping()] = std::make_pair(thr, decision);
206 return threshold_decisions;
◆ initialize()
StatusCode LVL1::TrigThresholdDecisionTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ isExcludedRPCROI()
bool LVL1::TrigThresholdDecisionTool::isExcludedRPCROI |
( |
const TrigConf::L1ThrExtraInfo_MU & |
menuExtraInfo, |
|
|
const std::string & |
rpcExclROIList, |
|
|
unsigned |
roi, |
|
|
unsigned |
sectorID, |
|
|
bool |
isSideC |
|
) |
| const |
|
protected |
Definition at line 229 of file TrigThresholdDecisionTool.cxx.
234 if (rpcExclROIList !=
"")
236 const std::map<std::string, std::vector<unsigned int> >& exclList = menuExtraInfo.
exclusionList(rpcExclROIList);
237 if (exclList.size() != 0)
240 std::stringstream sectorName;
242 int sectorNumber=sectorID;
243 if (isSideC) sectorNumber += 32;
244 if (sectorNumber < 10) sectorName <<
"0";
245 sectorName << sectorNumber;
248 auto exclROIs = exclList.find(sectorName.str());
249 if (exclROIs != exclList.end())
251 for (
auto roi_itr=exclROIs->second.begin();roi_itr!=exclROIs->second.end();roi_itr++)
253 if (*roi_itr == roi)
return true;
◆ makeRPCDecision()
void LVL1::TrigThresholdDecisionTool::makeRPCDecision |
( |
const std::string & |
rpcFlags, |
|
|
bool |
M |
|
) |
| |
|
protected |
Definition at line 321 of file TrigThresholdDecisionTool.cxx.
324 RPCFlagDecision decision(M);
326 auto previous_decision_itr = previous_decisions->find(decision);
327 if (previous_decision_itr != previous_decisions->end())
return;
328 else if (rpcFlags ==
"") {
330 previous_decisions->insert(decision);
336 bool passedFlags =
false;
337 const std::vector<std::vector<std::string> >* vec_flags = &
m_parsed_flags[rpcFlags];
338 for (
auto or_itr = vec_flags->begin();or_itr!=vec_flags->end();or_itr++)
341 bool passedAnd =
true;
342 for (
auto and_itr = or_itr->begin();and_itr!=or_itr->end();and_itr++)
344 if (*and_itr ==
"M") passedAnd = passedAnd && M;
346 passedFlags = passedFlags || passedAnd;
349 decision.pass = passedFlags;
350 previous_decisions->insert(decision);
◆ makeTGCDecision()
void LVL1::TrigThresholdDecisionTool::makeTGCDecision |
( |
const std::string & |
tgcFlags, |
|
|
bool |
F, |
|
|
bool |
C, |
|
|
bool |
H |
|
) |
| |
|
protected |
Definition at line 274 of file TrigThresholdDecisionTool.cxx.
277 TGCFlagDecision decision(F,C,H);
279 auto previous_decision_itr = previous_decisions->find(decision);
280 if (previous_decision_itr != previous_decisions->end())
return;
281 else if (tgcFlags ==
"") {
283 previous_decisions->insert(decision);
289 bool passedFlags =
false;
290 const std::vector<std::vector<std::string> >* vec_flags = &
m_parsed_flags[tgcFlags];
291 for (
auto or_itr = vec_flags->begin();or_itr!=vec_flags->end();or_itr++)
294 bool passedAnd =
true;
295 for (
auto and_itr = or_itr->begin();and_itr!=or_itr->end();and_itr++)
297 if (*and_itr ==
"F") passedAnd = passedAnd &&
F;
298 else if (*and_itr ==
"C") passedAnd = passedAnd &&
C;
299 else if (*and_itr ==
"H") passedAnd = passedAnd &&
H;
301 passedFlags = passedFlags || passedAnd;
304 decision.pass = passedFlags;
305 previous_decisions->insert(decision);
◆ parseFlags()
void LVL1::TrigThresholdDecisionTool::parseFlags |
( |
const std::string & |
flags | ) |
|
|
protected |
Definition at line 354 of file TrigThresholdDecisionTool.cxx.
361 std::vector<std::vector<std::string> > vec_flags;
362 for (
unsigned ior=0;ior<vec_ors.size();ior++)
364 vec_flags.push_back(
parseString(vec_ors[ior],
"&"));
◆ parseString()
std::vector< std::string > LVL1::TrigThresholdDecisionTool::parseString |
( |
const std::string & |
str, |
|
|
const std::string & |
sep |
|
) |
| const |
|
protected |
◆ start()
StatusCode LVL1::TrigThresholdDecisionTool::start |
( |
| ) |
|
|
overridevirtual |
Definition at line 32 of file TrigThresholdDecisionTool.cxx.
34 ATH_MSG_DEBUG(
"==========================================" );
35 ATH_MSG_DEBUG(
"Start for Phase1 TrigThresholdDecisionTool" );
36 ATH_MSG_DEBUG(
"==========================================" );
44 std::optional<ThrVecRef> menuThresholds = getMenuThresholds(*l1Menu);
47 for (
const std::shared_ptr<TrigConf::L1Threshold>& thrBase : menuThresholds.value().get()) {
48 std::shared_ptr<TrigConf::L1Threshold_MU> thr = std::static_pointer_cast<TrigConf::L1Threshold_MU>(thrBase);
75 return StatusCode::SUCCESS;
◆ m_parsed_flags
std::map<std::string, std::vector<std::vector<std::string> > > LVL1::TrigThresholdDecisionTool::m_parsed_flags |
|
protected |
◆ m_rpcFlag_decisions
std::map<std::string, std::set<RPCFlagDecision> > LVL1::TrigThresholdDecisionTool::m_rpcFlag_decisions |
|
protected |
◆ m_rpcTool
◆ m_tgcFlag_decisions
std::map<std::string, std::set<TGCFlagDecision> > LVL1::TrigThresholdDecisionTool::m_tgcFlag_decisions |
|
protected |
◆ m_tgcTool
The documentation for this class was generated from the following files:
unsigned int mapping() const
Accessor to the mapping number The mapping is unique within a type.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Scalar eta() const
pseudorapidity method
const std::string & region() const
virtual const std::string & name() const final
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const std::string & tgcFlags() const
virtual float thrValue(int eta=0) const
Accessor to the threshold value for eta-dependent threholds.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
unsigned int idxBarrel() const
unsigned int idxEndcap() const
const std::string & rpcFlags() const
unsigned int idxForward() const
const std::string & rpcExclROIList() const
uint32_t roiWord() const
The "raw" RoI word describing the muon candidate.