ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMuonEF.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*****************************************************************************
6Name : TrigMuonEF.cxx
7Package : offline/Trigger/TrigEvent/TrigMuonEvent
8Author : Gabriella Cataldi
9Created : November 2006
10Note : Simple Trigger AOD for EF Muon (TrigMoore)
11
12DESCRIPTION:
13
14Nov.2006: A simple AOD containing just track parameters and status for re-running
15 hypothesis with FEX off.
16*****************************************************************************/
17
18// STL include(s):
19#include <sstream>
20#include <cmath>
21
22// Gaudi/Athena include(s):
23#include "GaudiKernel/MsgStream.h"
24
25// Local include(s):
27
28// "Distance" used by the comparison operator(s):
29static const double DELTA = 0.001;
30
31
32TrigMuonEF::TrigMuonEF(double theIPt, double theCotTh, double thePhi, double theM) :
33 P4IPtCotThPhiM(theIPt , theCotTh, thePhi ,theM ) {
34}
35
37void TrigMuonEF::set_muonCode(int theMuonCode){
38 m_muonCode = theMuonCode;
39}
40
42void TrigMuonEF::set_RoINum(const std::string& theRoINum){
43 m_roi = theRoINum;
44}
45
47void TrigMuonEF::set_Charge(double theCharge){
48 m_charge = theCharge;
49}
50
53
54//
55// I use the standard eta-phi-pt parameters in the printouts and comparisons,
56// because iPt and CotTh don't tell me much on first sight. Besides, iPt values
57// are usually too small for a meaningful direct comparison.
58//
59
60std::string str( const TrigMuonEF& d ) {
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}
72
73MsgStream& operator<< ( MsgStream& m, const TrigMuonEF& d ) {
74
75 return ( m << str( d ) );
76
77}
78
79bool operator== ( const TrigMuonEF& a, const TrigMuonEF& b ) {
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}
96
97void diff( const TrigMuonEF& a, const TrigMuonEF& b,
98 std::map< std::string, double >& variableChange ) {
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
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.
MsgStream & operator<<(MsgStream &m, const TrigMuonEF &d)
Helper operator for printing the object.
P4IPtCotThPhiM(const double iPt, const double cotTh, const double phi, const double m)
constructor with all data members
double m_charge
Definition TrigMuonEF.h:70
void set_Charge(double theCharge)
Set Charge.
virtual ~TrigMuonEF()
Destructor.
void set_RoINum(const std::string &theRoINum)
Set RoINum.
int m_muonCode
what kind of track we are dealing with (Moore, StandAlone, Combined)
Definition TrigMuonEF.h:68
void set_muonCode(int theMuonCode)
Set MuonCode.
std::string m_roi
Definition TrigMuonEF.h:69
TrigMuonEF()=default
Default constructor.