ATLAS Offline Software
Functions
TrigPhoton.cxx File Reference
#include "CaloGeoHelpers/CaloSampling.h"
#include "TrigParticle/TrigPhoton.h"
Include dependency graph for TrigPhoton.cxx:

Go to the source code of this file.

Functions

bool operator== (const TrigPhoton &tp1, const TrigPhoton &tp2)
 Two TrigPhoton are the same if they have the same cluster (and if valid) More...
 
void diff (const TrigPhoton &tp1, const TrigPhoton &tp2, 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. More...
 
MsgStream & operator<< (MsgStream &msg, const TrigPhoton &tp)
 print TrigPhoton quantities More...
 

Function Documentation

◆ diff()

void diff ( const TrigPhoton tp1,
const TrigPhoton tp2,
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 260 of file TrigPhoton.cxx.

260  {
261 
262  v_diff["RoIword"] = tp1.roiId() - tp2.roiId();
263  v_diff["Et"] = 0;
264  if(fabs(tp1.Et())+fabs(tp2.Et()) !=0)
265  v_diff["Et"] = 2 * fabs( ( fabs(tp1.Et()) - fabs(tp2.Et() )) / ( fabs(tp1.Et())+fabs(tp2.Et()) ) );
266  v_diff["HadEt1"] = 0;
267  if(fabs(tp1.HadEt1())+fabs(tp2.HadEt1()) !=0)
268  v_diff["HadEt1"] = 2 * fabs( ( fabs(tp1.HadEt1()) - fabs(tp2.HadEt1() )) / ( fabs(tp1.HadEt1())+fabs(tp2.HadEt1()) ) );
269  v_diff["Eratio"] = fabs(tp1.Eratio() - tp2.Eratio());
270  v_diff["rCore"] = fabs(tp1.Reta() - tp2.Reta());
271  v_diff["Eta"] = fabs( tp1.eta() - tp2.eta() );
272  double d_phi = fabs( tp1.phi() - tp2.phi() );
273  v_diff["Phi"] = (d_phi < M_PI ? d_phi : 2*M_PI - d_phi);
274  // v_diff["E"] = fabs(tp1.E() - tp2.E());
275  v_diff["F0"] = fabs(tp1.F0() - tp2.F0());
276  v_diff["F1"] = fabs(tp1.F1() - tp2.F1());
277  v_diff["F2"] = fabs(tp1.F2() - tp2.F2());
278  v_diff["F3"] = fabs(tp1.F3() - tp2.F3());
279  return;
280 }

◆ operator<<()

MsgStream& operator<< ( MsgStream &  msg,
const TrigPhoton tp 
)

print TrigPhoton quantities

overloaded << opetrator to print TrigPhoton quantities

Definition at line 284 of file TrigPhoton.cxx.

284  {
285  return ( msg << "TrigPhoton " << (tp.isValid() ? "(valid)" : "(not valid)")
286  << ": RoI = " << tp.roiWord()
287  << "; Et = " << tp.Et()
288  << "; eta = " << tp.eta()
289  << "; phi = " << tp.phi()
290  << "; Delta_eta = " << tp.dEta() << "; Delta_phi = " << tp.dPhi()
291  << "; Eratio = " << tp.Eratio() << "; Rcore = " << tp.Reta()
292  // << "; E = "<<tp.E()
293  <<"; F0 = "<<tp.F0()<<"; F1 = "<<tp.F1()<<"; F2 = "<<tp.F2()<<"; F3 = "<<tp.F3() );
294 }

◆ operator==()

bool operator== ( const TrigPhoton tp1,
const TrigPhoton tp2 
)

Two TrigPhoton are the same if they have the same cluster (and if valid)

comparison operators

Definition at line 250 of file TrigPhoton.cxx.

250  {
251  return ( tp1.isValid() && tp2.isValid() && tp1.cluster() == tp2.cluster());
252 }
TrigPhoton::Et
float Et() const
accessor EM cluster et
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigPhoton.h:100
TrigPhoton::F0
float F0() const
accessors for calibrated energy and energy fraction in calo samples
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigPhoton.h:129
TrigPhoton::roiId
int roiId() const
accessor to get RoI ID (should also introduce roiWord
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigPhoton.h:96
M_PI
#define M_PI
Definition: ActiveFraction.h:11
ParticleTest.tp
tp
Definition: ParticleTest.py:25
P4PtEtaPhiM::phi
virtual double phi() const
get phi data member
Definition: P4PtEtaPhiM.h:109
TrigPhoton::F1
float F1() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigPhoton.h:130
TrigPhoton::Eratio
float Eratio() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigPhoton.h:108
TrigPhoton::F2
float F2() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigPhoton.h:131
TrigPhoton::F3
float F3() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigPhoton.h:132
TrigPhoton::HadEt1
float HadEt1() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigPhoton.h:104
P4PtEtaPhiM::eta
virtual double eta() const
get eta data member
Definition: P4PtEtaPhiM.h:106
TrigPhoton::cluster
const TrigEMCluster * cluster() const
other accessors for shower shapes
Definition: TrigPhoton.cxx:237
TrigPhoton::isValid
bool isValid() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigPhoton.h:93
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TrigPhoton::Reta
float Reta() const
Definition: Trigger/TrigEvent/TrigParticle/TrigParticle/TrigPhoton.h:112