ATLAS Offline Software
Loading...
Searching...
No Matches
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
39TrigEFBjet::TrigEFBjet(int roi, float eta, float phi, const Rec::TrackParticleContainer* track,
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) :
43 P4PtEtaPhiM((double)ptJet,(double)eta,(double)phi, 1.*CLHEP::MeV), NavigableTerminalNode(),
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
62void TrigEFBjet::validate(bool v) { m_valid = v; }
63
64bool TrigEFBjet::isValid() const { return m_valid; }
65
66int TrigEFBjet::roiId() const { return m_roiID; }
67
68float TrigEFBjet::prmVtx() const { return m_prmVtx; }
69
73
74float TrigEFBjet::xComb() const { return m_xcomb; }
75float TrigEFBjet::xIP1D() const { return m_xIP1d; }
76float TrigEFBjet::xIP2D() const { return m_xIP2d; }
77float TrigEFBjet::xIP3D() const { return m_xIP3d; }
78float TrigEFBjet::xCHI2() const { return m_xChi2; }
79float TrigEFBjet::xSV() const { return m_xSv; }
80float TrigEFBjet::xMVtx() const { return m_xmvtx; }
81float TrigEFBjet::xEVtx() const { return m_xevtx; }
82float TrigEFBjet::xNVtx() const { return m_xnvtx; }
83
84
85//** ----------------------------------------------------------------------------------------------------------------- **//
86
87
88//helper operators
89
90std::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
110MsgStream& operator<< (MsgStream& m, const TrigEFBjet& a) {
111
112 return (m << str(a));
113}
114
115
116bool 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
140void 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}
static const double DELTA
static Double_t a
static Double_t ss
MsgStream & operator<<(MsgStream &m, const TrigEFBjet &a)
bool operator==(const TrigEFBjet &a, const TrigEFBjet &b)
void diff(const TrigEFBjet &a, const TrigEFBjet &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 EF.
Definition TrigEFBjet.h:38
int roiId() const
To retrieve identifier of the RoI (unique to each LVL1 RoI).
int m_roiID
Identifier of the RoI.
Definition TrigEFBjet.h:97
float m_xSv
Likelihood weight based on secondary vertex - not filled yet.
Definition TrigEFBjet.h:120
const VxContainer * SecVertexCollection() const
To retrieve pointer to secondary vertex collection of type VxVertex.
float xIP3D() const
To retrieve likelihood weight based on 2D combination of impact parameters.
float m_xIP3d
Likelihood weight based on 2D combination of impact parameters.
Definition TrigEFBjet.h:116
float m_xIP2d
Likelihood weight based on longitudinal impact parameter.
Definition TrigEFBjet.h:114
const Rec::TrackParticleContainer * m_track
Pointer to the track collection.
Definition TrigEFBjet.h:100
const VxContainer * PrmVertexCollection() const
To retrieve pointer to primary vertex collection of type VxVertex.
float xSV() const
To retrieve likelihood weight based on secondary vertex.
const Rec::TrackParticleContainer * TrackCollection() const
To retrieve pointer to track collection of type TrackParticle.
void validate(bool v)
To validate TrigEFBjet object.
const VxContainer * m_secvertex
Pointer to the secondary vertex collection.
Definition TrigEFBjet.h:104
bool m_valid
Boolean variable to declare the object as a valid one.
Definition TrigEFBjet.h:94
float m_xevtx
Likelihood weight based on energy of secondary vertex - not filled yet.
Definition TrigEFBjet.h:124
float xNVtx() const
To retrieve likelihood weight based on number of tracks linked to secondary vertex.
const VxContainer * m_prmvertex
Pointer to the primary vertex collection.
Definition TrigEFBjet.h:102
float m_xChi2
Probability weight based on chi2 of track fit.
Definition TrigEFBjet.h:118
float xMVtx() const
To retrieve likelihood weight based on mass of secondary vertex.
float m_xnvtx
Likelihood weight based on number of tracks linked to secondary vertex - not filled yet.
Definition TrigEFBjet.h:126
float xCHI2() const
To retrieve probability weight based on chi2 of track fit.
float m_prmVtx
Z coordinate of the primary vertex.
Definition TrigEFBjet.h:107
float xIP1D() const
To retrieve likelihood weight based on longitudinal impact parameter.
float m_xmvtx
Likelihood weight based on mass of secondary vertex - not filled yet.
Definition TrigEFBjet.h:122
float prmVtx() const
To retrieve reconstructed z of primary vertex.
float xIP2D() const
To retrieve likelihood weight based on transverse impact parameter.
float xComb() const
To retrieve best likelihood weight (combination of IP3D and SV).
float m_xcomb
Best likelihood weight (combination of IP3D and SV) - not filled yet.
Definition TrigEFBjet.h:110
TrigEFBjet()
Constructor.
float xEVtx() const
To retrieve likelihood weight based on energy of secondary vertex.
bool isValid() const
To know if TrigEFBjet object is valid.
float m_xIP1d
Likelihood weight based on transverse impact parameter.
Definition TrigEFBjet.h:112