ATLAS Offline Software
Classes | Functions
TrigTau.h File Reference
#include <vector>
#include <iostream>
#include <string>
#include "FourMom/P4PtEtaPhiM.h"
#include "Navigation/Navigable.h"
#include "EventKernel/INavigable4Momentum.h"
#include "TrigCaloEvent/TrigTauCluster.h"
#include "TrigInDetEvent/TrigTauTracksInfo.h"
#include "TrigInDetEvent/TrigInDetTrackCollection.h"
#include "TrigParticle/TrigTauContainer.h"

Go to the source code of this file.

Classes

class  TrigTau
 File: TrigTau.h. More...
 

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...
 
bool operator!= (const TrigTau &left, const TrigTau &right)
 Operator comparing two TrigTau objects for inequality. 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 155 of file TrigTau.cxx.

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

◆ operator!=()

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

Operator comparing two TrigTau objects for inequality.

Definition at line 126 of file TrigTau.h.

126  {
127  return !( left == right );
128 }

◆ operator<<()

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

Helper operator for printing the object.

Definition at line 125 of file TrigTau.cxx.

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

◆ operator==()

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

Operator comparing two TrigTau objects for equality.

Definition at line 131 of file TrigTau.cxx.

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

◆ str()

std::string str ( const TrigTau tau)

Helper function for printing the object.

Definition at line 107 of file TrigTau.cxx.

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