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

Go to the source code of this file.

Functions

std::string str (const TrigMuonClusterFeature &d)
 Helper function for printing the object.
MsgStream & operator<< (MsgStream &m, const TrigMuonClusterFeature &d)
 Helper operator for printing the object.
bool operator== (const TrigMuonClusterFeature &a, const TrigMuonClusterFeature &b)
 Operator comparing two TrigMuonClusterFeature objects for equality.
void diff (const TrigMuonClusterFeature &a, const TrigMuonClusterFeature &b, std::map< std::string, double > &variableChange)
 comparison with feedback Function compares two objects and returns "semi verbose" output in the form of map where there are varaibel names and differences between two obejcts

Variables

static const double DELTA = 0.001

Function Documentation

◆ diff()

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

comparison with feedback Function compares two objects and returns "semi verbose" output in the form of map where there are varaibel names and differences between two obejcts

Parameters
variableChange- map 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 118 of file TrigMuonClusterFeature.cxx.

119 {
120
121 if( std::abs( a.getEta() - b.getEta() ) > DELTA ) {
122 variableChange[ "Eta" ] = a.getEta() - b.getEta();
123 }
124 if( std::abs( a.getPhi() - b.getPhi() ) > DELTA ) {
125 variableChange[ "Phi" ] = a.getPhi() - b.getPhi();
126 }
127 if( a.getNRoi() != b.getNRoi() ) {
128 variableChange[ "NRoI" ] = static_cast< double >( a.getNRoi() - b.getNRoi() );
129 }
130 if( a.getNJet() != b.getNJet() ) {
131 variableChange[ "NJet" ] = static_cast< double >( a.getNJet() - b.getNJet() );
132 }
133 if( a.getNTRK() != b.getNTRK() ) {
134 variableChange[ "NTRK" ] = static_cast< double >( a.getNTRK() - b.getNTRK() );
135 }
136
137 return;
138}
static const double DELTA
static Double_t a

◆ operator<<()

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

Helper operator for printing the object.

Definition at line 105 of file TrigMuonClusterFeature.cxx.

105 {
106 return (m << str(d));
107}

◆ operator==()

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

Operator comparing two TrigMuonClusterFeature objects for equality.

Definition at line 109 of file TrigMuonClusterFeature.cxx.

109 {
110 if ( std::abs(a.getEta() - b.getEta()) > DELTA ) return false;
111 if ( std::abs(a.getPhi() - b.getPhi()) > DELTA ) return false;
112 if ( a.getNRoi() != b.getNRoi() ) return false;
113 if ( a.getNJet() != b.getNJet() ) return false;
114 if ( a.getNTRK() != b.getNTRK() ) return false;
115 return true;
116}

◆ str()

std::string str ( const TrigMuonClusterFeature & d)

Helper function for printing the object.

Definition at line 96 of file TrigMuonClusterFeature.cxx.

96 {
97 std::stringstream ss;
98 ss << " Eta: " << d.getEta()
99 << "; Phi: " << d.getPhi()
100 << "; NRoI: " << d.getNRoi()
101 << "; NJET: " << d.getNJet()
102 << "; NTRK: " << d.getNTRK();
103 return ss.str();
104}
static Double_t ss

Variable Documentation

◆ DELTA

const double DELTA = 0.001
static

Definition at line 27 of file TrigMuonClusterFeature.cxx.