ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkTools
src
TriggerSkimmingTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// TriggerSkimmingTool.cxx, (c) ATLAS Detector software
8
// Author: James Catmore (james.catmore@cern.ch)
9
//
10
// Direct skimming via TrigDecisionTool
11
// Only intended for cases where the triggers in question cannot be
12
// handled by ExpressionEvaluation (dashes, dots)
13
14
#include "
DerivationFrameworkTools/TriggerSkimmingTool.h
"
15
16
#include <vector>
17
#include <string>
18
19
20
21
namespace
DerivationFramework
{
22
23
TriggerSkimmingTool::TriggerSkimmingTool
(
const
std::string& t,
24
const
std::string& n,
25
const
IInterface* p) :
26
base_class(t,n,p) {
27
28
}
29
30
StatusCode
TriggerSkimmingTool::initialize
()
31
{
32
ATH_CHECK
(
m_trigDec
.retrieve());
33
return
StatusCode::SUCCESS;
34
}
35
36
37
38
bool
TriggerSkimmingTool::eventPassesFilter
(
const
EventContext&
/*ctx*/
)
const
39
{
40
41
if
(msgLvl(MSG::VERBOSE)){
42
const
Trig::ChainGroup
* Chain =
m_trigDec
->getChainGroup(
".*"
);
43
const
std::vector<std::string> fired_triggers = Chain->
getListOfTriggers
();
44
for
(
const
std::string& fired : fired_triggers) {
45
if
(
m_trigDec
->isPassed(fired))
ATH_MSG_VERBOSE
(
"Fired trigger "
<<fired);
46
}
47
}
48
49
unsigned
int
cntrAND{0}, cntrOR{0}, cntrORHLTOnly{0};
50
for
(
const
std::string& trig_and :
m_triggerListAND
) {
51
ATH_MSG_DEBUG
(
"AND - Trigger "
<<trig_and<<
" passed "
<<
m_trigDec
->isPassed(trig_and));
52
cntrAND+=(
m_trigDec
->isPassed(trig_and));
53
}
54
for
(
const
std::string& trig_or :
m_triggerListOR
) {
55
ATH_MSG_DEBUG
(
"OR - Trigger "
<<trig_or<<
" passed "
<<
m_trigDec
->isPassed(trig_or));
56
cntrOR +=(
m_trigDec
->isPassed(trig_or));
57
}
58
for
(
const
std::string& trig_orhltonly :
m_triggerListORHLTOnly
) {
59
ATH_MSG_DEBUG
(
"ORHLTOnly - Trigger "
<<trig_orhltonly<<
" passed "
<<
m_trigDec
->isPassed(trig_orhltonly,
TrigDefs::requireDecision
));
60
cntrORHLTOnly +=(
m_trigDec
->isPassed(trig_orhltonly,
TrigDefs::requireDecision
));
61
}
62
63
bool
passAND = (cntrAND==
m_triggerListAND
.size() && !
m_triggerListAND
.empty());
64
bool
passOR
= (cntrOR > 0);
65
bool
passORHLTOnly = (cntrORHLTOnly > 0);
66
67
bool
pass = passAND ||
passOR
|| passORHLTOnly;
68
return
pass;
69
}
70
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
passOR
@ passOR
Definition
SUSYToolsTester.cxx:100
TriggerSkimmingTool.h
DerivationFramework::TriggerSkimmingTool::TriggerSkimmingTool
TriggerSkimmingTool(const std::string &t, const std::string &n, const IInterface *p)
Definition
TriggerSkimmingTool.cxx:23
DerivationFramework::TriggerSkimmingTool::initialize
StatusCode initialize() override
Definition
TriggerSkimmingTool.cxx:30
DerivationFramework::TriggerSkimmingTool::m_triggerListAND
Gaudi::Property< std::vector< std::string > > m_triggerListAND
Definition
TriggerSkimmingTool.h:28
DerivationFramework::TriggerSkimmingTool::m_triggerListOR
Gaudi::Property< std::vector< std::string > > m_triggerListOR
Definition
TriggerSkimmingTool.h:29
DerivationFramework::TriggerSkimmingTool::m_trigDec
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
Definition
TriggerSkimmingTool.h:31
DerivationFramework::TriggerSkimmingTool::eventPassesFilter
bool eventPassesFilter(const EventContext &ctx) const override
Definition
TriggerSkimmingTool.cxx:38
DerivationFramework::TriggerSkimmingTool::m_triggerListORHLTOnly
Gaudi::Property< std::vector< std::string > > m_triggerListORHLTOnly
Definition
TriggerSkimmingTool.h:30
Trig::ChainGroup
Definition
ChainGroup.h:51
Trig::ChainGroup::getListOfTriggers
std::vector< std::string > getListOfTriggers() const
Definition
ChainGroup.cxx:467
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
TrigDefs::requireDecision
static const unsigned int requireDecision
Definition
TrigEvent/TrigDecisionInterface/TrigDecisionInterface/Conditions.h:25
Generated on
for ATLAS Offline Software by
1.17.0