ATLAS Offline Software
Functions
TrigTau.cxx File Reference
#include "TrigParticle/TrigTau.h"
Include dependency graph for TrigTau.cxx:

Go to the source code of this file.

Functions

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

Function Documentation

◆ diff()

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

Comparison with feedback.

Definition at line 154 of file TrigTau.cxx.

155  {
156 
157  static const double DELTA = 0.001;
158  if( left.roiId() != right.roiId() ) {
159  varChange[ "roiId" ] = static_cast< double >( left.roiId() - right.roiId() );
160  }
161  if( std::abs( left.pt() - right.pt() ) > DELTA ) {
162  varChange[ "pt" ] = left.pt() - right.pt();
163  }
164  if( std::abs( left.eta() - right.eta() ) > DELTA ) {
165  varChange[ "eta" ] = left.eta() - right.eta();
166  }
167  if( std::abs( left.phi() - right.phi() ) > DELTA ) {
168  varChange[ "phi" ] = left.phi() - right.phi();
169  }
170 
171  if( std::abs( left.etCalibCluster() - right.etCalibCluster() ) > DELTA ) {
172  varChange[ "etCalibCluster" ] = left.etCalibCluster() - right.etCalibCluster();
173  }
174  if( std::abs( left.simpleEtFlow() - right.simpleEtFlow() ) > DELTA ) {
175  varChange[ "simpleEtFlow" ] = left.simpleEtFlow() - right.simpleEtFlow();
176  }
177  if( left.nMatchedTracks() != right.nMatchedTracks() ) {
178  varChange[ "nMatchedTracks" ] = left.nMatchedTracks() - right.nMatchedTracks();
179  }
180  if( left.trkAvgDist() != right.trkAvgDist() ) {
181  varChange[ "trkAvgDist" ] = left.trkAvgDist() - right.trkAvgDist();
182  }
183  if( left.etOverPtLeadTrk() != right.etOverPtLeadTrk() ) {
184  varChange[ "etOverPtLeadTrk" ] = left.etOverPtLeadTrk() - right.etOverPtLeadTrk();
185  }
186 
187  return;
188 }

◆ operator<<()

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

Helper operator for printing the object.

Definition at line 124 of file TrigTau.cxx.

124  {
125 
126  return ( m << str( tau ) );
127 
128 }

◆ operator==()

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

Operator comparing two TrigTau objects for equality.

Definition at line 130 of file TrigTau.cxx.

130  {
131 
132  static const double DELTA = 0.001;
133  if( ( left.roiId() != right.roiId() ) ||
134  ( std::abs( left.pt() - right.pt() ) > DELTA ) ||
135  ( std::abs( left.eta() - right.eta() ) > DELTA ) ||
136  ( std::abs( left.phi() - right.phi() ) > DELTA ) ||
137  ( std::abs( left.etCalibCluster() - right.etCalibCluster() ) > DELTA ) ||
138  ( std::abs( left.simpleEtFlow() - right.simpleEtFlow() ) > DELTA ) ||
139  ( left.nMatchedTracks() != right.nMatchedTracks() ) ||
140  ( std::abs( left.trkAvgDist() - right.trkAvgDist() ) > DELTA ) ||
141  ( std::abs( left.etOverPtLeadTrk() - right.etOverPtLeadTrk() ) > DELTA )
142  ) {
143 
144  return false;
145 
146  } else {
147 
148  return true;
149 
150  }
151 
152 }

◆ str()

std::string str ( const TrigTau tau)

Helper function for printing the object.

Definition at line 106 of file TrigTau.cxx.

106  {
107 
108  std::stringstream stream;
109  stream << "RoI ID: " << tau.roiId()
110  << "; pt: " << tau.pt()
111  << "; eta: " << tau.eta()
112  << "; phi: " << tau.phi()
113  << "; etCalibCluster: " << tau.etCalibCluster()
114  << "; simpleEtFlow: " << tau.simpleEtFlow()
115  << "; nMatchedTracks: " << tau.nMatchedTracks();
116  // << "; Zvtx: " << tau.Zvtx()
117  // << "; err_Zvtx: " << tau.err_Zvtx();
118  stream << "; trkAvgDist: "<< tau.trkAvgDist()
119  << "; etOverPtLeadTrk: "<<tau.etOverPtLeadTrk();
120 
121  return stream.str();
122 }
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrigTau::trkAvgDist
float trkAvgDist() const
Definition: TrigTau.cxx:82
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
P4PtEtaPhiM::phi
virtual double phi() const
get phi data member
Definition: P4PtEtaPhiM.h:109
TrigTau::nMatchedTracks
int nMatchedTracks() const
Definition: TrigTau.cxx:81
P4PtEtaPhiM::pt
virtual double pt() const
get pt data member
Definition: P4PtEtaPhiM.h:103
TrigTau::roiId
int roiId() const
accessor methods
Definition: TrigTau.cxx:71
TrigTau::simpleEtFlow
float simpleEtFlow() const
Definition: TrigTau.cxx:79
P4PtEtaPhiM::eta
virtual double eta() const
get eta data member
Definition: P4PtEtaPhiM.h:106
TrigTau::etOverPtLeadTrk
float etOverPtLeadTrk() const
Definition: TrigTau.cxx:83
TrigTau::etCalibCluster
float etCalibCluster() const
Definition: TrigTau.cxx:77
str
std::string str(const TrigTau &tau)
Helper function for printing the object.
Definition: TrigTau.cxx:106