ATLAS Offline Software
Classes | Functions
IsoMuonFeature.h File Reference
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include "AthenaKernel/CLASS_DEF.h"
#include "AthContainers/DataVector.h"
#include "EventKernel/INavigable4Momentum.h"
#include "FourMom/P4PtEtaPhiMBase.h"
#include "Navigation/NavigableTerminalNode.h"

Go to the source code of this file.

Classes

class  IsoMuonFeature
 Class with isolation variables for TrigmuIso algorithm. More...
 

Functions

std::string str (const IsoMuonFeature &d)
 Helper function for printing the object. More...
 
MsgStream & operator<< (MsgStream &m, const IsoMuonFeature &d)
 Helper operator for printing the object. More...
 
bool operator== (const IsoMuonFeature &a, const IsoMuonFeature &b)
 Operator comparing two IsoMuonFeature objects for equality. More...
 
bool operator!= (const IsoMuonFeature &a, const IsoMuonFeature &b)
 Operator comparing two IsoMuonFeature objects for inequality. More...
 
void diff (const IsoMuonFeature &a, const IsoMuonFeature &b, std::map< std::string, double > &variableChange)
 Comparison with feedback. More...
 

Function Documentation

◆ diff()

void diff ( const IsoMuonFeature a,
const IsoMuonFeature b,
std::map< std::string, double > &  variableChange 
)

Comparison with feedback.

Comparison with feedback.

Parameters
variableChangeMap to record the differences In case of collections (or objects when the size may be different) that information can also be returned in varaibleChange

Definition at line 239 of file IsoMuonFeature.cxx.

240  {
241 
242  if( std::abs( a.getsumet01() - b.getsumet01() ) > DELTA ) {
243  variableChange[ "sumet01" ] = a.getsumet01() - b.getsumet01();
244  }
245  if( std::abs( a.getsumet02() - b.getsumet02() ) > DELTA ) {
246  variableChange[ "sumet02" ] = a.getsumet02() - b.getsumet02();
247  }
248  if( std::abs( a.getsumet03() - b.getsumet03() ) > DELTA ) {
249  variableChange[ "sumet03" ] = a.getsumet03() - b.getsumet03();
250  }
251  if( std::abs( a.getsumet04() - b.getsumet04() ) > DELTA ) {
252  variableChange[ "sumet04" ] = a.getsumet04() - b.getsumet04();
253  }
254  if( std::abs( a.getsumpt01() - b.getsumpt01() ) > DELTA ) {
255  variableChange[ "sumpt01" ] = a.getsumpt01() - b.getsumpt01();
256  }
257  if( std::abs( a.getsumet02() - b.getsumet02() ) > DELTA ) {
258  variableChange[ "sumet02" ] = a.getsumet02() - b.getsumpt02();
259  }
260  if( std::abs( a.getsumpt03() - b.getsumpt03() ) > DELTA ) {
261  variableChange[ "sumpt03" ] = a.getsumpt03() - b.getsumpt03();
262  }
263  if( std::abs( a.getsumpt04() - b.getsumpt04() ) > DELTA ) {
264  variableChange[ "sumpt04" ] = a.getsumpt04() - b.getsumpt04();
265  }
266  if( a.getFlag() != b.getFlag() ) {
267  variableChange[ "flag" ] = static_cast< double >( a.getFlag() -
268  b.getFlag() );
269  }
270  if( a.getRoiIdMu() != b.getRoiIdMu() ) {
271  variableChange[ "RoiIdMu" ] = static_cast< double >( a.getRoiIdMu() -
272  b.getRoiIdMu() );
273  }
274  if( std::abs( a.pt() - b.pt() ) > DELTA ) {
275  variableChange[ "PtMu" ] = a.pt() - b.pt();
276  }
277  if( std::abs( a.getQMu() - b.getQMu() ) > DELTA ) {
278  variableChange[ "QMu" ] = a.getQMu() - b.getQMu();
279  }
280  if( std::abs( a.getEtaMu() - b.getEtaMu() ) > DELTA ) {
281  variableChange[ "EtaMu" ] = a.getEtaMu() - b.getEtaMu();
282  }
283  if( std::abs( a.getPhiMu() - b.getPhiMu() ) > DELTA ) {
284  variableChange[ "PhiMu" ] = a.getPhiMu() - b.getPhiMu();
285  }
286 
287  return;
288 }

◆ operator!=()

bool operator!= ( const IsoMuonFeature a,
const IsoMuonFeature b 
)
inline

Operator comparing two IsoMuonFeature objects for inequality.

Definition at line 213 of file IsoMuonFeature.h.

213  {
214  return !( a == b );
215 }

◆ operator<<()

MsgStream& operator<< ( MsgStream &  m,
const IsoMuonFeature d 
)

Helper operator for printing the object.

Definition at line 187 of file IsoMuonFeature.cxx.

187  {
188 
189  return ( m << str( d ) );
190 }

◆ operator==()

bool operator== ( const IsoMuonFeature a,
const IsoMuonFeature b 
)

Operator comparing two IsoMuonFeature objects for equality.

Definition at line 192 of file IsoMuonFeature.cxx.

192  {
193 
194  if( std::abs( a.getsumet01() - b.getsumet01() ) > DELTA )
195  return false;
196  if( std::abs( a.getsumet02() - b.getsumet02() ) > DELTA )
197  return false;
198  if( std::abs( a.getsumet03() - b.getsumet03() ) > DELTA )
199  return false;
200  if( std::abs( a.getsumet04() - b.getsumet04() ) > DELTA )
201  return false;
202  if( std::abs( a.getsumpt01() - b.getsumpt01() ) > DELTA )
203  return false;
204  if( std::abs( a.getsumpt02() - b.getsumpt02() ) > DELTA )
205  return false;
206  if( std::abs( a.getsumpt03() - b.getsumpt03() ) > DELTA )
207  return false;
208  if( std::abs( a.getsumpt04() - b.getsumpt04() ) > DELTA )
209  return false;
210  if( std::abs( a.getPtMuID() - b.getPtMuID() ) > DELTA )
211  return false;
212  if( std::abs( a.getMaxPtID() - b.getMaxPtID() ) > DELTA )
213  return false;
214  if( a.getFlag() != b.getFlag() )
215  return false;
216  if( a.getRoiIdMu() != b.getRoiIdMu() )
217  return false;
218  if( std::abs( a.pt() - b.pt() ) > DELTA )
219  return false;
220  if( std::abs( a.getQMu() - b.getQMu() ) > DELTA )
221  return false;
222  if( std::abs( a.getEtaMu() - b.getEtaMu() ) > DELTA )
223  return false;
224  if( std::abs( a.getPhiMu() - b.getPhiMu() ) > DELTA )
225  return false;
226 
227  return true;
228 }

◆ str()

std::string str ( const IsoMuonFeature d)

Helper function for printing the object.

Definition at line 164 of file IsoMuonFeature.cxx.

164  {
165  std::stringstream ss;
166  ss << "sumet01: " << d.getsumet01()
167  << "; sumet02: " << d.getsumet02()
168  << "; sumet03: " << d.getsumet03()
169  << "; sumet04: " << d.getsumet04()
170  << "; sumpt01: " << d.getsumpt01()
171  << "; sumpt02: " << d.getsumpt02()
172  << "; sumpt03: " << d.getsumpt03()
173  << "; sumpt04: " << d.getsumpt04()
174  << "; PtMuID: " << d.getPtMuID()
175  << "; MaxPtID: " << d.getMaxPtID()
176  << "; flag: " << d.getFlag()
177  << "; RoiIdMu: " << d.getRoiIdMu()
178  << "; RoiIdMu: " << d.getRoiIdMu()
179  << "; PtMu: " << d.pt()
180  << "; QMu: " << d.getQMu()
181  << "; EtaMu: " << d.getEtaMu()
182  << "; PhiMu: " << d.getPhiMu();
183 
184  return ss.str();
185 }
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
hist_file_dump.d
d
Definition: hist_file_dump.py:137
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
str
std::string str(const IsoMuonFeature &d)
Helper function for printing the object.
Definition: IsoMuonFeature.cxx:164
a
TList * a
Definition: liststreamerinfos.cxx:10