ATLAS Offline Software
Loading...
Searching...
No Matches
TrigTau.h File Reference

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.
MsgStream & operator<< (MsgStream &m, const TrigTau &tau)
 Helper operator for printing the object.
bool operator== (const TrigTau &left, const TrigTau &right)
 Operator comparing two TrigTau objects for equality.
bool operator!= (const TrigTau &left, const TrigTau &right)
 Operator comparing two TrigTau objects for inequality.
void diff (const TrigTau &left, const TrigTau &right, std::map< std::string, double > &varChange)
 Comparison with feedback.

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}
static const double DELTA
virtual double pt() const
get pt data member
virtual double eta() const
get eta data member
virtual double phi() const
get phi data member
int roiId() const
accessor methods
Definition TrigTau.cxx:72
int nMatchedTracks() const
Definition TrigTau.cxx:82
float simpleEtFlow() const
Definition TrigTau.cxx:80
float etCalibCluster() const
Definition TrigTau.cxx:78
float etOverPtLeadTrk() const
Definition TrigTau.cxx:84
float trkAvgDist() const
Definition TrigTau.cxx:83

◆ 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}