ATLAS Offline Software
Classes | Functions
TrigTauCluster.h File Reference
#include <math.h>
#include "AthLinks/ElementLink.h"
#include "TrigCaloEvent/TrigCaloCluster.h"
#include "TrigCaloEvent/TrigTauClusterDetailsContainer.h"
#include "TrigCaloEvent/TrigTauClusterContainer.h"
Include dependency graph for TrigTauCluster.h:

Go to the source code of this file.

Classes

class  TrigTauCluster
 Class with calibrated variables for tau clustering. More...
 

Functions

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

Function Documentation

◆ diff()

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

Comparison with feedback.

Definition at line 245 of file TrigTauCluster.cxx.

246 {
247  const double epsilon = 0.001;
248  diff((const TrigCaloCluster&)clus1, (const TrigCaloCluster&)clus2, varChange);
249 
250  if(fabs(clus1.EMenergy() - clus2.EMenergy()) > epsilon)
251  {
252  varChange["EMEnergy"] = clus1.EMenergy() - clus2.EMenergy();
253  }
254  if(fabs(clus1.HADenergy() - clus2.HADenergy()) > epsilon)
255  {
256  varChange["HADenergy"] = clus1.HADenergy() - clus2.HADenergy();
257  }
258  if(fabs(clus1.eCalib() - clus2.eCalib()) > epsilon)
259  {
260  varChange["eCalib"] = clus1.eCalib() - clus2.eCalib();
261  }
262  if(fabs(clus1.EMRadius2() - clus2.EMRadius2()) > epsilon)
263  {
264  varChange["EMRadius2"] = clus1.EMRadius2() - clus2.EMRadius2();
265  }
266  if(fabs(clus1.CaloRadius() - clus2.CaloRadius()) > epsilon)
267  {
268  varChange["CaloRadius"] = clus1.CaloRadius() - clus2.CaloRadius();
269  }
270  if(fabs(clus1.IsoFrac() - clus2.IsoFrac()) > epsilon)
271  {
272  varChange["IsoFrac"] = clus1.IsoFrac() - clus2.IsoFrac();
273  }
274  if(abs(clus1.numStripCells() - clus2.numStripCells()) > epsilon)
275  {
276  varChange["numStripCells"] = clus1.numStripCells() - clus2.numStripCells();
277  }
278  if(abs(clus1.numTotCells() - clus2.numTotCells()) > epsilon)
279  {
280  varChange["numTotCells"] = clus1.numTotCells() - clus2.numTotCells();
281  }
282  if(fabs(clus1.stripWidth() - clus2.stripWidth()) > epsilon)
283  {
284  varChange["stripWidth"] = clus1.stripWidth() - clus2.stripWidth();
285  }
286  if(fabs(clus1.stripWidthOffline() - clus2.stripWidthOffline()) > epsilon)
287  {
288  varChange["stripWidthOffline"] = clus1.stripWidthOffline() - clus2.stripWidthOffline();
289  }
290  if(fabs(clus1.EMRadius3S() - clus2.EMRadius3S()) > epsilon)
291  {
292  varChange["EMRadius3S"] = clus1.EMRadius3S() - clus2.EMRadius3S();
293  }
294  if(fabs(clus1.CoreFrac() - clus2.CoreFrac()) > epsilon)
295  {
296  varChange["CoreFrac"] = clus1.CoreFrac() - clus2.CoreFrac();
297  }
298  if(fabs(clus1.EMFrac() - clus2.EMFrac()) > epsilon)
299  {
300  varChange["EMFrac"] = clus1.EMFrac() - clus2.EMFrac();
301  }
302  if(fabs(clus1.HadRadius() - clus2.HadRadius()) > epsilon)
303  {
304  varChange["HadRadius"] = clus1.HadRadius() - clus2.HadRadius();
305  }
306 
307  if(clus1.clusterDetails() != 0 && clus2.clusterDetails() == 0)
308  {
309  varChange["clusterDetails "] = 1;
310  }
311  else if(clus1.clusterDetails() == 0 && clus2.clusterDetails() != 0)
312  {
313  varChange["clusterDetails "] = -1;
314  }
315  else if(clus1.clusterDetails() != 0 && clus2.clusterDetails() != 0 && clus1.clusterDetails() != clus2.clusterDetails())
316  {
317  diff(clus1.clusterDetails(), clus2.clusterDetails(), varChange);
318  }
319  return;
320 }

◆ operator!=()

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

Operator comparing two TrigTauCluster objects for inequality.

Definition at line 205 of file TrigTauCluster.h.

206 {
207  return !(left == right);
208 }

◆ operator<<()

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

Helper operator for printing the object.

Definition at line 239 of file TrigTauCluster.cxx.

240 {
241  return (m << str(tau));
242 }

◆ operator==()

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

Operator comparing two TrigTauCluster objects for equality.

Definition at line 180 of file TrigTauCluster.cxx.

181 {
182  //if(clus1.clusterDetails() != 0 && clus2.clusterDetails() == 0 ) return false;
183  //if(clus1.clusterDetails() == 0 && clus2.clusterDetails() != 0 ) return false;
184  if((const TrigCaloCluster&)clus1 != (const TrigCaloCluster&)clus2)
185  {
186  return false;
187  }
188 
189  double epsilon=0.001;
190  if(fabs(clus1.EMenergy() - clus2.EMenergy()) > epsilon) return false;
191  if(fabs(clus1.HADenergy() - clus2.HADenergy()) > epsilon) return false;
192  if(fabs(clus1.eCalib() - clus2.eCalib()) > epsilon) return false;
193  if(fabs(clus1.EMRadius2() - clus2.EMRadius2()) > epsilon) return false;
194  if(fabs(clus1.CaloRadius() - clus2.CaloRadius()) > epsilon) return false;
195  if(fabs(clus1.IsoFrac() - clus2.IsoFrac()) > epsilon) return false;
196  if(abs(clus1.numStripCells() - clus2.numStripCells()) > epsilon) return false;
197  if(abs(clus1.numTotCells() - clus2.numTotCells()) > epsilon) return false;
198  if(fabs(clus1.stripWidth() - clus2.stripWidth()) > epsilon) return false;
199  if(fabs(clus1.stripWidthOffline() - clus2.stripWidthOffline() ) > epsilon) return false;
200  if(fabs(clus1.EMRadius3S() - clus2.EMRadius3S()) > epsilon) return false;
201  if(fabs(clus1.CoreFrac() - clus2.CoreFrac()) > epsilon) return false;
202  if(fabs(clus1.EMFrac() - clus2.EMFrac()) > epsilon) return false;
203  if(fabs(clus1.HadRadius() - clus2.HadRadius()) > epsilon) return false;
204 
205  if(clus1.clusterDetails() != 0 && clus2.clusterDetails() != 0 && clus1.clusterDetails() != clus2.clusterDetails())
206  {
207  return false;
208  }
209 
210  return true;
211 }

◆ str()

std::string str ( const TrigTauCluster tau)

Helper function for printing the object.

Definition at line 213 of file TrigTauCluster.cxx.

214 {
215  std::stringstream stream;
216  stream << str((const TrigCaloCluster&) tau)
217  << "; EMenergy:" << tau.EMenergy()
218  << "; HADenergy:" << tau.HADenergy()
219  << "; eCalib:" << tau.eCalib()
220  << "; EMRadius2:" << tau.EMRadius2()
221  << "; CaloRadius:" << tau.CaloRadius()
222  << "; IsoFrac:" << tau.IsoFrac()
223  << "; numStripCells:" << tau.numStripCells()
224  << "; numTotCells:" << tau.numTotCells()
225  << "; stripWidth:" << tau.stripWidth()
226  << "; stripWidthOffline:" << tau.stripWidthOffline()
227  << "; EMRadius3S:" << tau.EMRadius3S()
228  << "; CoreFrac:" << tau.CoreFrac()
229  << "; EMFrac:" << tau.EMFrac()
230  << "; HadRadius:" << tau.HadRadius();
231  if(tau.clusterDetails() != 0)
232  {
233  stream << "; " << str(*tau.clusterDetails());
234  }
235 
236  return stream.str();
237 }
TrigTauCluster::EMenergy
float EMenergy() const
get EM Energy
Definition: TrigTauCluster.h:109
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrigTauCluster::clusterDetails
const TrigTauClusterDetails * clusterDetails() const
accessor to TrigTauClusterDetails*
Definition: TrigTauCluster.cxx:156
TrigTauCluster::EMRadius3S
float EMRadius3S() const
get EM Radius 3S
Definition: TrigTauCluster.h:145
TrigTauCluster::IsoFrac
float IsoFrac() const
get Isolation Fraction
Definition: TrigTauCluster.h:127
TrigTauCluster::CaloRadius
float CaloRadius() const
get Total Calo Radius
Definition: TrigTauCluster.h:123
TrigTauCluster::stripWidth
float stripWidth() const
get Width in the strip sampling
Definition: TrigTauCluster.h:137
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
diff
void diff(const TrigTauCluster &clus1, const TrigTauCluster &clus2, std::map< std::string, double > &varChange)
Comparison with feedback.
Definition: TrigTauCluster.cxx:245
str
std::string str(const TrigTauCluster &tau)
Helper function for printing the object.
Definition: TrigTauCluster.cxx:213
TrigTauCluster::numTotCells
int numTotCells() const
get Number of total cells in the cluster
Definition: TrigTauCluster.h:135
TrigCaloCluster
Base Cluster Class.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:39
TrigTauCluster::EMFrac
float EMFrac() const
get EM Fraction
Definition: TrigTauCluster.h:149
TrigTauCluster::HadRadius
float HadRadius() const
get Hadronic Radius
Definition: TrigTauCluster.h:151
TrigTauCluster::eCalib
float eCalib() const
get Calibrated Energy
Definition: TrigTauCluster.h:141
TrigTauCluster::EMRadius2
float EMRadius2() const
get EM Radius
Definition: TrigTauCluster.h:121
TrigTauCluster::stripWidthOffline
float stripWidthOffline() const
get Width as in offline
Definition: TrigTauCluster.h:139
TrigTauCluster::HADenergy
float HADenergy() const
get HAD Energy
Definition: TrigTauCluster.h:111
TrigTauCluster::numStripCells
int numStripCells() const
get Number of fired strips
Definition: TrigTauCluster.h:133
TrigTauCluster::CoreFrac
float CoreFrac() const
get Core Fraction
Definition: TrigTauCluster.h:147