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