ATLAS Offline Software
Loading...
Searching...
No Matches
TileMuFeature.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// Filename : TileMuFeature.cxx
7// Author : Heuijin Lim
8// Created : Sep. 2007
9//
10// DESCRIPTION:
11// Contain the muon candidates from TileCal and the combined tracks from
12// Inner-Detector.
13//
14// HISTORY:
15//
16// BUGS:
17//
18//*****************************************************************************
19
20#include <iostream>
21#include <sstream>
22#include <iomanip>
23#include <cmath>
24
25// Gaudi/Athena includes:
26#include "GaudiKernel/MsgStream.h"
27
28// Trigger includes:
30
32static const double DELTA = 0.001;
33
35{
36 m_eta = -999.9;
37 m_phi = -999.9;
38 m_energy_deposited.clear();
39 m_quality_factor = -999.9;
40}
41
42TileMuFeature::TileMuFeature ( float eta, float phi, const std::vector<float> & ener, float qual )
43 : m_eta(eta)
44 , m_phi(phi)
45 , m_energy_deposited(ener)
46 , m_quality_factor(qual)
47{
48}
49
50TileMuFeature::TileMuFeature ( float eta, float phi, std::vector<float> && ener, float qual )
51 : m_eta(eta)
52 , m_phi(phi)
53 , m_energy_deposited(std::move(ener))
54 , m_quality_factor(qual)
55{
56}
57
59 m_eta = muon_feature->eta();
60 m_phi = muon_feature->phi();
61 m_energy_deposited = muon_feature->enedep();
62 m_quality_factor = muon_feature->quality();
63}
64
66 m_eta = muon_feature.eta();
67 m_phi = muon_feature.phi();
68 m_energy_deposited = muon_feature.enedep();
69 m_quality_factor = muon_feature.quality();
70}
71
74{
75 if (this != &muon_feature) {
76 m_eta = muon_feature.eta();
77 m_phi = muon_feature.phi();
78 m_energy_deposited = muon_feature.enedep();
79 m_quality_factor = muon_feature.quality();
80 }
81
82 return *this;
83}
84
87{
88 if (this != &muon_feature) {
89 m_eta = muon_feature.eta();
90 m_phi = muon_feature.phi();
91 m_energy_deposited = std::move(muon_feature.m_energy_deposited);
92 m_quality_factor = muon_feature.quality();
93 }
94
95 return *this;
96}
97
99
100std::string str ( const TileMuFeature& d )
101{
102 std::stringstream ss;
103
104 ss << "eta: " << d.eta()
105 << "; phi: " << d.phi()
106 << "; quality: " << d.quality();
107
108 return ss.str();
109}
110
111MsgStream& operator<< ( MsgStream& m, const TileMuFeature& d )
112{
113 return ( m << str( d ) );
114}
115
116bool operator== ( const TileMuFeature& a, const TileMuFeature& b )
117{
118 if( std::abs( a.eta() - b.eta() ) > DELTA ) return false;
119 if( std::abs( a.phi() - b.phi() ) > DELTA ) return false;
120 if( std::abs( a.quality() - b.quality() ) > DELTA ) return false;
121
122 return true;
123}
124
125void diff( const TileMuFeature& a, const TileMuFeature& b, std::map< std::string, double >& variableChange )
126{
127 if( std::abs( a.eta() - b.eta() ) > DELTA ) {
128 variableChange[ "eta" ] = a.eta() - b.eta();
129 }
130 if( std::abs( a.phi() - b.phi() ) > DELTA ) {
131 variableChange[ "phi" ] = a.phi() - b.phi();
132 }
133 if( ( a.quality() - b.quality() ) > DELTA ) {
134 variableChange[ "quality" ] = a.quality() - b.quality();
135 }
136
137 return;
138}
139
140/*
141void TileMuFeature::Set( float eta, float phi, std::vector<float> & ener, float qual )
142{
143 m_eta = eta;
144 m_phi = phi;
145 m_energy_deposited = ener;
146 m_quality_factor = qual;
147}
148
149void TileMuFeature::print() const
150{
151 std::cout << (std::string) (*this) << std::endl;
152}
153
154TileMuFeature::operator std::string() const
155{
156 const int MAX_BUF = 1024;
157 char buf[MAX_BUF];
158 std::ostringstream text(buf);
159
160 //text << whoami();
161 text << " eta=" << m_eta;
162 text << " phi=" << m_phi;
163 for (unsigned int i=0; i<m_energy_deposited.size(); ++i)
164 text << " ene[" << i << "]=" << m_energy_deposited[i];
165 text << " qual=" << m_quality_factor;
166
167 return text.str();
168}
169*/
170
171/*
172void TileMuFeature::SetIDTrk(float Pt_IDTrk, float Eta_IDTrk, float EtaTR_IDTrk, float Phi_IDTrk, float PhiTR_IDTrk, float zPos_IDTrk, int Typ_IDTrk)
173{
174 m_Pt_IDTrk = Pt_IDTrk;
175 m_Eta_IDTrk = Eta_IDTrk;
176 m_EtaTR_IDTrk = EtaTR_IDTrk;
177 m_Phi_IDTrk = Phi_IDTrk;
178 m_PhiTR_IDTrk = PhiTR_IDTrk;
179 m_zPos_IDTrk = zPos_IDTrk;
180 m_IDTrk = Typ_IDTrk;
181}
182*/
static const double DELTA
static Double_t a
static Double_t ss
bool operator==(const TileMuFeature &a, const TileMuFeature &b)
Operator comparing two CombinedMuonFeature objects for equality.
MsgStream & operator<<(MsgStream &m, const TileMuFeature &d)
Helper operator for printing the object.
void diff(const TileMuFeature &a, const TileMuFeature &b, std::map< std::string, double > &variableChange)
Comparison with feedback.
float m_quality_factor
const std::vector< float > & enedep() const
float quality() const
std::vector< float > m_energy_deposited
TileMuFeature & operator=(const TileMuFeature &muon_feature)
Assignement operator.
float phi() const
float eta() const
Accessor.
STL namespace.