ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCompetingClustersOnTrackCreator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <list>
8#include <vector>
9
14
15namespace Muon {
16
18
19 ATH_MSG_VERBOSE("MuonCompetingClustersOnTrackCreator::Initializing");
20 ATH_CHECK(m_clusterCreator.retrieve());
21
22 return StatusCode::SUCCESS;
23}
24
25std::unique_ptr<CompetingMuonClustersOnTrack>
27 const std::list<const Trk::PrepRawData*>& prds,
28 const double errorScaleFactor) const {
29 if (prds.empty()) {
30 ATH_MSG_WARNING("Empty prepdata list");
31 return nullptr;
32 }
33 // implement cluster formation
34 std::vector<std::unique_ptr<const MuonClusterOnTrack>>rios{};;
35 auto assocProbs = std::vector<double>();
36 const double prob = 1. / (errorScaleFactor * errorScaleFactor);
37 for (const Trk::PrepRawData* prd : prds) {
38 Identifier id = prd->identify();
39 const Trk::TrkDetElementBase* detEl = prd->detectorElement();
40 const Amg::Vector3D gHitPos = detEl->center(id);
41 std::unique_ptr<const Muon::MuonClusterOnTrack> cluster{m_clusterCreator->createRIO_OnTrack(*prd, gHitPos)};
42 if (!cluster) {
43 ATH_MSG_WARNING("No cluster..." << (*prd));
44 continue;
45 }
46 rios.push_back(std::move(cluster));
47 assocProbs.push_back(prob);
48 }
49 return std::make_unique<CompetingMuonClustersOnTrack>(
50 std::move(rios), std::move(assocProbs));
51}
52} // namespace Muon
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::unique_ptr< CompetingMuonClustersOnTrack > createBroadCluster(const std::list< const Trk::PrepRawData * > &, const double errorScaleFactor) const
method to create a CompetingMuonClustersOnTrack using the PrepRawData hits and a scaled factor for th...
ToolHandle< Muon::IMuonClusterOnTrackCreator > m_clusterCreator
This is the base class for all tracking detector elements with read-out relevant information.
virtual const Amg::Vector3D & center() const =0
Return the center of the element.
Eigen::Matrix< double, 3, 1 > Vector3D
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.