Loading [MathJax]/extensions/tex2jax.js
 |
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=
"";
215 for (
unsigned idec=0;idec<
decisions.size();++idec) {
217 std::shared_ptr<TrigConf::L1Threshold_MU> thr = std::static_pointer_cast<TrigConf::L1Threshold_MU>(
decisions[idec].
first);
218 if(std::abs(eta)<1.05){
224 if (thrValTmp > thrVal)
227 thrName = thr->
name();
230 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 313 of file TrigThresholdDecisionTool.cxx.
316 RPCFlagDecision decision(M);
320 auto previous_decision_itr = previous_decisions->second.find(decision);
321 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 400 of file TrigThresholdDecisionTool.cxx.
402 std::string shapedFlags =
flags;
403 shapedFlags.erase(std::remove_if(shapedFlags.begin(),shapedFlags.end(),::isspace),shapedFlags.end());
404 std::vector<std::string> vec_ors =
parseString(shapedFlags,
"|");
405 std::set<std::string> set_ors;
406 for(
const auto& ors : vec_ors){
407 std::vector<std::string> vec_ands =
parseString(ors,
"&");
408 std::set<std::string> set_ands;
409 for(
const auto& ands : vec_ands){
410 set_ands.insert(ands);
413 for(
const auto& ands : set_ands){
417 std::string bb =
aa.substr(0,
aa.size()-1);
421 for(
const auto& ors : set_ors){
425 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 266 of file TrigThresholdDecisionTool.cxx.
269 TGCFlagDecision decision(F,C,H);
273 auto previous_decision_itr = previous_decisions->second.find(decision);
274 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 233 of file TrigThresholdDecisionTool.cxx.
238 if (rpcExclROIList !=
"")
240 const std::map<std::string, std::vector<unsigned int> >& exclList = menuExtraInfo.
exclusionList(rpcExclROIList);
241 if (exclList.size() != 0)
244 std::stringstream sectorName;
246 int sectorNumber=sectorID;
247 if (isSideC) sectorNumber += 32;
248 if (sectorNumber < 10) sectorName <<
"0";
249 sectorName << sectorNumber;
252 auto exclROIs = exclList.find(sectorName.str());
253 if (exclROIs != exclList.end())
255 for (
auto roi_itr=exclROIs->second.begin();roi_itr!=exclROIs->second.end();roi_itr++)
257 if (*roi_itr == roi)
return true;
◆ makeRPCDecision()
void LVL1::TrigThresholdDecisionTool::makeRPCDecision |
( |
const std::string & |
rpcFlags, |
|
|
bool |
M |
|
) |
| |
|
protected |
Definition at line 325 of file TrigThresholdDecisionTool.cxx.
328 RPCFlagDecision decision(M);
330 auto previous_decision_itr = previous_decisions->find(decision);
331 if (previous_decision_itr != previous_decisions->end())
return;
332 else if (rpcFlags ==
"") {
334 previous_decisions->insert(decision);
340 bool passedFlags =
false;
341 const std::vector<std::vector<std::string> >* vec_flags = &
m_parsed_flags[rpcFlags];
342 for (
auto or_itr = vec_flags->begin();or_itr!=vec_flags->end();or_itr++)
345 bool passedAnd =
true;
346 for (
auto and_itr = or_itr->begin();and_itr!=or_itr->end();and_itr++)
348 if (*and_itr ==
"M") passedAnd = passedAnd && M;
350 passedFlags = passedFlags || passedAnd;
353 decision.pass = passedFlags;
354 previous_decisions->insert(decision);
◆ makeTGCDecision()
void LVL1::TrigThresholdDecisionTool::makeTGCDecision |
( |
const std::string & |
tgcFlags, |
|
|
bool |
F, |
|
|
bool |
C, |
|
|
bool |
H |
|
) |
| |
|
protected |
Definition at line 278 of file TrigThresholdDecisionTool.cxx.
281 TGCFlagDecision decision(F,C,H);
283 auto previous_decision_itr = previous_decisions->find(decision);
284 if (previous_decision_itr != previous_decisions->end())
return;
285 else if (tgcFlags ==
"") {
287 previous_decisions->insert(decision);
293 bool passedFlags =
false;
294 const std::vector<std::vector<std::string> >* vec_flags = &
m_parsed_flags[tgcFlags];
295 for (
auto or_itr = vec_flags->begin();or_itr!=vec_flags->end();or_itr++)
298 bool passedAnd =
true;
299 for (
auto and_itr = or_itr->begin();and_itr!=or_itr->end();and_itr++)
301 if (*and_itr ==
"F") passedAnd = passedAnd &&
F;
302 else if (*and_itr ==
"C") passedAnd = passedAnd &&
C;
303 else if (*and_itr ==
"H") passedAnd = passedAnd &&
H;
305 passedFlags = passedFlags || passedAnd;
308 decision.pass = passedFlags;
309 previous_decisions->insert(decision);
◆ parseFlags()
void LVL1::TrigThresholdDecisionTool::parseFlags |
( |
const std::string & |
flags | ) |
|
|
protected |
Definition at line 358 of file TrigThresholdDecisionTool.cxx.
365 std::vector<std::vector<std::string> > vec_flags;
366 for (
unsigned ior=0;ior<vec_ors.size();ior++)
368 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:
unsigned int ptEndcap() const
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 bool isValid() override final
Can the handle be successfully dereferenced?
unsigned int ptBarrel() const
uint32_t roiWord() const
The "raw" RoI word describing the muon candidate.