ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonReconstruction
MuonDataPrep
CscClusterization
src
CscThresholdClusterBuilder.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// CscThresholdClusterBuilder.cxx
6
#include "
CscThresholdClusterBuilder.h
"
7
8
#include <sstream>
9
10
#include "Gaudi/Property.h"
11
12
using
std::ostringstream;
13
using
std::string;
14
using
std::vector;
15
16
//******************************************************************************
17
CscThresholdClusterBuilder::CscThresholdClusterBuilder
(
const
std::string& aname, ISvcLocator* pSvcLocator) :
18
AthAlgorithm
(aname, pSvcLocator) {}
19
20
//******************************************************************************
21
22
// Destructor.
23
24
CscThresholdClusterBuilder::~CscThresholdClusterBuilder
() =
default
;
25
26
//******************************************************************************
27
28
StatusCode
CscThresholdClusterBuilder::initialize
() {
29
ATH_MSG_DEBUG
(
"Initializing "
<< name());
30
31
// Retrieve the strip fitting tool.
32
ATH_CHECK
(
m_cluster_builder
.retrieve());
33
ATH_MSG_DEBUG
(
"Retrieved strip fitting tool "
<<
m_cluster_builder
);
34
// Initialise output cluster container
35
ATH_CHECK
(
m_pclusters
.initialize());
36
ATH_CHECK
(
m_idHelperSvc
.retrieve());
37
return
StatusCode::SUCCESS;
38
}
39
40
//******************************************************************************
41
42
StatusCode
CscThresholdClusterBuilder::execute
(
const
EventContext& ctx) {
43
ATH_MSG_DEBUG
(
"Processing event "
);
44
45
// Cleanup the cluster container - ready for filling
46
if
(
m_cluster_builder
) {
47
std::vector<IdentifierHash> givenIDs;
48
std::vector<IdentifierHash> decodedIDs;
49
50
// prepare output
51
SG::WriteHandle<Muon::CscPrepDataContainer>
wh_pclusters(
m_pclusters
, ctx);
52
Muon::CscPrepDataContainer
*
object
=
new
Muon::CscPrepDataContainer
(
m_idHelperSvc
->cscIdHelper().module_hash_max());
54
if
(wh_pclusters.
record
(std::unique_ptr<Muon::CscPrepDataContainer>(
object
)).isFailure()) {
55
ATH_MSG_ERROR
(
"Could not record container of CSC Cluster PrepData at "
<<
m_pclusters
.key());
56
return
StatusCode::RECOVERABLE;
57
}
58
59
if
(
m_cluster_builder
->getClusters(givenIDs, decodedIDs,
object
).isFailure()) {
60
ATH_MSG_ERROR
(
"CSC cluster building failed"
);
61
return
StatusCode::FAILURE;
62
}
63
}
else
{
64
ATH_MSG_ERROR
(
"No cluster builder tool initialised"
);
65
return
StatusCode::FAILURE;
66
}
67
68
return
StatusCode::SUCCESS;
69
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CscThresholdClusterBuilder.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
CscThresholdClusterBuilder::CscThresholdClusterBuilder
CscThresholdClusterBuilder(const std::string &name, ISvcLocator *pSvcLocator)
Definition
CscThresholdClusterBuilder.cxx:17
CscThresholdClusterBuilder::m_cluster_builder
ToolHandle< ICscClusterBuilder > m_cluster_builder
Definition
CscThresholdClusterBuilder.h:93
CscThresholdClusterBuilder::~CscThresholdClusterBuilder
~CscThresholdClusterBuilder()
CscThresholdClusterBuilder::execute
StatusCode execute(const EventContext &ctx)
Execute method.
Definition
CscThresholdClusterBuilder.cxx:42
CscThresholdClusterBuilder::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
CscThresholdClusterBuilder.h:99
CscThresholdClusterBuilder::initialize
StatusCode initialize()
Definition
CscThresholdClusterBuilder.cxx:28
CscThresholdClusterBuilder::m_pclusters
SG::WriteHandleKey< Muon::CscPrepDataContainer > m_pclusters
Definition
CscThresholdClusterBuilder.h:105
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Muon::CscPrepDataContainer
MuonPrepDataContainerT< CscPrepData > CscPrepDataContainer
Definition
MuonPrepDataContainer.h:97
Generated on
for ATLAS Offline Software by
1.17.0