ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigGepPerf
src
GepClusterTimingAlg.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
./GepClusterTimingAlg.h
"
6
#include "
xAODCaloEvent/CaloClusterContainer.h
"
7
#include "
xAODCaloEvent/CaloClusterAuxContainer.h
"
8
9
GepClusterTimingAlg::GepClusterTimingAlg
(
const
std::string& name, ISvcLocator* pSvcLocator) :
10
AthReentrantAlgorithm
(name, pSvcLocator){
11
}
12
13
14
GepClusterTimingAlg::~GepClusterTimingAlg
() {}
15
16
17
StatusCode
GepClusterTimingAlg::initialize
() {
18
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
);
19
20
// Initialize data access keys
21
CHECK
(
m_inCaloClustersKey
.initialize());
22
CHECK
(
m_outCaloClustersKey
.initialize());
23
24
return
StatusCode::SUCCESS;
25
}
26
27
StatusCode
GepClusterTimingAlg::finalize
() {
28
ATH_MSG_INFO
(
"Finalizing "
<< name() <<
"..."
);
29
30
return
StatusCode::SUCCESS;
31
}
32
33
StatusCode
GepClusterTimingAlg::execute
(
const
EventContext& ctx)
const
{
34
ATH_MSG_DEBUG
(
"Executing "
<< name() <<
"..."
);
35
36
// This is a filtering Algorithm: it writes out a CaloClusterCollection obtained
37
// filed by clusters selected from an input CaloClusterCollection, and writes
38
// out the selected clusters to s view contsainer (ie no copying)
39
40
// read in clusters
41
auto
h_inCaloClusters =
SG::makeHandle
(
m_inCaloClustersKey
, ctx);
42
CHECK
(h_inCaloClusters.isValid());
43
ATH_MSG_DEBUG
(
"Read in "
<< (h_inCaloClusters->size()) <<
" clusters"
);
44
45
46
auto
h_outCaloClusters =
SG::makeHandle
(
m_outCaloClustersKey
, ctx);
47
48
CHECK
(h_outCaloClusters.record(std::make_unique<
ConstDataVector<xAOD::CaloClusterContainer>
>(
SG::VIEW_ELEMENTS
)));
49
50
51
const
static
SG::AuxElement::ConstAccessor<float> acc_larq(
"AVG_LAR_Q"
);
52
const
static
SG::AuxElement::ConstAccessor<float> acc_clambda(
"CENTER_LAMBDA"
);
53
54
// select clusters
55
for
(
const
auto
cluster : *h_inCaloClusters) {
56
57
float
time = cluster->time();
58
float
quality = acc_larq(*cluster)/65535;
59
float
lambda_center = acc_clambda(*cluster);
60
61
float
timeCut = quality >
m_qualityCut
?
m_timeCutLargeQ
:
m_timeCutSmallQ
;
62
if
(lambda_center <
m_lambdaCalDivide
&& std::abs(cluster->eta()) <
m_etaCut
) {
63
if
( abs(time) > timeCut )
continue
;
64
}
65
66
// record cluster if selected
67
h_outCaloClusters->push_back(cluster);
68
69
}
70
71
ATH_MSG_DEBUG
(
"Read In "
<< h_inCaloClusters->size() <<
" Selected "
<< h_outCaloClusters->size());
72
73
return
StatusCode::SUCCESS;
74
}
75
76
77
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloClusterAuxContainer.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
CaloClusterContainer.h
GepClusterTimingAlg.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition
ConstDataVector.h:76
GepClusterTimingAlg::m_outCaloClustersKey
SG::WriteHandleKey< ConstDataVector< xAOD::CaloClusterContainer > > m_outCaloClustersKey
Definition
GepClusterTimingAlg.h:30
GepClusterTimingAlg::~GepClusterTimingAlg
virtual ~GepClusterTimingAlg()
Definition
GepClusterTimingAlg.cxx:14
GepClusterTimingAlg::execute
virtual StatusCode execute(const EventContext &) const
Definition
GepClusterTimingAlg.cxx:33
GepClusterTimingAlg::initialize
virtual StatusCode initialize()
Definition
GepClusterTimingAlg.cxx:17
GepClusterTimingAlg::m_lambdaCalDivide
Gaudi::Property< float > m_lambdaCalDivide
Definition
GepClusterTimingAlg.h:34
GepClusterTimingAlg::m_qualityCut
Gaudi::Property< float > m_qualityCut
Definition
GepClusterTimingAlg.h:35
GepClusterTimingAlg::GepClusterTimingAlg
GepClusterTimingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
GepClusterTimingAlg.cxx:9
GepClusterTimingAlg::finalize
virtual StatusCode finalize()
Definition
GepClusterTimingAlg.cxx:27
GepClusterTimingAlg::m_inCaloClustersKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_inCaloClustersKey
Definition
GepClusterTimingAlg.h:26
GepClusterTimingAlg::m_timeCutLargeQ
Gaudi::Property< float > m_timeCutLargeQ
Definition
GepClusterTimingAlg.h:36
GepClusterTimingAlg::m_timeCutSmallQ
Gaudi::Property< float > m_timeCutSmallQ
Definition
GepClusterTimingAlg.h:37
GepClusterTimingAlg::m_etaCut
Gaudi::Property< float > m_etaCut
Definition
GepClusterTimingAlg.h:38
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition
OwnershipPolicy.h:18
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
Generated on
for ATLAS Offline Software by
1.17.0