ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigEvent
TrigParticle
src
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
23
24
#include "
TrigParticle/TrigEFBphys.h
"
25
#include "
TrigParticle/TrigEFBphysContainer.h
"
26
27
// default constructor
28
TrigEFBphys::TrigEFBphys
() :
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
37
TrigEFBphys::TrigEFBphys
(
int
roi,
float
eta
,
float
phi
,
pType
particleType
,
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
46
TrigEFBphys::TrigEFBphys
(
int
roi,
float
eta
,
float
phi
,
pType
particleType
,
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
56
void
TrigEFBphys::addTrack
(
const
ElementLink<Rec::TrackParticleContainer>
& track)
57
{
58
m_trackVector
.push_back( track);
59
}
60
61
void
TrigEFBphys::pSecondDecay
(
ElementLink<TrigEFBphysContainer>
p_secondaryDecay)
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
166
const
TrigEFBphys
*
TrigEFBphys::pSecondDecay
()
const
{
167
if
(
m_secondaryDecay
.isValid()) {
168
return
*
m_secondaryDecay
;
169
}
else
{
170
return
NULL;
171
}
172
}
173
174
175
const
ElementLink< TrigEFBphysContainer>
&
TrigEFBphys::secondaryDecayLink
()
const
176
{
177
return
m_secondaryDecay
;
178
}
179
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
TrigEFBphysContainer.h
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
operator<<
MsgStream & operator<<(MsgStream &m, const TrigEFBphys &p)
Definition
TrigEFBphys.cxx:95
operator==
bool operator==(const TrigEFBphys &a, const TrigEFBphys &b)
Definition
TrigEFBphys.cxx:119
TrigEFBphys.h
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
TrigEFBphys
Definition
TrigEFBphys.h:42
TrigEFBphys::phi
float phi() const
accessor method: phi
Definition
TrigEFBphys.h:69
TrigEFBphys::m_mass
float m_mass
Definition
TrigEFBphys.h:116
TrigEFBphys::m_roiID
int m_roiID
Definition
TrigEFBphys.h:112
TrigEFBphys::fitchi2
float fitchi2() const
accessor method: chi2 from vertex fit
Definition
TrigEFBphys.h:75
TrigEFBphys::secondaryDecayLink
const ElementLink< TrigEFBphysContainer > & secondaryDecayLink() const
Definition
TrigEFBphys.cxx:175
TrigEFBphys::m_phi
float m_phi
Definition
TrigEFBphys.h:115
TrigEFBphys::m_eta
float m_eta
Definition
TrigEFBphys.h:114
TrigEFBphys::TrigEFBphys
TrigEFBphys()
constructors; note: default constructor needed by POOL
Definition
TrigEFBphys.cxx:28
TrigEFBphys::addTrack
void addTrack(const ElementLink< Rec::TrackParticleContainer > &track)
set method: add track to particle
Definition
TrigEFBphys.cxx:56
TrigEFBphys::fitmass
float fitmass() const
accessor method: mass from vertex fit
Definition
TrigEFBphys.h:73
TrigEFBphys::m_fitmass
float m_fitmass
Definition
TrigEFBphys.h:117
TrigEFBphys::m_fitchi2
float m_fitchi2
Definition
TrigEFBphys.h:118
TrigEFBphys::m_fitndof
int m_fitndof
Definition
TrigEFBphys.h:119
TrigEFBphys::m_trackVector
ElementLinkVector< Rec::TrackParticleContainer > m_trackVector
Definition
TrigEFBphys.h:124
TrigEFBphys::pType
pType
enum for different particle types
Definition
TrigEFBphys.h:47
TrigEFBphys::PHIKK
@ PHIKK
Definition
TrigEFBphys.h:47
TrigEFBphys::fity
float fity() const
accessor method: y position of vertex
Definition
TrigEFBphys.h:81
TrigEFBphys::fitx
float fitx() const
accessor method: x position of vertex
Definition
TrigEFBphys.h:79
TrigEFBphys::particleType
pType particleType() const
accessor method: particle Type
Definition
TrigEFBphys.h:65
TrigEFBphys::m_fitz
float m_fitz
Definition
TrigEFBphys.h:122
TrigEFBphys::m_fitx
float m_fitx
Definition
TrigEFBphys.h:120
TrigEFBphys::m_fity
float m_fity
Definition
TrigEFBphys.h:121
TrigEFBphys::m_particleType
pType m_particleType
Definition
TrigEFBphys.h:113
TrigEFBphys::m_secondaryDecay
ElementLink< TrigEFBphysContainer > m_secondaryDecay
Definition
TrigEFBphys.h:123
TrigEFBphys::mass
float mass() const
accessor method: mass
Definition
TrigEFBphys.h:71
TrigEFBphys::fitz
float fitz() const
accessor method: z position of vertex
Definition
TrigEFBphys.h:83
TrigEFBphys::eta
float eta() const
accessor method: eta
Definition
TrigEFBphys.h:67
TrigEFBphys::pSecondDecay
const TrigEFBphys * pSecondDecay() const
accessor method: secondary decay particle
Definition
TrigEFBphys.cxx:166
TrigEFBphys::fitndof
int fitndof() const
accessor method: ndof from vertex fit
Definition
TrigEFBphys.h:77
str
Definition
BTagTrackIpAccessor.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0