ATLAS Offline Software
Loading...
Searching...
No Matches
TrigCaloCluster.cxx File Reference
#include "TrigCaloEvent/TrigCaloCluster.h"
#include <cmath>
Include dependency graph for TrigCaloCluster.cxx:

Go to the source code of this file.

Functions

std::string str (const TrigCaloCluster &d)
MsgStream & operator<< (MsgStream &m, const TrigCaloCluster &d)
bool operator== (const TrigCaloCluster &a, const TrigCaloCluster &b)
void diff (const TrigCaloCluster &a, const TrigCaloCluster &b, std::map< std::string, double > &varChange)

Function Documentation

◆ diff()

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

Definition at line 127 of file TrigCaloCluster.cxx.

128 {
129
130 double ep=0.001; // arbitrary , but seems to be reasonable
131 if ( std::fabs( a.RoIword() - b.RoIword() )>ep ) {
132 varChange[ "RoIword" ] =a.RoIword() - b.RoIword();
133 }
134 if ( std::fabs( a.rawEta() - b.rawEta() )>ep ) {
135 varChange[ "rawEta" ] =a.rawEta() - b.rawEta();
136 }
137 if ( std::fabs( a.rawPhi() - b.rawPhi() )>ep ) {
138 varChange[ "rawPhi" ] =a.rawPhi() - b.rawPhi();
139 }
140 if ( std::fabs( a.rawEt() - b.rawEt() )>ep ) {
141 varChange[ "rawEt" ] =a.rawEt() - b.rawEt();
142 }
143 if ( std::fabs( a.quality() - b.quality() )>ep ) {
144 varChange[ "quality" ] =a.quality() - b.quality();
145 }
146
147 return;
148}
static Double_t a

◆ operator<<()

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

Definition at line 111 of file TrigCaloCluster.cxx.

111 {
112 m << str(d);
113 return m;
114}

◆ operator==()

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

Definition at line 117 of file TrigCaloCluster.cxx.

117 {
118 double ep=0.001; // arbitrary , but seems to be reasonable
119 if ( std::fabs( a.RoIword() - b.RoIword() )>ep ) return false;
120 if ( std::fabs( a.rawEta() - b.rawEta() )>ep ) return false;
121 if ( std::fabs( a.rawPhi() - b.rawPhi() )>ep ) return false;
122 if ( std::fabs( a.rawEt() - b.rawEt() )>ep ) return false;
123 if ( std::fabs( a.quality() - b.quality() )>ep ) return false;
124 return true;
125}

◆ str()

std::string str ( const TrigCaloCluster & d)

Definition at line 94 of file TrigCaloCluster.cxx.

94 {
95 std::stringstream log;
96 log <<"m_rawEnergy : " << d.rawEnergy() << "; ";
97 log <<"m_rawEt : " << d.rawEt() << "; ";
98 log <<"m_rawEta : " << d.rawEta() << "; ";
99 log <<"m_rawPhi : " << d.rawPhi() << "; ";
100 log << std::hex;
101 log <<"m_roiWord : " << d.RoIword() << "; ";
102 log << std::dec;
103 log <<"m_numberUsedCells : " << d.nCells() << "; ";
104 log <<"m_quality : " << d.quality() << "; ";
105 log <<"m_rawEnergyS : ";
106 for ( int i = 0 ; i < MAXSIZE ; i++ )
107 log << d.rawEnergy((CaloSampling::CaloSample)i) << "; ";
108 return log.str();
109}