ATLAS Offline Software
Loading...
Searching...
No Matches
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
7
8#include <sstream>
9
10#include "Gaudi/Property.h"
11
12using std::ostringstream;
13using std::string;
14using std::vector;
15
16//******************************************************************************
17CscThresholdClusterBuilder::CscThresholdClusterBuilder(const std::string& aname, ISvcLocator* pSvcLocator) :
18 AthAlgorithm(aname, pSvcLocator) {}
19
20//******************************************************************************
21
22// Destructor.
23
25
26//******************************************************************************
27
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
43 ATH_MSG_DEBUG("Processing event ");
44
45 // Cleanup the cluster container - ready for filling
47 std::vector<IdentifierHash> givenIDs;
48 std::vector<IdentifierHash> decodedIDs;
49
50 // prepare output
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
CscThresholdClusterBuilder(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandle< ICscClusterBuilder > m_cluster_builder
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::WriteHandleKey< Muon::CscPrepDataContainer > m_pclusters
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
MuonPrepDataContainerT< CscPrepData > CscPrepDataContainer