ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkL1Calo
src
SaturatedTriggerTower.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// SaturatedTriggerTower.cxx, (c) ATLAS Detector software
8
// Author: Ben Allen (benjamin.william.allen@cern.ch)
9
// Adapted heavily from code originally written by
10
// James Catmore (james.catmore@cern.ch)
11
//
12
13
#include "
DerivationFrameworkL1Calo/SaturatedTriggerTower.h
"
14
#include "
xAODTrigL1Calo/TriggerTowerContainer.h
"
15
#include <vector>
16
#include <string>
17
18
namespace
DerivationFramework
{
19
20
SaturatedTriggerTower::SaturatedTriggerTower
(
const
std::string& t,
21
const
std::string& n,
22
const
IInterface* p) :
23
base_class(t,n,p),
24
m_adcThreshold
(0),
25
m_collName
(
"xAODTriggerTowers"
)
26
{
27
declareProperty(
"TriggerTowerContainer"
,
m_collName
);
28
declareProperty(
"adcThreshold"
,
m_adcThreshold
);
29
}
30
31
StatusCode
SaturatedTriggerTower::initialize
()
32
{
33
ATH_MSG_VERBOSE
(
"initialize() ..."
);
34
return
StatusCode::SUCCESS;
35
}
36
37
StatusCode
SaturatedTriggerTower::finalize
()
38
{
39
return
StatusCode::SUCCESS;
40
}
41
42
bool
SaturatedTriggerTower::eventPassesFilter
(
const
EventContext&
/*ctx*/
)
const
43
{
44
bool
acceptEvent(
false
);
45
46
// check for triggertowers
47
if
(evtStore()->
contains<xAOD::TriggerTowerContainer>
(
m_collName
)) {
48
49
// Retrieve data
50
const
xAOD::TriggerTowerContainer
* triggertowers(
nullptr
);
51
CHECK
( evtStore()->retrieve( triggertowers ,
m_collName
),
false
);
52
53
if
( !triggertowers ) {
54
ATH_MSG_ERROR
(
"Couldn't retrieve triggertower container with key: "
<<
m_collName
);
55
return
false
;
56
}
57
// LOOP OVER TRIGGERTOWERS
58
int
adcvalue(0);
59
for
(
xAOD::TriggerTowerContainer::const_iterator
eIt = triggertowers->
begin
(); eIt!=triggertowers->
end
(); ++eIt) {
60
for
(
int
i=0; i<5; i++){
61
adcvalue = (*eIt)->adc()[i];
62
if
(adcvalue >
m_adcThreshold
){
63
acceptEvent =
true
;
64
return
acceptEvent;
65
}
66
}
67
}
68
69
}
// check for trigger towers
70
71
return
acceptEvent;
72
}
73
74
}
// end of namespace
75
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
SaturatedTriggerTower.h
TriggerTowerContainer.h
DataVector< xAOD::TriggerTower_v2 >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
DerivationFramework::SaturatedTriggerTower::eventPassesFilter
virtual bool eventPassesFilter(const EventContext &ctx) const
Definition
SaturatedTriggerTower.cxx:42
DerivationFramework::SaturatedTriggerTower::m_adcThreshold
int m_adcThreshold
Definition
SaturatedTriggerTower.h:28
DerivationFramework::SaturatedTriggerTower::SaturatedTriggerTower
SaturatedTriggerTower(const std::string &t, const std::string &n, const IInterface *p)
Definition
SaturatedTriggerTower.cxx:20
DerivationFramework::SaturatedTriggerTower::m_collName
std::string m_collName
Definition
SaturatedTriggerTower.h:29
DerivationFramework::SaturatedTriggerTower::initialize
StatusCode initialize()
Definition
SaturatedTriggerTower.cxx:31
DerivationFramework::SaturatedTriggerTower::finalize
StatusCode finalize()
Definition
SaturatedTriggerTower.cxx:37
contains
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
Definition
hcg.cxx:116
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
xAOD::TriggerTowerContainer
TriggerTowerContainer_v2 TriggerTowerContainer
Define the latest version of the TriggerTower container.
Definition
TriggerTowerContainer.h:15
Generated on
for ATLAS Offline Software by
1.17.0