ATLAS Offline Software
Functions
TrigL2Bphys.cxx File Reference
#include "TrigParticle/TrigL2Bphys.h"
#include "TrigParticle/TrigL2BphysContainer.h"
Include dependency graph for TrigL2Bphys.cxx:

Go to the source code of this file.

Functions

std::string str (const TrigL2Bphys &p)
 
MsgStream & operator<< (MsgStream &m, const TrigL2Bphys &p)
 
bool operator== (const TrigL2Bphys &a, const TrigL2Bphys &b)
 
void diff (const TrigL2Bphys &a, const TrigL2Bphys &b, std::map< std::string, double > &variableChange)
 comparison with feedback Function compares two objects and returns "semi verbose" output in the form of map where there are varaibel names and differences between two obejcts More...
 

Function Documentation

◆ diff()

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

comparison with feedback Function compares two objects and returns "semi verbose" output in the form of map where there are varaibel names and differences between two obejcts

Parameters
variableChange- map to record the differences In case of collections (or objects when the size may be different) that information can also be returned in variableChange

Definition at line 160 of file TrigL2Bphys.cxx.

161 {
162  variableChange["eta"] = a.eta() - b.eta();
163  variableChange["phi"] = a.phi() - b.phi();
164  variableChange["mass"] = a.mass() - b.mass();
165  variableChange["fitmass"] = a.fitmass() - b.fitmass();
166  variableChange["fitchi2"] = a.fitchi2() - b.fitchi2();
167  variableChange["x"] = a.fitx() - b.fitx();
168  variableChange["y"] = a.fity() - b.fity();
169  variableChange["z"] = a.fitz() - b.fitz();
170 }

◆ operator<<()

MsgStream& operator<< ( MsgStream &  m,
const TrigL2Bphys p 
)

Definition at line 121 of file TrigL2Bphys.cxx.

122 {
123  m << str(p);
124  return m;
125 }

◆ operator==()

bool operator== ( const TrigL2Bphys a,
const TrigL2Bphys b 
)

Definition at line 127 of file TrigL2Bphys.cxx.

128 {
129  const double epsilon = 1e-8;
130 
131  int aHasSD = (a.pSecondDecay()!=NULL)?1:0;
132  int bHasSD = (b.pSecondDecay()!=NULL)?1:0;
133  if((aHasSD+bHasSD)==1)
134  return false;
135 
136  if(a.trackVector().size()!=b.trackVector().size())
137  return false;
138 
139  if(a.roiId() != b.roiId()) return false;
140  if(a.particleType() != b.particleType()) return false;
141  if(a.fitndof() != b.fitndof()) return false;
142 
143  if(fabs(a.eta()-b.eta())>epsilon) return false;
144  if(fabs(a.phi()-b.phi())>epsilon) return false;
145  if(fabs(a.mass()-b.mass())>epsilon) return false;
146  if(fabs(a.fitmass()-b.fitmass())>epsilon) return false;
147  if(fabs(a.fitchi2()-b.fitchi2())>epsilon) return false;
148  if(fabs(a.fitx()-b.fitx())>epsilon) return false;
149  if(fabs(a.fity()-b.fity())>epsilon) return false;
150  if(fabs(a.fitz()-b.fitz())>epsilon) return false;
151 
152  if((aHasSD+bHasSD)==2)
153  {
154  if (!((*a.pSecondDecay())==(*b.pSecondDecay())))
155  return false;
156  }
157  return true;
158 }

◆ str()

std::string str ( const TrigL2Bphys p)

Definition at line 103 of file TrigL2Bphys.cxx.

104 {
105  std::stringstream ss;
106 
107  ss << "RoI_ID: "<<p.roiId()
108  << "Particle type: "<<p.particleType()
109  << "eta: "<<p.eta()
110  << "phi: "<<p.phi()
111  << "mass: "<<p.mass()
112  << "mass after fit: "<<p.fitmass()
113  << "fit chi2: "<<p.fitchi2()
114  << "fit ndof: "<<p.fitndof()
115  << "x: "<<p.fitx()
116  << "y: "<<p.fity()
117  << "z: "<<p.fitz();
118  return ss.str();
119 }
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
str
std::string str(const TrigL2Bphys &p)
Definition: TrigL2Bphys.cxx:103