ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMuonClusterFeature.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 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// STL include(s):
17#include <sstream>
18#include <cmath>
19
20// Gaudi/Athena include(s):
21#include "GaudiKernel/MsgStream.h"
22
23// Local include(s):
25
26// "Distance" used by the comparison operator(s):
27static const double DELTA = 0.001;
28
36
38 m_eta (eta),
39 m_phi (phi),
40 m_nroi (nroi),
41 m_njet (njet),
42 m_ntrk (ntrk)
43{}
44
46
47//Assignment operator
50 if (this != &mfeature) {
51 I4Momentum::operator=( mfeature );
52 INavigable::operator=( mfeature );
53 INavigable4Momentum::operator=( mfeature );
54 P4PtEtaPhiMBase::operator= ( mfeature );
55 NavigableTerminalNode::operator= ( mfeature );
56 m_eta = mfeature.getEta();
57 m_phi = mfeature.getPhi();
58 m_nroi = mfeature.getNRoi();
59 m_njet = mfeature.getNJet();
60 m_ntrk = mfeature.getNTRK();
61 }
62 return *this;
63}
64
65// Copy constructor (Note that also the base class is copied)
67 I4Momentum( *feat ),
68 INavigable( *feat ),
69 INavigable4Momentum( *feat ),
70 P4PtEtaPhiMBase ( *feat ),
71 NavigableTerminalNode ( *feat ),
72 m_eta( feat->getEta() ),
73 m_phi( feat->getPhi() ),
74 m_nroi( feat->getNRoi() ),
75 m_njet( feat->getNJet() ),
76 m_ntrk( feat->getNTRK() )
77{}
78
79
81 I4Momentum( feat ),
82 INavigable( feat ),
83 IAthenaBarCode( feat ),
84 INavigable4Momentum( feat ),
85 P4PtEtaPhiMBase ( feat ),
86 NavigableTerminalNode ( feat ),
87 m_eta ( feat.getEta()),
88 m_phi ( feat.getPhi()),
89 m_nroi( feat.getNRoi() ),
90 m_njet( feat.getNJet() ),
91 m_ntrk( feat.getNTRK() ) {}
92
94// helper operators
95
96std::string str ( const TrigMuonClusterFeature& d ) {
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}
105MsgStream& operator<< ( MsgStream& m, const TrigMuonClusterFeature& d ) {
106 return (m << str(d));
107}
108
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}
117
119 std::map<std::string, double>& variableChange ) {
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}
139
140
static const double DELTA
static Double_t a
static Double_t ss
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.
I4Momentum is an abstract base class providing 4-momentum behavior.
Definition I4Momentum.h:31
P4PtEtaPhiMBase is a base class for classes with 4-momentum behavior, for which pt,...
TrigMuonClusterFeature & operator=(const TrigMuonClusterFeature &mfeature)
Assignement operator.
double eta(void) const
pseudo rapidity
double phi(void) const
phi in [-pi,pi[