ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMuonClusterFeature.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*******************************************************
6
7NAME: TrigMuonClusterFeature.cxx
8PACKAGE: Trigger/TrigEvent/TrigMuonEvent
9AUTHORS: Antonio Policicchio <Antonio.Poliicchio@cern.ch>
10AUTHORS: Stefano Giagu <stefano.giagu@cern.ch>
11PURPOSE: Keep the important output variables
12 from the muon ROI cluster trigger
13DATE: V1.0 January 13th, 2009
14
15******************************************************/
16// Local include(s):
18
19// Gaudi/Athena include(s):
20#include "GaudiKernel/MsgStream.h"
21
22// STL include(s):
23#include <format>
24#include <cmath>
25
26// "Distance" used by the comparison operator(s):
27static constexpr double DELTA = 0.001;
28
30 m_eta (eta),
31 m_phi (phi),
32 m_nroi (nroi),
33 m_njet (njet),
34 m_ntrk (ntrk)
35{}
36
37
38// Copy-by-pointer constructor (Note that also the base class is copied)
42
43
45// helper operators
46
47std::string str ( const TrigMuonClusterFeature& d ) {
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}
57
58MsgStream& operator<< ( MsgStream& m, const TrigMuonClusterFeature& d ) {
59 return (m << str(d));
60}
61
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}
70
72 std::map<std::string, double>& variableChange ) {
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}
92
93
static const double DELTA
static Double_t a
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 ...
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.
P4PtEtaPhiMBase is a base class for classes with 4-momentum behavior, for which pt,...
virtual double eta() const override
pseudo rapidity
TrigMuonClusterFeature()=default
virtual double phi() const override
phi in [-pi,pi[