ATLAS Offline Software
Loading...
Searching...
No Matches
MuonTrackParticleAssociationTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id$
12
13
16
17
18namespace D3PD {
19
20
28 (const std::string& type,
29 const std::string& name,
30 const IInterface* parent)
31 : Base (type, name, parent),
33{
34 declareProperty ("Type", m_typeprop = "Primary",
35 "Which TrackParticle to return. One of "
36 "Primary, Combined, "
37 "InDet, InDetOrPrimary, MuonSpectrometer");
38}
39
40
45{
46 CHECK( Base::initialize() );
47
48 if (m_typeprop == "Primary")
50 else if (m_typeprop == "Combined")
52 else if (m_typeprop == "InDet")
53 m_type = INDET;
54 else if (m_typeprop == "InDetOrPrimary")
56 else if (m_typeprop == "MuonSpectrometer") {
58 REPORT_MESSAGE(MSG::INFO) << "called with type : MuonSpectrometer" << m_typeprop;
59 }
60 else {
61 REPORT_MESSAGE(MSG::ERROR) << "Bad type property " << m_typeprop;
62 return StatusCode::FAILURE;
63 }
64 return StatusCode::SUCCESS;
65}
66
67
76{
77 switch (m_type) {
78 case PRIMARY:
79 return p.primaryTrackParticle();
80 case COMBINED:
81 return p.trackParticle (xAOD::Muon::CombinedTrackParticle);
82 case INDET:
83 return p.trackParticle (xAOD::Muon::InnerDetectorTrackParticle);
85 return p.trackParticle (xAOD::Muon::MuonSpectrometerTrackParticle);
87 {
88 const xAOD::TrackParticle* t = p.trackParticle (xAOD::Muon::InnerDetectorTrackParticle);
89 if (!t)
90 t = p.primaryTrackParticle();
91 return t;
92 }
93 }
94 std::abort();
95}
96
97
98} // namespace D3PD
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
#define CHECK(...)
Evaluate an expression and check for errors.
Associate from an egamma to its primary TrackParticle.
StatusCode initialize()
Standard Gaudi initialize method.
MuonTrackParticleAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
SingleAssociationTool< xAOD::Muon, xAOD::TrackParticle > Base
enum D3PD::MuonTrackParticleAssociationTool::@372270170125360343007163127121224053354206170074 m_type
virtual const xAOD::TrackParticle * get(const xAOD::Muon &p)
Return the target object.
std::string m_typeprop
Property: Which track particle should we return.
Block filler tool for noisy FEB information.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version: