ATLAS Offline Software
Functions
IsoMuonFeature.cxx File Reference
#include <sstream>
#include <cmath>
#include "GaudiKernel/MsgStream.h"
#include "TrigMuonEvent/IsoMuonFeature.h"
Include dependency graph for IsoMuonFeature.cxx:

Go to the source code of this file.

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...
 
void diff (const IsoMuonFeature &a, const IsoMuonFeature &b, std::map< std::string, double > &variableChange)
 Function compares two objects and returns "semi verbose" output in the form of map where there are varaible names and relative differences between two obejcts. More...
 

Function Documentation

◆ diff()

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

Function compares two objects and returns "semi verbose" output in the form of map where there are varaible names and relative differences between two obejcts.

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 264 of file IsoMuonFeature.cxx.

265  {
266 
267  if( std::abs( a.getsumet01() - b.getsumet01() ) > DELTA ) {
268  variableChange[ "sumet01" ] = a.getsumet01() - b.getsumet01();
269  }
270  if( std::abs( a.getsumet02() - b.getsumet02() ) > DELTA ) {
271  variableChange[ "sumet02" ] = a.getsumet02() - b.getsumet02();
272  }
273  if( std::abs( a.getsumet03() - b.getsumet03() ) > DELTA ) {
274  variableChange[ "sumet03" ] = a.getsumet03() - b.getsumet03();
275  }
276  if( std::abs( a.getsumet04() - b.getsumet04() ) > DELTA ) {
277  variableChange[ "sumet04" ] = a.getsumet04() - b.getsumet04();
278  }
279  if( std::abs( a.getsumpt01() - b.getsumpt01() ) > DELTA ) {
280  variableChange[ "sumpt01" ] = a.getsumpt01() - b.getsumpt01();
281  }
282  if( std::abs( a.getsumet02() - b.getsumet02() ) > DELTA ) {
283  variableChange[ "sumet02" ] = a.getsumet02() - b.getsumpt02();
284  }
285  if( std::abs( a.getsumpt03() - b.getsumpt03() ) > DELTA ) {
286  variableChange[ "sumpt03" ] = a.getsumpt03() - b.getsumpt03();
287  }
288  if( std::abs( a.getsumpt04() - b.getsumpt04() ) > DELTA ) {
289  variableChange[ "sumpt04" ] = a.getsumpt04() - b.getsumpt04();
290  }
291  if( a.getFlag() != b.getFlag() ) {
292  variableChange[ "flag" ] = static_cast< double >( a.getFlag() -
293  b.getFlag() );
294  }
295  if( a.getRoiIdMu() != b.getRoiIdMu() ) {
296  variableChange[ "RoiIdMu" ] = static_cast< double >( a.getRoiIdMu() -
297  b.getRoiIdMu() );
298  }
299  if( std::abs( a.pt() - b.pt() ) > DELTA ) {
300  variableChange[ "PtMu" ] = a.pt() - b.pt();
301  }
302  if( std::abs( a.getQMu() - b.getQMu() ) > DELTA ) {
303  variableChange[ "QMu" ] = a.getQMu() - b.getQMu();
304  }
305  if( std::abs( a.getEtaMu() - b.getEtaMu() ) > DELTA ) {
306  variableChange[ "EtaMu" ] = a.getEtaMu() - b.getEtaMu();
307  }
308  if( std::abs( a.getPhiMu() - b.getPhiMu() ) > DELTA ) {
309  variableChange[ "PhiMu" ] = a.getPhiMu() - b.getPhiMu();
310  }
311 
312  return;
313 }

◆ operator<<()

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

Helper operator for printing the object.

Definition at line 212 of file IsoMuonFeature.cxx.

212  {
213 
214  return ( m << str( d ) );
215 }

◆ operator==()

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

Operator comparing two IsoMuonFeature objects for equality.

Definition at line 217 of file IsoMuonFeature.cxx.

217  {
218 
219  if( std::abs( a.getsumet01() - b.getsumet01() ) > DELTA )
220  return false;
221  if( std::abs( a.getsumet02() - b.getsumet02() ) > DELTA )
222  return false;
223  if( std::abs( a.getsumet03() - b.getsumet03() ) > DELTA )
224  return false;
225  if( std::abs( a.getsumet04() - b.getsumet04() ) > DELTA )
226  return false;
227  if( std::abs( a.getsumpt01() - b.getsumpt01() ) > DELTA )
228  return false;
229  if( std::abs( a.getsumpt02() - b.getsumpt02() ) > DELTA )
230  return false;
231  if( std::abs( a.getsumpt03() - b.getsumpt03() ) > DELTA )
232  return false;
233  if( std::abs( a.getsumpt04() - b.getsumpt04() ) > DELTA )
234  return false;
235  if( std::abs( a.getPtMuID() - b.getPtMuID() ) > DELTA )
236  return false;
237  if( std::abs( a.getMaxPtID() - b.getMaxPtID() ) > DELTA )
238  return false;
239  if( a.getFlag() != b.getFlag() )
240  return false;
241  if( a.getRoiIdMu() != b.getRoiIdMu() )
242  return false;
243  if( std::abs( a.pt() - b.pt() ) > DELTA )
244  return false;
245  if( std::abs( a.getQMu() - b.getQMu() ) > DELTA )
246  return false;
247  if( std::abs( a.getEtaMu() - b.getEtaMu() ) > DELTA )
248  return false;
249  if( std::abs( a.getPhiMu() - b.getPhiMu() ) > DELTA )
250  return false;
251 
252  return true;
253 }

◆ str()

std::string str ( const IsoMuonFeature d)

Helper function for printing the object.

Definition at line 189 of file IsoMuonFeature.cxx.

189  {
190  std::stringstream ss;
191  ss << "sumet01: " << d.getsumet01()
192  << "; sumet02: " << d.getsumet02()
193  << "; sumet03: " << d.getsumet03()
194  << "; sumet04: " << d.getsumet04()
195  << "; sumpt01: " << d.getsumpt01()
196  << "; sumpt02: " << d.getsumpt02()
197  << "; sumpt03: " << d.getsumpt03()
198  << "; sumpt04: " << d.getsumpt04()
199  << "; PtMuID: " << d.getPtMuID()
200  << "; MaxPtID: " << d.getMaxPtID()
201  << "; flag: " << d.getFlag()
202  << "; RoiIdMu: " << d.getRoiIdMu()
203  << "; RoiIdMu: " << d.getRoiIdMu()
204  << "; PtMu: " << d.pt()
205  << "; QMu: " << d.getQMu()
206  << "; EtaMu: " << d.getEtaMu()
207  << "; PhiMu: " << d.getPhiMu();
208 
209  return ss.str();
210 }
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:189
a
TList * a
Definition: liststreamerinfos.cxx:10