|
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 for (
unsigned idec=0;idec<
decisions.size();++idec) {
216 std::shared_ptr<TrigConf::L1Threshold> thr =
decisions[idec].first;
220 thrName = thr->
name();
223 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) {
132 if (thr->region().find(
"ALL") == std::string::npos &&
133 thr->region().find(
"BA") == std::string::npos)
continue;
137 if (
isExcludedRPCROI(muThrExtraInfo, thr->rpcExclROIList(), roi, sectorID, isSideC))
continue;
139 if (ptword >= thr->idxBarrel()) {
149 if (thr->region().find(
"ALL") == std::string::npos &&
150 thr->region().find(
"EC") == std::string::npos)
continue;
152 if (ptword >= thr->idxEndcap()) {
159 if (thr->region().find(
"ALL") == std::string::npos &&
160 thr->region().find(
"FW") == std::string::npos)
continue;
162 if (ptword >= thr->idxForward()) {
173 thresholdsPattern |= (1 << thr->mapping());
178 return thresholdsPattern;
◆ getRPCDecision()
bool LVL1::TrigThresholdDecisionTool::getRPCDecision |
( |
const std::string & |
rpcFlags, |
|
|
bool |
M |
|
) |
| const |
|
protected |
Definition at line 306 of file TrigThresholdDecisionTool.cxx.
309 RPCFlagDecision decision(M);
313 auto previous_decision_itr = previous_decisions->second.find(decision);
314 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 393 of file TrigThresholdDecisionTool.cxx.
395 std::string shapedFlags =
flags;
396 shapedFlags.erase(std::remove_if(shapedFlags.begin(),shapedFlags.end(),::isspace),shapedFlags.end());
397 std::vector<std::string> vec_ors =
parseString(shapedFlags,
"|");
398 std::set<std::string> set_ors;
399 for(
const auto& ors : vec_ors){
400 std::vector<std::string> vec_ands =
parseString(ors,
"&");
401 std::set<std::string> set_ands;
402 for(
const auto& ands : vec_ands){
403 set_ands.insert(ands);
406 for(
const auto& ands : set_ands){
410 std::string bb =
aa.substr(0,
aa.size()-1);
414 for(
const auto& ors : set_ors){
418 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 259 of file TrigThresholdDecisionTool.cxx.
262 TGCFlagDecision decision(F,C,H);
266 auto previous_decision_itr = previous_decisions->second.find(decision);
267 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 226 of file TrigThresholdDecisionTool.cxx.
231 if (rpcExclROIList !=
"")
233 const std::map<std::string, std::vector<unsigned int> >& exclList = menuExtraInfo.
exclusionList(rpcExclROIList);
234 if (exclList.size() != 0)
237 std::stringstream sectorName;
239 int sectorNumber=sectorID;
240 if (isSideC) sectorNumber += 32;
241 if (sectorNumber < 10) sectorName <<
"0";
242 sectorName << sectorNumber;
245 auto exclROIs = exclList.find(sectorName.str());
246 if (exclROIs != exclList.end())
248 for (
auto roi_itr=exclROIs->second.begin();roi_itr!=exclROIs->second.end();roi_itr++)
250 if (*roi_itr == roi)
return true;
◆ makeRPCDecision()
void LVL1::TrigThresholdDecisionTool::makeRPCDecision |
( |
const std::string & |
rpcFlags, |
|
|
bool |
M |
|
) |
| |
|
protected |
Definition at line 318 of file TrigThresholdDecisionTool.cxx.
321 RPCFlagDecision decision(M);
323 auto previous_decision_itr = previous_decisions->find(decision);
324 if (previous_decision_itr != previous_decisions->end())
return;
325 else if (rpcFlags ==
"") {
327 previous_decisions->insert(decision);
333 bool passedFlags =
false;
334 const std::vector<std::vector<std::string> >* vec_flags = &
m_parsed_flags[rpcFlags];
335 for (
auto or_itr = vec_flags->begin();or_itr!=vec_flags->end();or_itr++)
338 bool passedAnd =
true;
339 for (
auto and_itr = or_itr->begin();and_itr!=or_itr->end();and_itr++)
341 if (*and_itr ==
"M") passedAnd = passedAnd && M;
343 passedFlags = passedFlags || passedAnd;
346 decision.pass = passedFlags;
347 previous_decisions->insert(decision);
◆ makeTGCDecision()
void LVL1::TrigThresholdDecisionTool::makeTGCDecision |
( |
const std::string & |
tgcFlags, |
|
|
bool |
F, |
|
|
bool |
C, |
|
|
bool |
H |
|
) |
| |
|
protected |
Definition at line 271 of file TrigThresholdDecisionTool.cxx.
274 TGCFlagDecision decision(F,C,H);
276 auto previous_decision_itr = previous_decisions->find(decision);
277 if (previous_decision_itr != previous_decisions->end())
return;
278 else if (tgcFlags ==
"") {
280 previous_decisions->insert(decision);
286 bool passedFlags =
false;
287 const std::vector<std::vector<std::string> >* vec_flags = &
m_parsed_flags[tgcFlags];
288 for (
auto or_itr = vec_flags->begin();or_itr!=vec_flags->end();or_itr++)
291 bool passedAnd =
true;
292 for (
auto and_itr = or_itr->begin();and_itr!=or_itr->end();and_itr++)
294 if (*and_itr ==
"F") passedAnd = passedAnd &&
F;
295 else if (*and_itr ==
"C") passedAnd = passedAnd &&
C;
296 else if (*and_itr ==
"H") passedAnd = passedAnd &&
H;
298 passedFlags = passedFlags || passedAnd;
301 decision.pass = passedFlags;
302 previous_decisions->insert(decision);
◆ parseFlags()
void LVL1::TrigThresholdDecisionTool::parseFlags |
( |
const std::string & |
flags | ) |
|
|
protected |
Definition at line 351 of file TrigThresholdDecisionTool.cxx.
358 std::vector<std::vector<std::string> > vec_flags;
359 for (
unsigned ior=0;ior<vec_ors.size();ior++)
361 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()) {
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:
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
virtual const std::string & name() const final
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
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?
uint32_t roiWord() const
The "raw" RoI word describing the muon candidate.