ATLAS Offline Software
MuonCompetingClustersOnTrackCreator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Implementation file for class MuonCompetingClustersOnTrackCreator
8 // (c) ATLAS Detector software
10 // AlgTool used for MuonCompetingClustersOnTrack object production
12 // Version 1.0 18/07/2004
14 
17 
21 
22 #include <list>
23 #include <vector>
24 
25 
26 namespace Muon {
27 
29  (const std::string& ty,const std::string& na,const IInterface* pa)
30  : AthAlgTool(ty,na,pa)
31  {
32  // algtool interface - necessary!
33  declareInterface<IMuonCompetingClustersOnTrackCreator>(this);
34  }
35 
37  {
38 
39  ATH_MSG_VERBOSE("MuonCompetingClustersOnTrackCreator::Initializing");
40  ATH_CHECK( m_clusterCreator.retrieve() );
41 
42  return StatusCode::SUCCESS;
43  }
44 
45  std::unique_ptr<CompetingMuonClustersOnTrack>
46  MuonCompetingClustersOnTrackCreator::createBroadCluster(const std::list< const Trk::PrepRawData * > & prds, const double errorScaleFactor ) const
47  {
48  if (prds.empty()) return nullptr;
49 
50 // implement cluster formation
51  auto rios = std::vector <const Muon::MuonClusterOnTrack* >() ;
52  auto assocProbs = std::vector < double >();
53  std::list< const Trk::PrepRawData* >::const_iterator it = prds.begin();
54  std::list< const Trk::PrepRawData* >::const_iterator it_end = prds.end();
55  const double prob = 1./(errorScaleFactor*errorScaleFactor);
56  for( ;it!=it_end;++it ){
57  Identifier id = (*it)->identify();
58  const Trk::TrkDetElementBase* detEl = (*it)->detectorElement();
59  const Amg::Vector3D gHitPos = detEl->center(id);
60  const Muon::MuonClusterOnTrack* cluster = m_clusterCreator->createRIO_OnTrack( **it, gHitPos );
61  rios.push_back( cluster );
62  assocProbs.push_back( prob );
63  }
64  return std::make_unique<CompetingMuonClustersOnTrack>( std::move(rios), std::move(assocProbs) );
65  }
66 }
skel.it
it
Definition: skel.GENtoEVGEN.py:396
CompetingMuonClustersOnTrack.h
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Muon::MuonCompetingClustersOnTrackCreator::initialize
virtual StatusCode initialize()
Definition: MuonCompetingClustersOnTrackCreator.cxx:36
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
covarianceTool.prob
prob
Definition: covarianceTool.py:678
Muon::MuonCompetingClustersOnTrackCreator::MuonCompetingClustersOnTrackCreator
MuonCompetingClustersOnTrackCreator(const std::string &, const std::string &, const IInterface *)
Definition: MuonCompetingClustersOnTrackCreator.cxx:29
PrepRawData.h
Muon::MuonCompetingClustersOnTrackCreator::m_clusterCreator
ToolHandle< Muon::IMuonClusterOnTrackCreator > m_clusterCreator
Definition: MuonCompetingClustersOnTrackCreator.h:38
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Muon::MuonCompetingClustersOnTrackCreator::createBroadCluster
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...
Definition: MuonCompetingClustersOnTrackCreator.cxx:46
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonCompetingClustersOnTrackCreator.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonDetectorManager.h
MuonClusterOnTrack.h
AthAlgTool
Definition: AthAlgTool.h:26
Trk::TrkDetElementBase::center
virtual const Amg::Vector3D & center() const =0
Return the center of the element.
Muon::MuonClusterOnTrack
Base class for Muon cluster RIO_OnTracks.
Definition: MuonClusterOnTrack.h:34
Identifier
Definition: IdentifierFieldParser.cxx:14