ATLAS Offline Software
TrigEFBjet.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ************************************************
6 //
7 // NAME: TrigEFBjet.cxx
8 // PACKAGE: Trigger/TrigEvent/TrigParticle
9 //
10 // AUTHOR: Andrea Coccaro
11 // EMAIL: Andrea.Coccaro@ge.infn.it
12 //
13 // ************************************************
14 
16 
17 
19  P4PtEtaPhiM(0,0,0,1.*CLHEP::MeV),
21  m_valid(false),
22  m_roiID(-1),
23  m_track(0),
24  m_prmvertex(0),
25  m_secvertex(0),
26  m_prmVtx(-1.),
27  m_xcomb(-1.),
28  m_xIP1d(-1.),
29  m_xIP2d(-1.),
30  m_xIP3d(-1.),
31  m_xChi2(-1.),
32  m_xSv(-1.),
33  m_xmvtx(-1.),
34  m_xevtx(-1.),
35  m_xnvtx(-1.)
36 {}
37 
38 
40  const VxContainer* prmvertex, const VxContainer* secvertex, float prmvtx,
41  float ptJet, float xcomb, float xIP1d, float xIP2d, float xIP3d, float xChi2,
42  float xSv, float xmvtx, float xevtx, float xnvtx) :
44  m_valid(false),
45  m_roiID(roi),
46  m_track(track),
47  m_prmvertex(prmvertex),
48  m_secvertex(secvertex),
49  m_prmVtx(prmvtx),
50  m_xcomb(xcomb),
51  m_xIP1d(xIP1d),
52  m_xIP2d(xIP2d),
53  m_xIP3d(xIP3d),
54  m_xChi2(xChi2),
55  m_xSv(xSv),
56  m_xmvtx(xmvtx),
57  m_xevtx(xevtx),
58  m_xnvtx(xnvtx)
59 {}
60 
61 
62 void TrigEFBjet::validate(bool v) { m_valid = v; }
63 
64 bool TrigEFBjet::isValid() const { return m_valid; }
65 
66 int TrigEFBjet::roiId() const { return m_roiID; }
67 
68 float TrigEFBjet::prmVtx() const { return m_prmVtx; }
69 
73 
74 float TrigEFBjet::xComb() const { return m_xcomb; }
75 float TrigEFBjet::xIP1D() const { return m_xIP1d; }
76 float TrigEFBjet::xIP2D() const { return m_xIP2d; }
77 float TrigEFBjet::xIP3D() const { return m_xIP3d; }
78 float TrigEFBjet::xCHI2() const { return m_xChi2; }
79 float TrigEFBjet::xSV() const { return m_xSv; }
80 float TrigEFBjet::xMVtx() const { return m_xmvtx; }
81 float TrigEFBjet::xEVtx() const { return m_xevtx; }
82 float TrigEFBjet::xNVtx() const { return m_xnvtx; }
83 
84 
85 //** ----------------------------------------------------------------------------------------------------------------- **//
86 
87 
88 //helper operators
89 
90 std::string str (const TrigEFBjet& a) {
91 
92  std::stringstream ss;
93 
94  ss << "RoI index = " << a.roiId()
95  << "; prmVtx = " << a.prmVtx()
96  << "; xComb = " << a.xComb()
97  << "; xIP1D = " << a.xIP1D()
98  << "; xIP2D = " << a.xIP2D()
99  << "; xIP3D = " << a.xIP3D()
100  << "; xCHI2 = " << a.xCHI2()
101  << "; xSV = " << a.xSV()
102  << "; xMVtx = " << a.xMVtx()
103  << "; xEVtx = " << a.xEVtx()
104  << "; xNVtx = " << a.xNVtx();
105 
106  return ss.str();
107 }
108 
109 
110 MsgStream& operator<< (MsgStream& m, const TrigEFBjet& a) {
111 
112  return (m << str(a));
113 }
114 
115 
116 bool operator== (const TrigEFBjet& a, const TrigEFBjet& b) {
117 
118  //* distance used to compare floats *//
119  const double DELTA=1e-3;
120 
121  if(std::abs(a.eta() - b.eta()) > DELTA) return false;
122  if(std::abs(a.phi() - b.phi()) > DELTA) return false;
123 
124  if(std::abs(a.prmVtx() - b.prmVtx()) > DELTA) return false;
125 
126  if(std::abs(a.xComb() - b.xComb()) > DELTA) return false;
127  if(std::abs(a.xIP1D() - b.xIP1D()) > DELTA) return false;
128  if(std::abs(a.xIP2D() - b.xIP2D()) > DELTA) return false;
129  if(std::abs(a.xIP3D() - b.xIP3D()) > DELTA) return false;
130  if(std::abs(a.xCHI2() - b.xCHI2()) > DELTA) return false;
131  if(std::abs(a.xSV() - b.xSV()) > DELTA) return false;
132  if(std::abs(a.xMVtx() - b.xMVtx()) > DELTA) return false;
133  if(std::abs(a.xEVtx() - b.xEVtx()) > DELTA) return false;
134  if(std::abs(a.xNVtx() - b.xNVtx()) > DELTA) return false;
135 
136  return true;
137 }
138 
139 
140 void diff(const TrigEFBjet& a, const TrigEFBjet& b, std::map<std::string, double>& variableChange) {
141 
142  if(a.prmVtx() != b.prmVtx()) variableChange[ "prmVtx" ] = static_cast< double >( a.prmVtx() - b.prmVtx() );
143 
144  if(a.xComb() != b.xComb()) variableChange["xComb"] = static_cast<double>(a.xComb() - b.xComb());
145  if(a.xIP1D() != b.xIP1D()) variableChange["xIP1D"] = static_cast<double>(a.xIP1D() - b.xIP1D());
146  if(a.xIP2D() != b.xIP2D()) variableChange["xIP2D"] = static_cast<double>(a.xIP2D() - b.xIP2D());
147  if(a.xIP3D() != b.xIP3D()) variableChange["xIP3D"] = static_cast<double>(a.xIP3D() - b.xIP3D());
148  if(a.xCHI2() != b.xCHI2()) variableChange["xCHI2"] = static_cast<double>(a.xCHI2() - b.xCHI2());
149  if(a.xSV() != b.xSV()) variableChange["xSV"] = static_cast<double>(a.xSV() - b.xSV());
150  if(a.xMVtx() != b.xMVtx()) variableChange["xMVtx"] = static_cast<double>(a.xMVtx() - b.xMVtx());
151  if(a.xEVtx() != b.xEVtx()) variableChange["xEVtx"] = static_cast<double>(a.xEVtx() - b.xEVtx());
152  if(a.xNVtx() != b.xNVtx()) variableChange["xNVtx"] = static_cast<double>(a.xNVtx() - b.xNVtx());
153 
154  return;
155 }
TrigEFBjet::m_xIP1d
float m_xIP1d
Likelihood weight based on transverse impact parameter.
Definition: TrigEFBjet.h:112
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TrigEFBjet::m_xIP2d
float m_xIP2d
Likelihood weight based on longitudinal impact parameter.
Definition: TrigEFBjet.h:114
TrigEFBjet::xEVtx
float xEVtx() const
To retrieve likelihood weight based on energy of secondary vertex.
Definition: TrigEFBjet.cxx:81
TrigEFBjet::m_valid
bool m_valid
Boolean variable to declare the object as a valid one.
Definition: TrigEFBjet.h:94
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TrigEFBjet::m_xIP3d
float m_xIP3d
Likelihood weight based on 2D combination of impact parameters.
Definition: TrigEFBjet.h:116
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
NavigableTerminalNode
Dummy type needed fro specialized implementation.
Definition: NavigableTerminalNode.h:19
TrigEFBjet::xNVtx
float xNVtx() const
To retrieve likelihood weight based on number of tracks linked to secondary vertex.
Definition: TrigEFBjet.cxx:82
TrigEFBjet.h
TrigEFBjet::xCHI2
float xCHI2() const
To retrieve probability weight based on chi2 of track fit.
Definition: TrigEFBjet.cxx:78
diff
void diff(const TrigEFBjet &a, const TrigEFBjet &b, std::map< std::string, double > &variableChange)
Definition: TrigEFBjet.cxx:140
TrigEFBjet::isValid
bool isValid() const
To know if TrigEFBjet object is valid.
Definition: TrigEFBjet.cxx:64
TrigEFBjet::m_xcomb
float m_xcomb
Best likelihood weight (combination of IP3D and SV) - not filled yet.
Definition: TrigEFBjet.h:110
TrigEFBjet
Class representing a b-jet candidate created at EF.
Definition: TrigEFBjet.h:38
TrigEFBjet::roiId
int roiId() const
To retrieve identifier of the RoI (unique to each LVL1 RoI).
Definition: TrigEFBjet.cxx:66
operator<<
MsgStream & operator<<(MsgStream &m, const TrigEFBjet &a)
Definition: TrigEFBjet.cxx:110
TrigEFBjet::prmVtx
float prmVtx() const
To retrieve reconstructed z of primary vertex.
Definition: TrigEFBjet.cxx:68
TrigEFBjet::m_xmvtx
float m_xmvtx
Likelihood weight based on mass of secondary vertex - not filled yet.
Definition: TrigEFBjet.h:122
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
TrigEFBjet::m_xevtx
float m_xevtx
Likelihood weight based on energy of secondary vertex - not filled yet.
Definition: TrigEFBjet.h:124
VxContainer
Definition: VxContainer.h:28
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
TrigEFBjet::m_xnvtx
float m_xnvtx
Likelihood weight based on number of tracks linked to secondary vertex - not filled yet.
Definition: TrigEFBjet.h:126
TrigEFBjet::validate
void validate(bool v)
To validate TrigEFBjet object.
Definition: TrigEFBjet.cxx:62
TrigEFBjet::xSV
float xSV() const
To retrieve likelihood weight based on secondary vertex.
Definition: TrigEFBjet.cxx:79
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrigEFBjet::m_secvertex
const VxContainer * m_secvertex
Pointer to the secondary vertex collection.
Definition: TrigEFBjet.h:104
TrigEFBjet::xComb
float xComb() const
To retrieve best likelihood weight (combination of IP3D and SV).
Definition: TrigEFBjet.cxx:74
Rec::TrackParticleContainer
Definition: Reconstruction/Particle/Particle/TrackParticleContainer.h:33
str
std::string str(const TrigEFBjet &a)
Definition: TrigEFBjet.cxx:90
TrigEFBjet::xIP1D
float xIP1D() const
To retrieve likelihood weight based on longitudinal impact parameter.
Definition: TrigEFBjet.cxx:75
TrigEFBjet::SecVertexCollection
const VxContainer * SecVertexCollection() const
To retrieve pointer to secondary vertex collection of type VxVertex.
Definition: TrigEFBjet.cxx:72
python.PyAthena.v
v
Definition: PyAthena.py:154
TrigEFBjet::TrackCollection
const Rec::TrackParticleContainer * TrackCollection() const
To retrieve pointer to track collection of type TrackParticle.
Definition: TrigEFBjet.cxx:70
a
TList * a
Definition: liststreamerinfos.cxx:10
TrigEFBjet::xIP3D
float xIP3D() const
To retrieve likelihood weight based on 2D combination of impact parameters.
Definition: TrigEFBjet.cxx:77
operator==
bool operator==(const TrigEFBjet &a, const TrigEFBjet &b)
Definition: TrigEFBjet.cxx:116
TrigEFBjet::TrigEFBjet
TrigEFBjet()
Constructor.
Definition: TrigEFBjet.cxx:18
TrigEFBjet::m_xSv
float m_xSv
Likelihood weight based on secondary vertex - not filled yet.
Definition: TrigEFBjet.h:120
TrigEFBjet::PrmVertexCollection
const VxContainer * PrmVertexCollection() const
To retrieve pointer to primary vertex collection of type VxVertex.
Definition: TrigEFBjet.cxx:71
TrigEFBjet::m_track
const Rec::TrackParticleContainer * m_track
Pointer to the track collection.
Definition: TrigEFBjet.h:100
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
P4PtEtaPhiM
Definition: P4PtEtaPhiM.h:25
TrigEFBjet::m_xChi2
float m_xChi2
Probability weight based on chi2 of track fit.
Definition: TrigEFBjet.h:118
TrigEFBjet::m_prmvertex
const VxContainer * m_prmvertex
Pointer to the primary vertex collection.
Definition: TrigEFBjet.h:102
TrigEFBjet::m_roiID
int m_roiID
Identifier of the RoI.
Definition: TrigEFBjet.h:97
TrigEFBjet::m_prmVtx
float m_prmVtx
Z coordinate of the primary vertex.
Definition: TrigEFBjet.h:107
TrigEFBjet::xMVtx
float xMVtx() const
To retrieve likelihood weight based on mass of secondary vertex.
Definition: TrigEFBjet.cxx:80
TrigEFBjet::xIP2D
float xIP2D() const
To retrieve likelihood weight based on transverse impact parameter.
Definition: TrigEFBjet.cxx:76