ATLAS Offline Software
Functions
MuonFeature.cxx File Reference
#include <sstream>
#include <cmath>
#include "GaudiKernel/MsgStream.h"
#include "TrigMuonEvent/MuonFeature.h"
Include dependency graph for MuonFeature.cxx:

Go to the source code of this file.

Functions

std::string str (const MuonFeature &muon)
 Helper function for printing the object. More...
 
MsgStream & operator<< (MsgStream &m, const MuonFeature &muon)
 Helper operator for printing the object. More...
 
bool operator== (const MuonFeature &left, const MuonFeature &right)
 Operator comparing two MuonFeature objects for equality. More...
 
void diff (const MuonFeature &left, const MuonFeature &right, std::map< std::string, double > &varChange)
 Comparison with feedback. More...
 

Function Documentation

◆ diff()

void diff ( const MuonFeature left,
const MuonFeature right,
std::map< std::string, double > &  varChange 
)

Comparison with feedback.

Definition at line 236 of file MuonFeature.cxx.

237  {
238 
239  if( std::abs( left.algoId() - right.algoId() ) > DELTA ) {
240  varChange[ "algoId" ] = static_cast< double >( left.algoId() - right.algoId() );
241  }
242  if( left.saddress() != right.saddress() ) {
243  varChange[ "saddress" ] = static_cast< double >( left.saddress() - right.saddress() );
244  }
245  if( std::abs( left.pt() - right.pt() ) > DELTA ) {
246  varChange[ "pt" ] = left.pt() - right.pt();
247  }
248  if( std::abs( left.radius() - right.radius() ) > DELTA ) {
249  varChange[ "radius" ] = left.radius() - right.radius();
250  }
251  if( std::abs( left.eta() - right.eta() ) > DELTA ) {
252  varChange[ "eta" ] = left.eta() - right.eta();
253  }
254  if( std::abs( left.phi() - right.phi() ) > DELTA ) {
255  varChange[ "phi" ] = left.phi() - right.phi();
256  }
257  if( std::abs( left.dir_phi() - right.dir_phi() ) > DELTA ) {
258  varChange[ "dir_phi" ] = left.dir_phi() - right.dir_phi();
259  }
260  if( std::abs( left.zeta() - right.zeta() ) > DELTA ) {
261  varChange[ "zeta" ] = left.zeta() - right.zeta();
262  }
263  if( std::abs( left.dir_zeta() - right.dir_zeta() ) > DELTA ) {
264  varChange[ "dir_zeta" ] = left.dir_zeta() - right.dir_zeta();
265  }
266  if( std::abs( left.beta() - right.beta() ) > DELTA ) {
267  varChange[ "beta" ] = left.beta() - right.beta();
268  }
269  if( std::abs( left.sp1_r() - right.sp1_r() ) > DELTA ) {
270  varChange[ "sp1_r" ] = left.sp1_r() - right.sp1_r();
271  }
272  if( std::abs( left.sp1_z() - right.sp1_z() ) > DELTA ) {
273  varChange[ "sp1_z" ] = left.sp1_z() - right.sp1_z();
274  }
275  if( std::abs( left.sp1_slope() - right.sp1_slope() ) > DELTA ) {
276  varChange[ "sp1_slope" ] = left.sp1_slope() - right.sp1_slope();
277  }
278  if( std::abs( left.sp2_r() - right.sp2_r() ) > DELTA ) {
279  varChange[ "sp2_r" ] = left.sp2_r() - right.sp2_r();
280  }
281  if( std::abs( left.sp2_z() - right.sp2_z() ) > DELTA ) {
282  varChange[ "sp2_z" ] = left.sp2_z() - right.sp2_z();
283  }
284  if( std::abs( left.sp2_slope() - right.sp2_slope() ) > DELTA ) {
285  varChange[ "sp2_slope" ] = left.sp2_slope() - right.sp2_slope();
286  }
287  if( std::abs( left.sp3_r() - right.sp3_r() ) > DELTA ) {
288  varChange[ "sp3_r" ] = left.sp3_r() - right.sp3_r();
289  }
290  if( std::abs( left.sp3_z() - right.sp3_z() ) > DELTA ) {
291  varChange[ "sp3_z" ] = left.sp3_z() - right.sp3_z();
292  }
293  if( std::abs( left.sp3_slope() - right.sp3_slope() ) > DELTA ) {
294  varChange[ "sp3_slope" ] = left.sp3_slope() - right.sp3_slope();
295  }
296  if( std::abs( left.br_radius() - right.br_radius() ) > DELTA ) {
297  varChange[ "br_radius" ] = left.br_radius() - right.br_radius();
298  }
299  if( std::abs( left.br_sagitta() - right.br_sagitta() ) > DELTA ) {
300  varChange[ "br_sagitta" ] = left.br_sagitta() - right.br_sagitta();
301  }
302  if( std::abs( left.ec_alpha() - right.ec_alpha() ) > DELTA ) {
303  varChange[ "ec_alpha" ] = left.ec_alpha() - right.ec_alpha();
304  }
305  if( std::abs( left.ec_beta() - right.ec_beta() ) > DELTA ) {
306  varChange[ "ec_beta" ] = left.ec_beta() - right.ec_beta();
307  }
308  if( std::abs( left.dq_var1() - right.dq_var1() ) > DELTA ) {
309  varChange[ "dq_var1" ] = left.dq_var1() - right.dq_var1();
310  }
311  if( std::abs( left.dq_var2() - right.dq_var2() ) > DELTA ) {
312  varChange[ "dq_var2" ] = left.dq_var2() - right.dq_var2();
313  }
314 
315  return;
316 }

◆ operator<<()

MsgStream& operator<< ( MsgStream &  m,
const MuonFeature muon 
)

Helper operator for printing the object.

Definition at line 192 of file MuonFeature.cxx.

192  {
193 
194  return ( m << str( muon ) );
195 
196 }

◆ operator==()

bool operator== ( const MuonFeature left,
const MuonFeature right 
)

Operator comparing two MuonFeature objects for equality.

Definition at line 198 of file MuonFeature.cxx.

198  {
199 
200  if( ( left.algoId() != right.algoId() ) ||
201  ( left.saddress() != right.saddress() ) ||
202  ( std::abs( left.pt() - right.pt() ) > DELTA ) ||
203  ( std::abs( left.radius() - right.radius() ) > DELTA ) ||
204  ( std::abs( left.eta() - right.eta() ) > DELTA ) ||
205  ( std::abs( left.phi() - right.phi() ) > DELTA ) ||
206  ( std::abs( left.dir_phi() - right.dir_phi() ) > DELTA ) ||
207  ( std::abs( left.zeta() - right.zeta() ) > DELTA ) ||
208  ( std::abs( left.dir_zeta() - right.dir_zeta() ) > DELTA ) ||
209  ( std::abs( left.beta() - right.beta() ) > DELTA ) ||
210  ( std::abs( left.sp1_r() - right.sp1_r() ) > DELTA ) ||
211  ( std::abs( left.sp1_z() - right.sp1_z() ) > DELTA ) ||
212  ( std::abs( left.sp1_slope() - right.sp1_slope() ) > DELTA ) ||
213  ( std::abs( left.sp2_r() - right.sp2_r() ) > DELTA ) ||
214  ( std::abs( left.sp2_z() - right.sp2_z() ) > DELTA ) ||
215  ( std::abs( left.sp2_slope() - right.sp2_slope() ) > DELTA ) ||
216  ( std::abs( left.sp3_r() - right.sp3_r() ) > DELTA ) ||
217  ( std::abs( left.sp3_z() - right.sp3_z() ) > DELTA ) ||
218  ( std::abs( left.sp3_slope() - right.sp3_slope() ) > DELTA ) ||
219  ( std::abs( left.br_radius() - right.br_radius() ) > DELTA ) ||
220  ( std::abs( left.br_sagitta() - right.br_sagitta() ) > DELTA ) ||
221  ( std::abs( left.ec_alpha() - right.ec_alpha() ) > DELTA ) ||
222  ( std::abs( left.ec_beta() - right.ec_beta() ) > DELTA ) ||
223  ( std::abs( left.dq_var1() - right.dq_var1() ) > DELTA ) ||
224  ( std::abs( left.dq_var2() - right.dq_var2() ) > DELTA ) ) {
225 
226  return false;
227 
228  } else {
229 
230  return true;
231 
232  }
233 
234 }

◆ str()

std::string str ( const MuonFeature muon)

Helper function for printing the object.

Definition at line 180 of file MuonFeature.cxx.

180  {
181 
182  std::stringstream stream;
183  stream << "RoI ID: " << muon.roiId()
184  << "; saddress: " << muon.saddress()
185  << "; eta: " << muon.eta()
186  << "; phi: " << muon.phi()
187  << "; pt: " << muon.pt();
188 
189  return stream.str();
190 }
MuonFeature::dq_var2
double dq_var2(void) const
Definition: MuonFeature.h:70
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
MuonFeature::dq_var1
double dq_var1(void) const
Definition: MuonFeature.h:69
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
MuonFeature::sp3_slope
float sp3_slope(void) const
Definition: MuonFeature.h:64
MuonFeature::radius
float radius(void) const
Definition: MuonFeature.h:49
MuonFeature::dir_phi
float dir_phi(void) const
Definition: MuonFeature.h:52
MuonFeature::sp1_r
float sp1_r(void) const
Definition: MuonFeature.h:56
MuonFeature::eta
float eta(void) const
Definition: MuonFeature.h:50
MuonFeature::ec_alpha
float ec_alpha(void) const
Definition: MuonFeature.h:67
MuonFeature::phi
float phi(void) const
Definition: MuonFeature.h:51
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
MuonFeature::br_radius
float br_radius(void) const
Definition: MuonFeature.h:65
MuonFeature::dir_zeta
float dir_zeta(void) const
Definition: MuonFeature.h:54
MuonFeature::saddress
int saddress(void) const
Definition: MuonFeature.h:47
MuonFeature::br_sagitta
float br_sagitta(void) const
Definition: MuonFeature.h:66
MuonFeature::sp3_z
float sp3_z(void) const
Definition: MuonFeature.h:63
MuonFeature::algoId
AlgoId algoId(void) const
Definition: MuonFeature.h:45
MuonFeature::sp3_r
float sp3_r(void) const
Definition: MuonFeature.h:62
MuonFeature::sp1_z
float sp1_z(void) const
Definition: MuonFeature.h:57
MuonFeature::sp2_z
float sp2_z(void) const
Definition: MuonFeature.h:60
MuonFeature::sp1_slope
float sp1_slope(void) const
Definition: MuonFeature.h:58
MuonFeature::sp2_slope
float sp2_slope(void) const
Definition: MuonFeature.h:61
str
std::string str(const MuonFeature &muon)
Helper function for printing the object.
Definition: MuonFeature.cxx:180
MuonFeature::ec_beta
float ec_beta(void) const
Definition: MuonFeature.h:68
MuonFeature::pt
float pt(void) const
Definition: MuonFeature.h:48
MuonFeature::beta
float beta(void) const
Definition: MuonFeature.h:55
MuonFeature::sp2_r
float sp2_r(void) const
Definition: MuonFeature.h:59
MuonFeature::zeta
float zeta(void) const
Definition: MuonFeature.h:53