ATLAS Offline Software
Loading...
Searching...
No Matches
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
39TrigL2Bjet::TrigL2Bjet(int roi, float eta, float phi, const TrigInDetTrackCollection* track,
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
63void TrigL2Bjet::validate(bool v) { m_valid = v; }
64
65bool TrigL2Bjet::isValid() const { return m_valid; }
66
67int TrigL2Bjet::roiId() const { return m_roiID; }
68
69float TrigL2Bjet::prmVtx() const { return m_prmVtx; }
70
74
75float TrigL2Bjet::xComb() const { return m_xcomb; }
76float TrigL2Bjet::xIP1D() const { return m_xIP1d; }
77float TrigL2Bjet::xIP2D() const { return m_xIP2d; }
78float TrigL2Bjet::xIP3D() const { return m_xIP3d; }
79float TrigL2Bjet::xCHI2() const { return m_xChi2; }
80float TrigL2Bjet::xSV() const { return m_xSv; }
81float TrigL2Bjet::xMVtx() const { return m_xmvtx; }
82float TrigL2Bjet::xEVtx() const { return m_xevtx; }
83float TrigL2Bjet::xNVtx() const { return m_xnvtx; }
84
85
86//** ----------------------------------------------------------------------------------------------------------------- **//
87
88
89//helper operators
90
91std::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
111MsgStream& operator<< (MsgStream& m, const TrigL2Bjet& a) {
112
113 return (m << str(a));
114}
115
116
117bool 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
141void 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}
static const double DELTA
static Double_t a
static Double_t ss
MsgStream & operator<<(MsgStream &m, const TrigL2Bjet &a)
bool operator==(const TrigL2Bjet &a, const TrigL2Bjet &b)
void diff(const TrigL2Bjet &a, const TrigL2Bjet &b, std::map< std::string, double > &variableChange)
P4PtEtaPhiM(const double pt, const double eta, const double phi, const double m)
constructor with all data members
Definition P4PtEtaPhiM.h:29
virtual double eta() const
get eta data member
virtual double phi() const
get phi data member
Class representing a b-jet candidate created at L2.
Definition TrigL2Bjet.h:38
float m_xChi2
Probability weight based on chi2 of track fit.
Definition TrigL2Bjet.h:118
const TrigInDetTrackCollection * m_track
Pointer to the track collection.
Definition TrigL2Bjet.h:100
bool isValid() const
To know if TrigL2Bjet object is valid.
TrigL2Bjet()
Constructor.
float m_xSv
Likelihood weight based on secondary vertex.
Definition TrigL2Bjet.h:120
float xEVtx() const
To retrieve likelihood weight based on energy of secondary vertex.
const TrigVertexCollection * SecVertexCollection() const
To retrieve pointer to secondary vertex collection of type TrigVertex.
float xComb() const
To retrieve best likelihood weight (combination of IP3D and SV).
float xIP1D() const
To retrieve likelihood weight based on longitudinal impact parameter.
float m_xmvtx
Likelihood weight based on mass of secondary vertex.
Definition TrigL2Bjet.h:122
float xNVtx() const
To retrieve likelihood weight based on number of tracks linked to secondary vertex.
float m_xcomb
Best likelihood weight (combination of IP3D and SV).
Definition TrigL2Bjet.h:110
float xSV() const
To retrieve likelihood weight based on secondary vertex.
float m_xIP3d
Likelihood weight based on 2D combination of impact parameters.
Definition TrigL2Bjet.h:116
float m_xIP2d
Likelihood weight based on transverse impact parameter.
Definition TrigL2Bjet.h:114
const TrigVertexCollection * m_secvertex
Pointer to the secondary vertex collection.
Definition TrigL2Bjet.h:104
float m_prmVtx
Z coordinate of the primary vertex.
Definition TrigL2Bjet.h:107
float m_xevtx
Likelihood weight based on energy of secondary vertex.
Definition TrigL2Bjet.h:124
float xIP2D() const
To retrieve likelihood weight based on transverse impact parameter.
bool m_valid
Boolean variable to declare the object as a valid one.
Definition TrigL2Bjet.h:94
void validate(bool v)
To validate TrigL2Bjet object.
float xMVtx() const
To retrieve likelihood weight based on mass of secondary vertex.
float xCHI2() const
To retrieve probability weight based on chi2 of track fit.
float prmVtx() const
To retrieve reconstructed z of primary vertex.
int m_roiID
Identifier of the RoI (unique to each LVL1 RoI).
Definition TrigL2Bjet.h:97
const TrigVertexCollection * PrmVertexCollection() const
To retrieve pointer to primary vertex collection of type TrigVertex.
float m_xnvtx
Likelihood weight based on number of tracks linked to secondary vertex.
Definition TrigL2Bjet.h:126
int roiId() const
To retrieve identifier of the RoI (unique to each LVL1 RoI).
float m_xIP1d
Likelihood weight based on longitudinal impact parameter.
Definition TrigL2Bjet.h:112
float xIP3D() const
To retrieve likelihood weight based on 2D combination of impact parameters.
const TrigVertexCollection * m_prmvertex
Pointer to the primary vertex collection.
Definition TrigL2Bjet.h:102
const TrigInDetTrackCollection * TrackCollection() const
To retrieve pointer to track collection of type TrigInDetTrack.