ATLAS Offline Software
Loading...
Searching...
No Matches
TrigT2Jet.cxx File Reference
#include "TrigCaloEvent/TrigT2Jet.h"
#include "TrigCaloEvent/Trig3Momentum.h"
#include "GaudiKernel/MsgStream.h"
Include dependency graph for TrigT2Jet.cxx:

Go to the source code of this file.

Functions

bool operator== (const TrigT2Jet &a, const TrigT2Jet &b)
 Operator comparing two objects for equality.
std::string str (const TrigT2Jet &a)
 conversion to formatted string: multi-line!
MsgStream & operator<< (MsgStream &m, const TrigT2Jet &d)
 formatted output
void diff (const TrigT2Jet &a, const TrigT2Jet &b, std::map< std::string, double > &variableChange)
 Comparison with feedback.

Function Documentation

◆ diff()

void diff ( const TrigT2Jet & a,
const TrigT2Jet & b,
std::map< std::string, double > & variableChange )

Comparison with feedback.

Definition at line 62 of file TrigT2Jet.cxx.

63 {
64 const double DELTA=1e-3; // distance used to compare floats
65
66 unsigned long aRoI = (unsigned long) a.RoIword();
67 unsigned long bRoI = (unsigned long) b.RoIword();
68 if( aRoI != bRoI )
69 variableChange[ "RoIwordsXOR" ] = aRoI ^ bRoI;
70
71 float aE = a.e();
72 float bE = b.e();
73 if( fabsf(aE - bE) > DELTA )
74 variableChange[ "E" ] = aE - bE;
75
76 float aEHad0 = a.ehad0();
77 float bEHad0 = b.ehad0();
78 if( fabsf(aEHad0 - bEHad0) > DELTA )
79 variableChange[ "EHad0" ] = aEHad0 - bEHad0;
80
81 float aEEM0 = a.eem0();
82 float bEEM0 = b.eem0();
83 if( fabsf(aEEM0 - bEEM0) > DELTA )
84 variableChange[ "EEM0" ] = aEEM0 - bEEM0;
85
86 float aEta = a.eta();
87 float bEta = b.eta();
88 if( fabsf(aEta - bEta) > DELTA )
89 variableChange[ "Eta" ] = aEta - bEta;
90
91 float aPhi = a.phi();
92 float bPhi = b.phi();
93 if( fabsf(aPhi - bPhi) > DELTA )
94 variableChange[ "Phi" ] = aPhi - bPhi;
95
96 // Cleaning:
97 int diffLeadingCells = a.nLeadingCells() - b.nLeadingCells();
98 if( diffLeadingCells != 0){
99 variableChange[ "nLeadCells" ] = diffLeadingCells;
100 }
101
102 float diffhecf = a.hecf() - b.hecf();
103 if( fabsf(diffhecf) > DELTA){
104 variableChange[ "hecf" ] = diffhecf;
105 }
106
107 float diffjetQuality = a.jetQuality() - b.jetQuality();
108 if( fabsf(diffjetQuality) > DELTA){
109 variableChange[ "jetQual" ] = diffjetQuality;
110 }
111
112 float diffemf = a.emf() - b.emf();
113 if( fabsf(diffemf) > DELTA){
114 variableChange[ "emf" ] = diffemf;
115 }
116
117 float diffjetTime = a.jetTimeCells() - b.jetTimeCells();
118 if( fabsf(diffjetTime) > DELTA ){
119 variableChange[ "jetTime" ] = diffjetTime;
120 }
121
122
123 return;
124}
static const double DELTA
static Double_t a

◆ operator<<()

MsgStream & operator<< ( MsgStream & m,
const TrigT2Jet & d )

formatted output

Definition at line 58 of file TrigT2Jet.cxx.

58 {
59 return ( m << str( d ) );
60}

◆ operator==()

bool operator== ( const TrigT2Jet & a,
const TrigT2Jet & b )

Operator comparing two objects for equality.

Definition at line 17 of file TrigT2Jet.cxx.

17 {
18
19 const double DELTA=1e-3; // distance used to compare floats
20
21 if ( std::abs(a.e() - b.e()) > DELTA) return false;
22 if ( std::abs(a.ehad0() - b.ehad0()) > DELTA) return false;
23 if ( std::abs(a.eem0() - b.eem0()) > DELTA) return false;
24 if ( std::abs(a.eta() - b.eta()) > DELTA) return false;
25 if ( std::abs(a.phi() - b.phi()) > DELTA) return false;
26 if( a.RoIword() != b.RoIword() ) return false;
27 // Cleaning:
28 if( a.nLeadingCells() != b.nLeadingCells() ) return false;
29 if( std::abs(a.hecf() - b.hecf()) > DELTA ) return false;
30 if( std::abs(a.jetQuality() - b.jetQuality()) > DELTA ) return false;
31 if( std::abs(a.emf() - b.emf()) > DELTA ) return false;
32 if( std::abs(a.jetTimeCells() - b.jetTimeCells()) > DELTA ) return false;
33
34
35 return true;
36}

◆ str()

std::string str ( const TrigT2Jet & a)

conversion to formatted string: multi-line!

Definition at line 38 of file TrigT2Jet.cxx.

38 {
39
40 std::string s="";
41 char buff[1024];
42
43 std::sprintf(buff,"L2 Jet E = %10.2f MeV\n", a.e()); s += buff;
44 std::sprintf(buff,"L2 Jet EHad0 = %10.2f MeV\n", a.ehad0()); s += buff;
45 std::sprintf(buff,"L2 Jet EEM0 = %10.2f MeV\n", a.eem0()); s += buff;
46 std::sprintf(buff,"L2 Jet Eta = %10.2f \n", a.eta()); s += buff;
47 std::sprintf(buff,"L2 Jet Phi = %10.2f \n", a.phi()); s += buff;
48
49 if(a.grid()) {
50 std::sprintf(buff,"Grid Members = %4d\n", (int)a.grid()->size()); s += buff;
51 }
52
53 return s;
54
55}