ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMuonEFIsolation.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
8#include <cmath>
9
10// "Distance" used by the comparison operator(s):
11static const double DELTA = 0.001;
12
28
32TrigMuonEFIsolation::TrigMuonEFIsolation(const float trkptcone02, const float trkptcone03) :
33 m_sumTrkPtCone02(trkptcone02),
34 m_sumTrkPtCone03(trkptcone03),
35 m_sumEtCone01(-1.0),
36 m_sumEtCone02(-1.0),
37 m_sumEtCone03(-1.0),
38 m_sumEtCone04(-1.0),
39 m_trkPos(-1),
40 m_muonEFLink() {
41
42}
43
55
77
91
98 m_muonEFLink.reset();
99 m_muonEFLink.toIndexedElement(*infocont, pos);
100}
101
107 m_trkPos = itrk;
108}
109
119
120
121
123 if(!m_muonEFLink.isValid()) return 0;
124 return *m_muonEFLink;
125}
126
130
132
133 const TrigMuonEFInfo* info = getMuonInfo();
134 if(!info) return 0;
135 if(!info->TrackContainer()) {
136 std::cerr << "WARNING: TrigMuonEFInfo object has no TrackContainer" << std::endl;
137 return 0;
138 }
139 if(m_trkPos >= ((int)info->TrackContainer()->size()) || m_trkPos < 0) {
140 std::cerr << "WARNING TrigMuonEFInfo object has " << info->TrackContainer()->size() << " but tried to get InfoTrack " << m_trkPos << std::endl;
141 return 0;
142 }
143
144 return (*info->TrackContainer())[m_trkPos];
145}
146
152 if( std::abs( a.sumTrkPtCone02() - b.sumTrkPtCone02() ) > DELTA )
153 return false;
154 if( std::abs( a.sumTrkPtCone03() - b.sumTrkPtCone03() ) > DELTA )
155 return false;
156 if( std::abs( a.sumEtCone01() - b.sumEtCone01() ) > DELTA )
157 return false;
158 if( std::abs( a.sumEtCone02() - b.sumEtCone02() ) > DELTA )
159 return false;
160 if( std::abs( a.sumEtCone03() - b.sumEtCone03() ) > DELTA )
161 return false;
162 if( std::abs( a.sumEtCone04() - b.sumEtCone04() ) > DELTA )
163 return false;
164 if( a.trackPosition() != b.trackPosition() )
165 return false;
166 if( a.getEFMuonInfoTrack() != b.getEFMuonInfoTrack() )
167 return false;
168
169 return true;
170}
static const double DELTA
static Double_t a
bool operator==(const TrigMuonEFIsolation &a, const TrigMuonEFIsolation &b)
This operator checks whether two TrigMuonEFIsolation objects are the same based on the private member...
EDM class for holding results of EF muon isolation calculation.
int m_trkPos
Position of the TrigMuonEFInfoTrack within the TrigMuonEFInfo object.
const ElementLink< TrigMuonEFInfoContainer > & getMuonInfoLink() const
ElementLink< TrigMuonEFInfoContainer > m_muonEFLink
Element link to TrigMuonEFInfo.
const TrigMuonEFInfoTrack * getEFMuonInfoTrack() const
Access the muon we calculated the isolation for.
void setEFMuonInfoTrackLink(const int itrk)
Set the link to the muon we calculated the isolation for.
TrigMuonEFIsolation()
Default constructor.
void setEFMuonInfoLink(const TrigMuonEFInfoContainer *infocont, const int pos)
set the link to the EF muon we calculated the isolation for
void setEFMuonInfoElementLink(const ElementLink< TrigMuonEFInfoContainer > link)
set the element link to the TrigMuonEFInfo object we are using
TrigMuonEFIsolation & operator=(const TrigMuonEFIsolation &rhs)
Assignment operator.
const TrigMuonEFInfo * getMuonInfo() const
Access the muon info object we calculated the isolation for.