ATLAS Offline Software
Functions
TrigInDetEvent/src/TrigTauTracksInfo.cxx File Reference
#include "TrigInDetEvent/TrigTauTracksInfo.h"
Include dependency graph for TrigInDetEvent/src/TrigTauTracksInfo.cxx:

Go to the source code of this file.

Functions

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

Function Documentation

◆ diff()

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

Comparison with feedback.

Definition at line 114 of file TrigInDetEvent/src/TrigTauTracksInfo.cxx.

115  {
116 
117  static const double DELTA = 0.001;
118  if( left.roiId() != right.roiId() ) {
119  varChange[ "roiId" ] = static_cast< double >( left.roiId() - right.roiId() );
120  }
121  if( left.nCoreTracks() != right.nCoreTracks() ) {
122  varChange[ "nCoreTracks" ] = static_cast< double >( left.nCoreTracks() - right.nCoreTracks() );
123  }
124  if( left.nSlowTracks() != right.nSlowTracks() ) {
125  varChange[ "nSlowTracks" ] = static_cast< double >( left.nSlowTracks() - right.nSlowTracks() );
126  }
127  if( left.nIsoTracks() != right.nIsoTracks() ) {
128  varChange[ "nIsoTracks" ] = static_cast< double >( left.nIsoTracks() - right.nIsoTracks() );
129  }
130  if( std::abs( left.pt() - right.pt() ) > DELTA ) {
131  varChange[ "pt" ] = left.pt() - right.pt();
132  }
133  if( std::abs( left.eta() - right.eta() ) > DELTA ) {
134  varChange[ "eta" ] = left.eta() - right.eta();
135  }
136  if( std::abs( left.phi() - right.phi() ) > DELTA ) {
137  varChange[ "phi" ] = left.phi() - right.phi();
138  }
139 
140  if( std::abs( left.charge() - right.charge() ) > DELTA ) {
141  varChange[ "charge" ] = left.charge() - right.charge();
142  }
143  if( std::abs( left.leadingTrackPt() - right.leadingTrackPt() ) > DELTA ) {
144  varChange[ "leadingTrackPt" ] = left.leadingTrackPt() - right.leadingTrackPt();
145  }
146  if( left.scalarPtSumCore() != right.scalarPtSumCore() ) {
147  varChange[ "scalarPtSumCore" ] = left.scalarPtSumCore() - right.scalarPtSumCore();
148  }
149  if( left.scalarPtSumIso() != right.scalarPtSumIso() ) {
150  varChange[ "scalarPtSumIso" ] = left.scalarPtSumIso() - right.scalarPtSumIso();
151  }
152  if( left.ptBalance() != right.ptBalance() ) {
153  varChange[ "ptBalance" ] = left.ptBalance() - right.ptBalance();
154  }
155 
156  return;
157 }

◆ operator<<()

MsgStream& operator<< ( MsgStream &  m,
const TrigTauTracksInfo tau 
)

Helper operator for printing the object.

Definition at line 79 of file TrigInDetEvent/src/TrigTauTracksInfo.cxx.

79  {
80 
81  return ( m << str( tau ) );
82 
83 }

◆ operator==()

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

Operator comparing two TrigTauTracksInfo objects for equality.

Definition at line 85 of file TrigInDetEvent/src/TrigTauTracksInfo.cxx.

85  {
86 
87  static const double DELTA = 0.001;
88  if( ( left.roiId() != right.roiId() ) ||
89  ( left.nCoreTracks() != right.nCoreTracks() ) ||
90  ( left.nSlowTracks() != right.nSlowTracks() ) ||
91  ( left.nIsoTracks() != right.nIsoTracks() ) ||
92 
93  ( std::abs( left.pt() - right.pt() ) > DELTA ) ||
94  ( std::abs( left.eta() - right.eta() ) > DELTA ) ||
95  ( std::abs( left.phi() - right.phi() ) > DELTA ) ||
96 
97  ( std::abs( left.charge() - right.charge() ) > DELTA ) ||
98  ( std::abs( left.leadingTrackPt() - right.leadingTrackPt() ) > DELTA ) ||
99  ( std::abs( left.scalarPtSumCore() - right.scalarPtSumCore() ) > DELTA ) ||
100  ( std::abs( left.scalarPtSumIso() - right.scalarPtSumIso() ) > DELTA ) ||
101  ( std::abs( left.ptBalance() - right.ptBalance() ) > DELTA )
102  ) {
103 
104  return false;
105 
106  } else {
107 
108  return true;
109 
110  }
111 
112 }

◆ str()

std::string str ( const TrigTauTracksInfo tau)

Helper function for printing the object.

Definition at line 56 of file TrigInDetEvent/src/TrigTauTracksInfo.cxx.

56  {
57 
58  std::stringstream stream;
59  stream << "RoI ID: " << tau.roiId()
60  << "; pt: " << tau.pt()
61  << "; eta: " << tau.eta()
62  << "; phi: " << tau.phi()
63  << "; nCoreTracks: " << tau.nCoreTracks()
64  << "; nSlowTracks: " << tau.nSlowTracks()
65  << "; nIsoTracks: " << tau.nIsoTracks()
66  << "; charge: " << tau.charge()
67  << "; leadingTrackPt: " << tau.leadingTrackPt()
68  << "; scalarPtSumCore: " << tau.scalarPtSumCore()
69  << "; scalarPtSumIso: " << tau.scalarPtSumIso()
70  << "; ptBalance: " << tau.ptBalance()
71  << "; threeFastestTracksPt: " << tau.threeFastestTracks().pt()
72  << "; threeFastestTracksEta: " << tau.threeFastestTracks().eta()
73  << "; threeFastestTracksPhi: " << tau.threeFastestTracks().phi();
74 
75 
76  return stream.str();
77 }
str
std::string str(const TrigTauTracksInfo &tau)
Helper function for printing the object.
Definition: TrigInDetEvent/src/TrigTauTracksInfo.cxx:56
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrigTauTracksInfo::threeFastestTracks
const P4PtEtaPhiM & threeFastestTracks() const
Definition: TrigTauTracksInfo.h:50
TrigTauTracksInfo::roiId
int roiId() const
getters
Definition: TrigTauTracksInfo.h:37
TrigTauTracksInfo::nCoreTracks
int nCoreTracks() const
Definition: TrigTauTracksInfo.h:39
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
TrigTauTracksInfo::leadingTrackPt
float leadingTrackPt() const
Definition: TrigTauTracksInfo.h:44
P4PtEtaPhiM::phi
virtual double phi() const
get phi data member
Definition: P4PtEtaPhiM.h:109
TrigTauTracksInfo::charge
float charge() const
Definition: TrigTauTracksInfo.h:43
P4PtEtaPhiM::pt
virtual double pt() const
get pt data member
Definition: P4PtEtaPhiM.h:103
P4PtEtaPhiM::eta
virtual double eta() const
get eta data member
Definition: P4PtEtaPhiM.h:106
TrigTauTracksInfo::nIsoTracks
int nIsoTracks() const
Definition: TrigTauTracksInfo.h:41
TrigTauTracksInfo::ptBalance
float ptBalance() const
Definition: TrigTauTracksInfo.h:48
TrigTauTracksInfo::nSlowTracks
int nSlowTracks() const
Definition: TrigTauTracksInfo.h:40
TrigTauTracksInfo::scalarPtSumCore
float scalarPtSumCore() const
Definition: TrigTauTracksInfo.h:46
TrigTauTracksInfo::scalarPtSumIso
float scalarPtSumIso() const
Definition: TrigTauTracksInfo.h:47