ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMuonClusterFeature.cxx File Reference
#include "TrigMuonEvent/TrigMuonClusterFeature.h"
#include "GaudiKernel/MsgStream.h"
#include <format>
#include <cmath>
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 variable names and differences between two objects

Variables

static constexpr 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 variable names and differences between two objects

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 71 of file TrigMuonClusterFeature.cxx.

72 {
73
74 if( std::abs( a.getEta() - b.getEta() ) > DELTA ) {
75 variableChange[ "Eta" ] = a.getEta() - b.getEta();
76 }
77 if( std::abs( a.getPhi() - b.getPhi() ) > DELTA ) {
78 variableChange[ "Phi" ] = a.getPhi() - b.getPhi();
79 }
80 if( a.getNRoi() != b.getNRoi() ) {
81 variableChange[ "NRoI" ] = static_cast< double >( a.getNRoi() - b.getNRoi() );
82 }
83 if( a.getNJet() != b.getNJet() ) {
84 variableChange[ "NJet" ] = static_cast< double >( a.getNJet() - b.getNJet() );
85 }
86 if( a.getNTRK() != b.getNTRK() ) {
87 variableChange[ "NTRK" ] = static_cast< double >( a.getNTRK() - b.getNTRK() );
88 }
89
90 return;
91}
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 58 of file TrigMuonClusterFeature.cxx.

58 {
59 return (m << str(d));
60}

◆ operator==()

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

Operator comparing two TrigMuonClusterFeature objects for equality.

Definition at line 62 of file TrigMuonClusterFeature.cxx.

62 {
63 if ( std::abs(a.getEta() - b.getEta()) > DELTA ) return false;
64 if ( std::abs(a.getPhi() - b.getPhi()) > DELTA ) return false;
65 if ( a.getNRoi() != b.getNRoi() ) return false;
66 if ( a.getNJet() != b.getNJet() ) return false;
67 if ( a.getNTRK() != b.getNTRK() ) return false;
68 return true;
69}

◆ str()

std::string str ( const TrigMuonClusterFeature & d)

Helper function for printing the object.

Definition at line 47 of file TrigMuonClusterFeature.cxx.

47 {
48 return std::format(
49 " Eta: {}; Phi: {}; NRoI: {}; NJET: {}; NTRK: {}",
50 d.getEta(),
51 d.getPhi(),
52 d.getNRoi(),
53 d.getNJet(),
54 d.getNTRK()
55 );
56}

Variable Documentation

◆ DELTA

double DELTA = 0.001
staticconstexpr

Definition at line 27 of file TrigMuonClusterFeature.cxx.