ATLAS Offline Software
Loading...
Searching...
No Matches
TrigElectron.cxx File Reference
#include "CaloGeoHelpers/CaloSampling.h"
#include "TrigParticle/TrigElectron.h"
#include "TruthUtils/ParticleConstants.h"
Include dependency graph for TrigElectron.cxx:

Go to the source code of this file.

Functions

bool operator== (const TrigElectron &te1, const TrigElectron &te2)
 Two TrigElectron are the same if they have the same cluster and the same track (and if valid, i.e.
void diff (const TrigElectron &te1, const TrigElectron &te2, std::map< std::string, double > &v_diff)
 Function compares two objects and returns "semi verbose" output in the form of map v_diff where varaible names and relative differences between two objects are returned.
MsgStream & operator<< (MsgStream &msg, const TrigElectron &te)

Function Documentation

◆ diff()

void diff ( const TrigElectron & te1,
const TrigElectron & te2,
std::map< std::string, double > & v_diff )

Function compares two objects and returns "semi verbose" output in the form of map v_diff where varaible names and relative differences between two objects are returned.

Definition at line 328 of file TrigElectron.cxx.

328 {
329
330 v_diff["RoI"] = te1.roiId() - te2.roiId();
331 v_diff["Charge"] = std::abs( te1.charge() - te2.charge() );
332 v_diff["Eta"] = fabs( te1.eta() - te2.eta() );
333 double d_phi = fabs( te1.phi() - te2.phi() );
334 v_diff["Phi"] = (d_phi < M_PI ? d_phi : 2*M_PI - d_phi);
335 v_diff["Pt"] = 2 * fabs( (fabs(te1.pt()) - fabs(te2.pt())) / (fabs(te1.pt())+fabs(te2.pt())) );
336 v_diff["Zvtx"] = fabs( te1.Zvtx() - te2.Zvtx() );
337 v_diff["trkEtaEtCalo"] = fabs( te1.trkEtaAtCalo() - te2.trkEtaAtCalo() );
338 double d_phi_extrapol = fabs( te1.trkPhiAtCalo() - te2.trkPhiAtCalo() );
339 v_diff["trkPhiEtCalo"] = (d_phi_extrapol < M_PI ? d_phi_extrapol : 2*M_PI - d_phi_extrapol);
340 v_diff["TRThits"] = abs(te1.nTRTHits() - te2.nTRTHits());
341 v_diff["TRThitsHiThres"] = abs(te1.nTRTHiThresholdHits() - te2.nTRTHiThresholdHits());
342 // v_diff["E"] = fabs(te1.E() - te2.E());
343 v_diff["F0"] = fabs(te1.F0() - te2.F0());
344 v_diff["F1"] = fabs(te1.F1() - te2.F1());
345 v_diff["F2"] = fabs(te1.F2() - te2.F2());
346 v_diff["F3"] = fabs(te1.F3() - te2.F3());
347
348 return;
349}
#define M_PI
virtual double pt() const
get pt data member
virtual double eta() const
get eta data member
virtual double phi() const
get phi data member
float F0() const
accessors for calibrated energy fractions in each sampling - to reject noise
int charge() const
accessor to return the track charge (sign of TrigInDetTrack pT)
float trkEtaAtCalo() const
accessor to get eta and phi of electron candidate track extrapolated the calorimeter

◆ operator<<()

MsgStream & operator<< ( MsgStream & msg,
const TrigElectron & te )

Definition at line 353 of file TrigElectron.cxx.

353 {
354 return ( msg << "TrigElectron " << (te.isValid() ? "(valid)" : "(not valid)")
355 << ": RoI = " << te.roiId() << "; Q = " << te.charge()
356 << "; Et/Pt = " << te.EtOverPt() << "; Pt = " << te.pt()
357 << "; TRT hits = " << te.nTRTHits() << "; TRT HiThreshold hits = " << te.nTRTHiThresholdHits()
358 << "; trkPt = " << te.trkPt() << " +- " << te.err_Pt()
359 << "; eta = " << te.eta() << " +- " << te.err_eta()
360 << "; phi = " << te.phi() << " +- " << te.err_phi()
361 << "; Zvt = " << te.Zvtx() << " +- " << te.err_Zvtx()
362 << "; DeltaEta1 = " << te.DeltaEta1() << "; DeltaPhi2 = " << te.DeltaPhi2()
363 // << "; E = "<<te.E()
364 <<"; F0 = "<<te.F0()<<"; F1 = "<<te.F1()<<"; F2 = "<<te.F2()<<"; F3 = "<<te.F3() );
365}
bool isValid() const
accessor to get TrigElectron valid flag
float EtOverPt() const
accessor to ratio of cluster Et to track Pt
float trkPt() const
accessor to get pT of electron candidate track
float err_Pt() const
accessors to get uncertainty in track parameters: Pt, eta, phi and Z of track perigee (Zvtx)
MsgStream & msg
Definition testRead.cxx:32

◆ operator==()

bool operator== ( const TrigElectron & te1,
const TrigElectron & te2 )

Two TrigElectron are the same if they have the same cluster and the same track (and if valid, i.e.

well built)

Definition at line 317 of file TrigElectron.cxx.

317 {
318 return ( te1.isValid() && te2.isValid()
319 && te1.cluster() == te2.cluster() && te1.track() == te2.track());
320}
const TrigInDetTrack * track() const
accessor to get pointer to track (TrigInDetTrack)
const TrigEMCluster * cluster() const
accessor to get pointer to cluster (TrigEMCluster)