ATLAS Offline Software
TrigEFBphys.cxx
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
26 
27 // default constructor
29  m_roiID(-1), m_particleType(PHIKK), m_eta(0), m_phi(0) ,
30  m_mass(0), m_fitmass(-99.), m_fitchi2(-99.), m_fitndof(-99),
31  m_fitx(-99.), m_fity(-99.), m_fitz(-99),
32  m_secondaryDecay(), m_trackVector(0)
33 {}
34 
35 // constructors
36 
38  float mass):
39  m_roiID(roi),
40  m_particleType(particleType),
41  m_eta(eta), m_phi(phi), m_mass(mass),
42  m_fitmass(-99.), m_fitchi2(-99.), m_fitndof(-99),m_fitx(-99.), m_fity(-99.), m_fitz(-99.),
43  m_secondaryDecay(), m_trackVector(0)
44 {}
45 
47  float mass, const ElementLink<TrigEFBphysContainer>& sDecay):
48  m_roiID(roi),
49  m_particleType(particleType),
50  m_eta(eta), m_phi(phi), m_mass(mass),
51  m_fitmass(-99.), m_fitchi2(-99.), m_fitndof(-99),m_fitx(-99.), m_fity(-99.), m_fitz(-99.),
52  m_secondaryDecay(sDecay), m_trackVector(0)
53 {}
54 
55 
57 {
59 }
60 
62 {
63  m_secondaryDecay=p_secondaryDecay;
64 }
65 
66 
67 void TrigEFBphys::fitmass(float FitMass)
68 {
69  m_fitmass = FitMass;
70 }
71 
72 void TrigEFBphys::fitchi2(float FitChi2)
73 {
74  m_fitchi2 = FitChi2;
75 }
76 
77 void TrigEFBphys::fitndof(int FitNdof)
78 {
79  m_fitndof = FitNdof;
80 }
81 
82 void TrigEFBphys::fitx(float FitX)
83 {
84  m_fitx = FitX;
85 }
86 void TrigEFBphys::fity(float FitY)
87 {
88  m_fity = FitY;
89 }
90 void TrigEFBphys::fitz(float FitZ)
91 {
92  m_fitz = FitZ;
93 }
94 
95 MsgStream& operator<< ( MsgStream& m, const TrigEFBphys& p )
96 {
97  m << str(p);
98  return m;
99 }
100 
101 std::string str( const TrigEFBphys& p )
102 {
103  std::stringstream ss;
104 
105  ss << "RoI_ID: "<<p.roiId()
106  << "Particle type: "<<p.particleType()
107  << "eta: "<<p.eta()
108  << "phi: "<<p.phi()
109  << "mass: "<<p.mass()
110  << "mass after fit: "<<p.fitmass()
111  << "fit chi2: "<<p.fitchi2()
112  << "fit ndof: "<<p.fitndof()
113  << "x: "<<p.fitx()
114  << "y: "<<p.fity()
115  << "z: "<<p.fitz();
116  return ss.str();
117 }
118 
119 bool operator== ( const TrigEFBphys& a, const TrigEFBphys& b )
120 {
121  const double epsilon = 1e-8;
122 
123  int aHasSD = (a.pSecondDecay()!=NULL)?1:0;
124  int bHasSD = (b.pSecondDecay()!=NULL)?1:0;
125  if((aHasSD+bHasSD)==1)
126  return false;
127 
128  if(a.trackVector().size()!=b.trackVector().size())
129  return false;
130 
131  if(a.roiId() != b.roiId()) return false;
132  if(a.particleType() != b.particleType()) return false;
133  if(a.fitndof() != b.fitndof()) return false;
134 
135  if(fabs(a.eta()-b.eta())>epsilon) return false;
136  if(fabs(a.phi()-b.phi())>epsilon) return false;
137  if(fabs(a.mass()-b.mass())>epsilon) return false;
138  if(fabs(a.fitmass()-b.fitmass())>epsilon) return false;
139  if(fabs(a.fitchi2()-b.fitchi2())>epsilon) return false;
140  if(fabs(a.fitx()-b.fitx())>epsilon) return false;
141  if(fabs(a.fity()-b.fity())>epsilon) return false;
142  if(fabs(a.fitz()-b.fitz())>epsilon) return false;
143 
144  if((aHasSD+bHasSD)==2)
145  {
146  if (!((*a.pSecondDecay())==(*b.pSecondDecay())))
147  return false;
148  }
149  return true;
150 }
151 
152 void diff( const TrigEFBphys& a, const TrigEFBphys& b, std::map<std::string, double>& variableChange )
153 {
154  variableChange["eta"] = a.eta() - b.eta();
155  variableChange["phi"] = a.phi() - b.phi();
156  variableChange["mass"] = a.mass() - b.mass();
157  variableChange["fitmass"] = a.fitmass() - b.fitmass();
158  variableChange["fitchi2"] = a.fitchi2() - b.fitchi2();
159  variableChange["x"] = a.fitx() - b.fitx();
160  variableChange["y"] = a.fity() - b.fity();
161  variableChange["z"] = a.fitz() - b.fitz();
162 }
163 
164 
167  if (m_secondaryDecay.isValid()) {
168  return *m_secondaryDecay;
169  } else {
170  return NULL;
171  }
172 }
173 
174 
176 {
177  return m_secondaryDecay;
178 }
179 
TrigEFBphys::fity
float fity() const
accessor method: y position of vertex
Definition: TrigEFBphys.h:81
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TrigEFBphys::m_fitz
float m_fitz
Definition: TrigEFBphys.h:122
TrigEFBphys::fitmass
float fitmass() const
accessor method: mass from vertex fit
Definition: TrigEFBphys.h:73
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrigEFBphys
Definition: TrigEFBphys.h:42
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
diff
void diff(const TrigEFBphys &a, const TrigEFBphys &b, std::map< std::string, double > &variableChange)
comparison with feedback Function compares two objects and returns "semi verbose" output in the form ...
Definition: TrigEFBphys.cxx:152
TrigEFBphys::TrigEFBphys
TrigEFBphys()
constructors; note: default constructor needed by POOL
Definition: TrigEFBphys.cxx:28
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TrigEFBphys::fitz
float fitz() const
accessor method: z position of vertex
Definition: TrigEFBphys.h:83
TrigEFBphys::pSecondDecay
const TrigEFBphys * pSecondDecay() const
accessor method: secondary decay particle
Definition: TrigEFBphys.cxx:166
TrigEFBphys::fitchi2
float fitchi2() const
accessor method: chi2 from vertex fit
Definition: TrigEFBphys.h:75
particleType
Definition: particleType.h:29
TrigEFBphys::m_fity
float m_fity
Definition: TrigEFBphys.h:121
ElementLinkVector::push_back
void push_back(const ElemLink &link)
Definition: AthLinks/ElementLinkVector.h:316
TrigEFBphysContainer.h
operator<<
MsgStream & operator<<(MsgStream &m, const TrigEFBphys &p)
Definition: TrigEFBphys.cxx:95
TrigEFBphys::addTrack
void addTrack(const ElementLink< Rec::TrackParticleContainer > &track)
set method: add track to particle
Definition: TrigEFBphys.cxx:56
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TrigEFBphys::secondaryDecayLink
const ElementLink< TrigEFBphysContainer > & secondaryDecayLink() const
Definition: TrigEFBphys.cxx:175
operator==
bool operator==(const TrigEFBphys &a, const TrigEFBphys &b)
Definition: TrigEFBphys.cxx:119
str
std::string str(const TrigEFBphys &p)
Definition: TrigEFBphys.cxx:101
TrigEFBphys::fitndof
int fitndof() const
accessor method: ndof from vertex fit
Definition: TrigEFBphys.h:77
TrigEFBphys::m_fitndof
int m_fitndof
Definition: TrigEFBphys.h:119
TrigEFBphys::pType
pType
enum for different particle types
Definition: TrigEFBphys.h:47
TrigEFBphys.h
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrigEFBphys::m_fitmass
float m_fitmass
Definition: TrigEFBphys.h:117
TrigEFBphys::m_fitx
float m_fitx
Definition: TrigEFBphys.h:120
a
TList * a
Definition: liststreamerinfos.cxx:10
TrigEFBphys::m_trackVector
ElementLinkVector< Rec::TrackParticleContainer > m_trackVector
Definition: TrigEFBphys.h:124
TrigEFBphys::m_secondaryDecay
ElementLink< TrigEFBphysContainer > m_secondaryDecay
Definition: TrigEFBphys.h:123
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
TrigEFBphys::m_fitchi2
float m_fitchi2
Definition: TrigEFBphys.h:118
TrigEFBphys::fitx
float fitx() const
accessor method: x position of vertex
Definition: TrigEFBphys.h:79