ATLAS Offline Software
Classes | Functions | Variables
TrigTauClusterDetails.h File Reference
#include <math.h>
#include <iostream>
#include "GaudiKernel/MsgStream.h"
#include "AthenaKernel/CLASS_DEF.h"
Include dependency graph for TrigTauClusterDetails.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TrigTauClusterDetails
 

Functions

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

Variables

const int NUMEMSAMP = 4
 Number of EM Samples. More...
 
const int NUMHADSAMP = 3
 Number of HAD Samples. More...
 

Function Documentation

◆ diff()

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

Comparison with feedback.

Definition at line 160 of file TrigTauClusterDetails.cxx.

162 {
163  double epsilon=0.001;
164 
165  char name[32];
166  for (int i = 0; i< NUMEMSAMP ; i++) {
167  if (fabs(clus1.EMRadius(i) - clus2.EMRadius(i)) > epsilon)
168  {sprintf(name,"EMRadius[%d]",i); varChange[name] = clus1.EMRadius(i) - clus2.EMRadius(i); }
169  if (fabs(clus1.EMenergyWidth(i) - clus2.EMenergyWidth(i)) > epsilon)
170  {sprintf(name,"EMRadius[%d]",i); varChange[name] = clus1.EMenergyWidth(i) - clus2.EMenergyWidth(i); }
171  if (fabs(clus1.EMenergyWide(i) - clus2.EMenergyWide(i)) > epsilon)
172  {sprintf(name,"EMRadius[%d]",i); varChange[name] = clus1.EMenergyWide(i) - clus2.EMenergyWide(i); }
173  if (fabs(clus1.EMenergyMedium(i) - clus2.EMenergyMedium(i)) > epsilon)
174  {sprintf(name,"EMRadius[%d]",i); varChange[name] = clus1.EMenergyMedium(i) - clus2.EMenergyMedium(i); }
175  if (fabs(clus1.EMenergyNarrow(i) - clus2.EMenergyNarrow(i)) > epsilon)
176  {sprintf(name,"EMRadius[%d]",i); varChange[name] = clus1.EMenergyNarrow(i) - clus2.EMenergyNarrow(i); }
177 
178  }
179  for (int i = 0; i< NUMHADSAMP ; i++) {
180  if (fabs(clus1.HADRadius(i) - clus2.HADRadius(i)) > epsilon)
181  {sprintf(name,"EMRadius[%d]",i); varChange[name] = clus1.HADRadius(i) - clus2.HADRadius(i); }
182  if (fabs(clus1.HADenergyWidth(i) - clus2.HADenergyWidth(i)) > epsilon)
183  {sprintf(name,"EMRadius[%d]",i); varChange[name] =clus1.HADenergyWidth(i) - clus2.HADenergyWidth(i) ; }
184  if (fabs(clus1.HADenergyWide(i) - clus2.HADenergyWide(i)) > epsilon)
185  {sprintf(name,"EMRadius[%d]",i); varChange[name] = clus1.HADenergyWide(i) - clus2.HADenergyWide(i); }
186  if (fabs(clus1.HADenergyMedium(i) - clus2.HADenergyMedium(i)) > epsilon)
187  {sprintf(name,"EMRadius[%d]",i); varChange[name] = clus1.HADenergyMedium(i) - clus2.HADenergyMedium(i); }
188  if (fabs(clus1.HADenergyNarrow(i) - clus2.HADenergyNarrow(i)) > epsilon)
189  {sprintf(name,"EMRadius[%d]",i); varChange[name] = clus1.HADenergyNarrow(i) - clus2.HADenergyNarrow(i); }
190  }
191 
192  return ;
193 }

◆ operator!=()

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

Operator comparing two TrigTauCluster objects for inequality.

Definition at line 141 of file TrigTauClusterDetails.h.

141  {
142  return !( left == right );
143 }

◆ operator<<()

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

Helper operator for printing the object.

Definition at line 154 of file TrigTauClusterDetails.cxx.

155 {
156  m << str(tau);
157  return m;
158 }

◆ operator==()

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

Operator comparing two TrigTauCluster objects for equality.

Definition at line 97 of file TrigTauClusterDetails.cxx.

97  {
98 
99  double epsilon=0.001;
100 
101  for (int i = 0; i< NUMEMSAMP ; i++) {
102  if (fabs(clus1.EMRadius(i) - clus2.EMRadius(i)) > epsilon) return false;
103  if (fabs(clus1.EMenergyWidth(i) - clus2.EMenergyWidth(i)) > epsilon) return false;
104  if (fabs(clus1.EMenergyWide(i) - clus2.EMenergyWide(i)) > epsilon) return false;
105  if (fabs(clus1.EMenergyMedium(i) - clus2.EMenergyMedium(i)) > epsilon) return false;
106  if (fabs(clus1.EMenergyNarrow(i) - clus2.EMenergyNarrow(i)) > epsilon) return false;
107 
108  }
109  for (int i = 0; i< NUMHADSAMP ; i++) {
110  if (fabs(clus1.HADRadius(i) - clus2.HADRadius(i)) > epsilon) return false;
111  if (fabs(clus1.HADenergyWidth(i) - clus2.HADenergyWidth(i)) > epsilon) return false;
112  if (fabs(clus1.HADenergyWide(i) - clus2.HADenergyWide(i)) > epsilon) return false;
113  if (fabs(clus1.HADenergyMedium(i) - clus2.HADenergyMedium(i)) > epsilon) return false;
114  if (fabs(clus1.HADenergyNarrow(i) - clus2.HADenergyNarrow(i)) > epsilon) return false;
115  }
116 
117  return true;
118 }

◆ str()

std::string str ( const TrigTauClusterDetails tau)

Helper function for printing the object.

Definition at line 121 of file TrigTauClusterDetails.cxx.

122 {
123  std::stringstream stream;
124  stream << " EMRad: ";
125  for (int i = 0; i< NUMEMSAMP ; i++) stream << tau.EMRadius(i) << "/";
126  stream << "; EMEnergyWidth: ";
127  for (int i = 0; i< NUMEMSAMP ; i++) stream << tau.EMenergyWidth(i) << "/";
128  stream << "; EMEnergy(dR<0.1): ";
129  for (int i = 0; i< NUMEMSAMP ; i++) stream << tau.EMenergyNarrow(i) << "/";
130  stream << "; EMEnergy(dR<0.2): ";
131  for (int i = 0; i< NUMEMSAMP ; i++) stream << tau.EMenergyMedium(i) << "/";
132  stream << "; EMEnergy(dR<0.3): ";
133  for (int i = 0; i< NUMEMSAMP ; i++) stream << tau.EMenergyWide(i) << "/";
134 
135  stream << "; HADRad: ";
136  for (int i = 0; i< NUMHADSAMP ; i++) stream << tau.HADRadius(i) << "/";
137  stream << "; HADEnergyWidth: ";
138  for (int i = 0; i< NUMHADSAMP ; i++) stream << tau.HADenergyWidth(i) << "/";
139  stream << "; HADEnergy(dR<0.1): ";
140  for (int i = 0; i< NUMHADSAMP ; i++) stream << tau.HADenergyNarrow(i) << "/";
141  stream << "; HADEnergy(dR<0.2): ";
142  for (int i = 0; i< NUMHADSAMP ; i++) stream << tau.HADenergyMedium(i) << "/";
143  stream << "; HADEnergy(dR<0.3): ";
144  for (int i = 0; i< NUMHADSAMP ; i++) stream << tau.HADenergyWide(i) << "/";
145 
146 
147 
148  return stream.str();
149 }

Variable Documentation

◆ NUMEMSAMP

const int NUMEMSAMP = 4

Number of EM Samples.

Definition at line 26 of file TrigTauClusterDetails.h.

◆ NUMHADSAMP

const int NUMHADSAMP = 3

Number of HAD Samples.

Definition at line 28 of file TrigTauClusterDetails.h.

TrigTauClusterDetails::EMRadius
float EMRadius(int samp) const
get EM Radius per sampling
Definition: TrigTauClusterDetails.h:80
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrigTauClusterDetails::HADenergyWide
float HADenergyWide(int samp) const
get HAD Energy in the normalization region (0.3x0.3)
Definition: TrigTauClusterDetails.h:98
TrigTauClusterDetails::EMenergyWide
float EMenergyWide(int samp) const
get EM Energy in the mormalization region (0.3x0.3)
Definition: TrigTauClusterDetails.h:91
TrigTauClusterDetails::EMenergyNarrow
float EMenergyNarrow(int samp) const
get EM Energy in the narrow region (0.1x0.1)
Definition: TrigTauClusterDetails.h:95
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
TrigTauClusterDetails::HADenergyMedium
float HADenergyMedium(int samp) const
get HAD Energy in the wide region (0.2x0.2)
Definition: TrigTauClusterDetails.h:100
lumiFormat.i
int i
Definition: lumiFormat.py:85
NUMHADSAMP
const int NUMHADSAMP
Number of HAD Samples.
Definition: TrigTauClusterDetails.h:28
TrigTauClusterDetails::HADenergyWidth
float HADenergyWidth(int samp) const
get Width in HAD samplings
Definition: TrigTauClusterDetails.h:87
TrigTauClusterDetails::HADRadius
float HADRadius(int samp) const
get HAD Radius per sampling
Definition: TrigTauClusterDetails.h:82
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigTauClusterDetails::EMenergyWidth
float EMenergyWidth(int samp) const
get Width in EM samplings
Definition: TrigTauClusterDetails.h:84
NUMEMSAMP
const int NUMEMSAMP
Number of EM Samples.
Definition: TrigTauClusterDetails.h:26
str
std::string str(const TrigTauClusterDetails &tau)
Helper function for printing the object.
Definition: TrigTauClusterDetails.cxx:121
TrigTauClusterDetails::HADenergyNarrow
float HADenergyNarrow(int samp) const
get HAD Energy in the narrow region (0.1x0.1)
Definition: TrigTauClusterDetails.h:102
TrigTauClusterDetails::EMenergyMedium
float EMenergyMedium(int samp) const
get EM Energy in the wide region (0.2x0.2)
Definition: TrigTauClusterDetails.h:93