ATLAS Offline Software
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):
11 static const double DELTA = 0.001;
12 
17  m_sumTrkPtCone02(-1.0),
18  m_sumTrkPtCone03(-1.0),
19  m_sumEtCone01(-1.0),
20  m_sumEtCone02(-1.0),
21  m_sumEtCone03(-1.0),
22  m_sumEtCone04(-1.0),
23  m_trkPos(-1),
24  m_muonEFLink()
25 {
26 
27 }
28 
32 TrigMuonEFIsolation::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 
45  m_sumTrkPtCone02( iso.m_sumTrkPtCone02 ),
46  m_sumTrkPtCone03( iso.m_sumTrkPtCone03 ),
47  m_sumEtCone01(iso.m_sumEtCone01 ),
48  m_sumEtCone02(iso.m_sumEtCone02 ),
49  m_sumEtCone03(iso.m_sumEtCone03 ),
50  m_sumEtCone04(iso.m_sumEtCone04 ),
51  m_trkPos( iso.m_trkPos),
52  m_muonEFLink( iso.m_muonEFLink ) {
53 
54 }
55 
57  m_sumTrkPtCone02( -1.0 ),
58  m_sumTrkPtCone03( -1.0 ),
59  m_sumEtCone01(-1.0),
60  m_sumEtCone02(-1.0),
61  m_sumEtCone03(-1.0),
62  m_sumEtCone04(-1.0),
63  m_trkPos( -1 ),
64  m_muonEFLink() {
65 
66  if(iso) {
73  m_trkPos = iso->m_trkPos;
75  }
76 }
77 
79  if( this != &rhs ) {
86  m_trkPos = rhs.m_trkPos;
88  }
89  return *this;
90 }
91 
99  m_muonEFLink.toIndexedElement(*infocont, pos);
100 }
101 
107  m_trkPos = itrk;
108 }
109 
115 
116  m_muonEFLink = link;
117 
118 }
119 
120 
121 
123  if(!m_muonEFLink.isValid()) return 0;
124  return *m_muonEFLink;
125 }
126 
128  return m_muonEFLink;
129 }
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 }
grepfile.info
info
Definition: grepfile.py:38
TrigMuonEFIsolation::m_sumEtCone02
float m_sumEtCone02
Definition: TrigMuonEFIsolation.h:103
operator==
bool operator==(const TrigMuonEFIsolation &a, const TrigMuonEFIsolation &b)
This operator checks whether two TrigMuonEFIsolation objects are the same based on the private member...
Definition: TrigMuonEFIsolation.cxx:151
TrigMuonEFIsolation::getMuonInfoLink
const ElementLink< TrigMuonEFInfoContainer > & getMuonInfoLink() const
Definition: TrigMuonEFIsolation.cxx:127
TrigMuonEFIsolation::m_muonEFLink
ElementLink< TrigMuonEFInfoContainer > m_muonEFLink
Element link to TrigMuonEFInfo.
Definition: TrigMuonEFIsolation.h:115
TrigMuonEFInfoContainer
Definition: TrigMuonEFInfoContainer.h:27
TrigMuonEFInfoTrack.h
TrigMuonEFIsolation::m_trkPos
int m_trkPos
Position of the TrigMuonEFInfoTrack within the TrigMuonEFInfo object.
Definition: TrigMuonEFIsolation.h:112
TrigMuonEFIsolation.h
TrigMuonEFIsolation::operator=
TrigMuonEFIsolation & operator=(const TrigMuonEFIsolation &rhs)
Assignment operator.
Definition: TrigMuonEFIsolation.cxx:78
TrigMuonEFIsolation
Definition: TrigMuonEFIsolation.h:24
TrigMuonEFIsolation::m_sumEtCone01
float m_sumEtCone01
Definition: TrigMuonEFIsolation.h:100
TrigMuonEFIsolation::m_sumTrkPtCone02
float m_sumTrkPtCone02
Definition: TrigMuonEFIsolation.h:95
TrigMuonEFIsolation::TrigMuonEFIsolation
TrigMuonEFIsolation()
Default constructor.
Definition: TrigMuonEFIsolation.cxx:16
TrigMuonEFIsolation::m_sumTrkPtCone03
float m_sumTrkPtCone03
Definition: TrigMuonEFIsolation.h:97
TrigMuonEFIsolation::setEFMuonInfoTrackLink
void setEFMuonInfoTrackLink(const int itrk)
Set the link to the muon we calculated the isolation for.
Definition: TrigMuonEFIsolation.cxx:106
TrigMuonEFIsolation::getEFMuonInfoTrack
const TrigMuonEFInfoTrack * getEFMuonInfoTrack() const
Access the muon we calculated the isolation for.
Definition: TrigMuonEFIsolation.cxx:131
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrigMuonEFIsolation::setEFMuonInfoElementLink
void setEFMuonInfoElementLink(const ElementLink< TrigMuonEFInfoContainer > link)
set the element link to the TrigMuonEFInfo object we are using
Definition: TrigMuonEFIsolation.cxx:114
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TrigMuonEFInfoTrack
Definition: TrigMuonEFInfoTrack.h:22
a
TList * a
Definition: liststreamerinfos.cxx:10
TrigMuonEFInfoTrackContainer.h
TrigMuonEFIsolation::m_sumEtCone03
float m_sumEtCone03
Definition: TrigMuonEFIsolation.h:106
TrigMuonEFIsolation::getMuonInfo
const TrigMuonEFInfo * getMuonInfo() const
Access the muon info object we calculated the isolation for.
Definition: TrigMuonEFIsolation.cxx:122
TrigMuonEFInfo
Definition: TrigMuonEFInfo.h:24
TrigMuonEFIsolation::m_sumEtCone04
float m_sumEtCone04
Definition: TrigMuonEFIsolation.h:109
TrigMuonEFIsolation::setEFMuonInfoLink
void setEFMuonInfoLink(const TrigMuonEFInfoContainer *infocont, const int pos)
set the link to the EF muon we calculated the isolation for
Definition: TrigMuonEFIsolation.cxx:97