ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMuonEF.cxx File Reference
#include <sstream>
#include <cmath>
#include "GaudiKernel/MsgStream.h"
#include "TrigMuonEvent/TrigMuonEF.h"
Include dependency graph for TrigMuonEF.cxx:

Go to the source code of this file.

Functions

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

Variables

static const double DELTA = 0.001

Function Documentation

◆ diff()

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

Comparison with feedback.

Definition at line 97 of file TrigMuonEF.cxx.

98 {
99
100 if( a.MuonCode() != b.MuonCode() ) {
101 variableChange[ "MuonCode" ] = static_cast< double >( a.MuonCode() - b.MuonCode() );
102 }
103 if( std::abs( a.charge() - b.charge() ) > DELTA ) {
104 variableChange[ "Charge" ] = a.charge() - b.charge();
105 }
106 if( std::abs( a.pt() - b.pt() ) > DELTA ) {
107 variableChange[ "Pt" ] = a.pt() - b.pt();
108 }
109 if( std::abs( a.eta() - b.eta() ) > DELTA ) {
110 variableChange[ "Eta" ] = a.eta() - b.eta();
111 }
112 if( std::abs( a.phi() - b.phi() ) > DELTA ) {
113 variableChange[ "Phi" ] = a.phi() - b.phi();
114 }
115 if( std::abs( a.m() - b.m() ) > DELTA ) {
116 variableChange[ "Mass" ] = a.m() - b.m();
117 }
118
119 return;
120
121}
static const double DELTA
static Double_t a

◆ operator<<()

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

Helper operator for printing the object.

Definition at line 73 of file TrigMuonEF.cxx.

73 {
74
75 return ( m << str( d ) );
76
77}

◆ operator==()

bool operator== ( const TrigMuonEF & a,
const TrigMuonEF & b )

Operator comparing two TrigMuonEF objects for equality.

Definition at line 79 of file TrigMuonEF.cxx.

79 {
80
81 if( a.MuonCode() != b.MuonCode() )
82 return false;
83 if( std::abs( a.charge() - b.charge() ) > DELTA )
84 return false;
85 if( std::abs( a.pt() - b.pt() ) > DELTA )
86 return false;
87 if( std::abs( a.eta() - b.eta() ) > DELTA )
88 return false;
89 if( std::abs( a.phi() - b.phi() ) > DELTA )
90 return false;
91 if( std::abs( a.m() - b.m() ) > DELTA )
92 return false;
93
94 return true;
95}

◆ str()

std::string str ( const TrigMuonEF & d)

Helper function for printing the object.

Definition at line 60 of file TrigMuonEF.cxx.

60 {
61
62 std::stringstream stream;
63 stream << "MuonCode: " << d.MuonCode()
64 << "; RoINum: " << d.RoINum()
65 << "; eta: " << d.eta()
66 << "; phi: " << d.phi()
67 << "; pt: " << d.pt()
68 << "; charge: " << d.charge();
69
70 return stream.str();
71}

Variable Documentation

◆ DELTA

const double DELTA = 0.001
static

Definition at line 29 of file TrigMuonEF.cxx.