ATLAS Offline Software
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 
7 NAME: TrigMuonClusterFeature.cxx
8 PACKAGE: Trigger/TrigEvent/TrigMuonEvent
9 AUTHORS: Antonio Policicchio <Antonio.Poliicchio@cern.ch>
10 AUTHORS: Stefano Giagu <stefano.giagu@cern.ch>
11 PURPOSE: Keep the important output variables
12  from the muon ROI cluster trigger
13 DATE: 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):
27 static const double DELTA = 0.001;
28 
30 m_eta(0.),
31 m_phi(0.),
32 m_nroi(0),
33 m_njet(0),
34 m_ntrk(0)
35 {}
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 
96 std::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 }
105 MsgStream& 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 
I4Momentum
Definition: I4Momentum.h:31
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
IDTPM::getPhi
float getPhi(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of phi.
Definition: TrackParametersHelper.h:53
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
hist_file_dump.d
d
Definition: hist_file_dump.py:137
TrigMuonClusterFeature::getNRoi
int getNRoi() const
Definition: TrigMuonClusterFeature.h:59
NavigableTerminalNode
Dummy type needed fro specialized implementation.
Definition: NavigableTerminalNode.h:19
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 ...
Definition: TrigMuonClusterFeature.cxx:118
str
std::string str(const TrigMuonClusterFeature &d)
Helper function for printing the object.
Definition: TrigMuonClusterFeature.cxx:96
operator<<
MsgStream & operator<<(MsgStream &m, const TrigMuonClusterFeature &d)
Helper operator for printing the object.
Definition: TrigMuonClusterFeature.cxx:105
operator==
bool operator==(const TrigMuonClusterFeature &a, const TrigMuonClusterFeature &b)
Operator comparing two TrigMuonClusterFeature objects for equality.
Definition: TrigMuonClusterFeature.cxx:109
TrigMuonClusterFeature::getPhi
float getPhi() const
Definition: TrigMuonClusterFeature.h:63
TrigMuonClusterFeature::m_njet
int m_njet
Definition: TrigMuonClusterFeature.h:69
TrigMuonClusterFeature::m_phi
float m_phi
Definition: TrigMuonClusterFeature.h:67
TrigMuonClusterFeature::m_eta
float m_eta
Definition: TrigMuonClusterFeature.h:63
TrigMuonClusterFeature::~TrigMuonClusterFeature
~TrigMuonClusterFeature()
Destructor.
Definition: TrigMuonClusterFeature.cxx:45
TrigMuonClusterFeature::m_ntrk
int m_ntrk
Definition: TrigMuonClusterFeature.h:70
TrigMuonClusterFeature::getNTRK
int getNTRK() const
Definition: TrigMuonClusterFeature.h:60
INavigable
Definition: INavigable.h:18
IAthenaBarCode
Definition: AthenaKernel/AthenaKernel/IAthenaBarCode.h:48
P4PtEtaPhiMBase
Definition: P4PtEtaPhiMBase.h:26
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrigMuonClusterFeature::getEta
float getEta() const
Definition: TrigMuonClusterFeature.h:62
TrigMuonClusterFeature::operator=
TrigMuonClusterFeature & operator=(const TrigMuonClusterFeature &mfeature)
Assignement operator.
Definition: TrigMuonClusterFeature.cxx:49
TrigMuonClusterFeature
Definition: TrigMuonClusterFeature.h:35
TrigMuonClusterFeature::TrigMuonClusterFeature
TrigMuonClusterFeature()
Constructors.
Definition: TrigMuonClusterFeature.cxx:29
a
TList * a
Definition: liststreamerinfos.cxx:10
INavigable4Momentum
Definition: INavigable4Momentum.h:21
TrigMuonClusterFeature::getNJet
int getNJet() const
Definition: TrigMuonClusterFeature.h:61
TrigMuonClusterFeature::m_nroi
int m_nroi
Definition: TrigMuonClusterFeature.h:68
TrigMuonClusterFeature.h