ATLAS Offline Software
Loading...
Searching...
No Matches
BTagging_v1.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: BTagging_v1.h 797330 2017-02-15 14:25:13Z guirriec $
8#ifndef XAODBTAGGING_VERSIONS_BTAGGING_V1_H
9#define XAODBTAGGING_VERSIONS_BTAGGING_V1_H
10
11// Core include(s):
13#include "AthLinks/ElementLink.h"
14
15// xAOD include(s):
21
22// STL include(s):
23#include <map>
24#include <vector>
25#include <string>
26#include <iostream>
28
29namespace xAOD {
30
39 class BTagging_v1 : public SG::AuxElement {
40
41 public:
42
44 typedef std::vector< ElementLink< xAOD::TrackParticleContainer > >
46 typedef std::vector<ElementLink<xAOD::VertexContainer> > VxELVec_t;
47 typedef std::vector<ElementLink<xAOD::BTagVertexContainer> > BTagVxELVec_t;
48
51
54
56
59
61 float SV0_significance3D() const;
63 void setSV0_significance3D(float value);
65 const TPELVec_t& SV0_TrackParticleLinks() const;
67 void setSV0_TrackParticleLinks( const TPELVec_t& value );
69 const xAOD::TrackParticle* SV0_TrackParticle( size_t i ) const;
71 size_t nSV0_TrackParticles() const;
76
78
81
83 float SV1_pb() const;
85 void setSV1_pb(float value);
87 float SV1_pc() const;
89 void setSV1_pc(float value);
91 float SV1_pu() const;
93 void setSV1_pu(float value);
95 double SV1_loglikelihoodratio() const { return this->calcLLR(SV1_pb(),SV1_pu()); }
97 const TPELVec_t& SV1_TrackParticleLinks() const;
99 void setSV1_TrackParticleLinks( const TPELVec_t& value );
101 const xAOD::TrackParticle* SV1_TrackParticle( size_t i ) const;
103 size_t nSV1_TrackParticles() const;
108
110
113
115 float IP2D_pb() const;
117 void setIP2D_pb(float value);
119 float IP2D_pc() const;
121 void setIP2D_pc(float value);
123 float IP2D_pu() const;
125 void setIP2D_pu(float value);
127 float IP2D_loglikelihoodratio() const { return this->calcLLR(IP2D_pb(),IP2D_pu()); }
129 const TPELVec_t& IP2D_TrackParticleLinks() const;
131 void setIP2D_TrackParticleLinks( const TPELVec_t& value );
133 const xAOD::TrackParticle* IP2D_TrackParticle( size_t i ) const;
135 size_t nIP2D_TrackParticles() const;
140
142
145
147 float IP3D_pb() const;
149 void setIP3D_pb(float value);
151 float IP3D_pc() const;
153 void setIP3D_pc(float value);
155 float IP3D_pu() const;
157 void setIP3D_pu(float value);
159 float IP3D_loglikelihoodratio() const { return ( (IP3D_pb()==1.&&IP3D_pu()==1.e9) ? 0. :
160 this->calcLLR(IP3D_pb(),IP3D_pu()) ); }
161
162 const TPELVec_t& IP3D_TrackParticleLinks() const;
164 void setIP3D_TrackParticleLinks( const TPELVec_t& value );
166 const xAOD::TrackParticle* IP3D_TrackParticle( size_t i ) const;
168 size_t nIP3D_TrackParticles() const;
173
175
178
182
184
187
189 float JetFitter_pb() const;
191 void setJetFitter_pb(float value);
193 float JetFitter_pc() const;
195 void setJetFitter_pc(float value);
197 float JetFitter_pu() const;
199 void setJetFitter_pu(float value);
202
203
205
208
210 float MV1_discriminant() const;
212 void setMV1_discriminant(float value);
213
215
216
219 bool loglikelihoodratio(const std::string& taggername, double &value,
220 const std::string& signal="pb", const std::string& bckgd="pu") const;
221 bool MVx_discriminant(const std::string& taggername, double &value) const;
222 bool pu(const std::string& taggername, double &value) const;
223 bool pb(const std::string& taggername, double &value) const;
224 bool pc(const std::string& taggername, double &value) const;
225 bool ptau( const std::string& taggername, double &value) const;
226 float calcLLR(double num, double den) const;
227
228
230
231
234
236 bool taggerInfo(int& value, BTagInfo info) const;
238 bool taggerInfo(float& value, BTagInfo info) const;
240 bool taggerInfo(bool& value, BTagInfo info) const;
242 bool taggerInfo(std::string& value, BTagInfo info) const;
244 bool taggerInfo(std::vector<int>& value, BTagInfo info) const;
246 bool taggerInfo(std::vector<float>& value, BTagInfo info) const;
248 bool taggerInfo(std::vector<bool>& value, BTagInfo info) const;
249
251 void setTaggerInfo(int value, BTagInfo info);
253 void setTaggerInfo(float value, BTagInfo info);
255 void setTaggerInfo(bool value, BTagInfo info);
257 void setTaggerInfo(const std::string& value, BTagInfo info);
259 void setTaggerInfo(const std::vector<int>& value, BTagInfo info);
261 void setTaggerInfo(const std::vector<float>& value, BTagInfo info);
263 void setTaggerInfo(const std::vector<bool>& value, BTagInfo info);
264
266
269
271 template< class T >
272 bool variable(const std::string &taggername,
273 const std::string &variablename, T &value) const;
274
276 template< class T >
277 void setVariable(const std::string &taggername,
278 const std::string &variablename, const T &value);
279
281
283 void toPersistent();
284
285 void setDynTPELName (const std::string &taggername,
286 const std::string &variablename);
287 void setDynVxELName (const std::string &taggername,
288 const std::string &variablename);
289 void setDynBTagVxELName (const std::string &taggername,
290 const std::string &variablename);
291
292
293 }; // class BTagging
294
295 template< class T >
296 inline
297 bool BTagging_v1::variable( const std::string &taggername,
298 const std::string &variablename,
299 T& value ) const {
300
301 const std::string varname = taggername+ "_" + variablename;
302 Accessor< T > acc( varname );
303 if( ! acc.isAvailable( *this ) ) return false;
304 value = acc( *this );
305 return true;
306 }
307
308 template< class T >
309 inline
310 void BTagging_v1::setVariable( const std::string &taggername,
311 const std::string &variablename,
312 const T &value ) {
313
314 const std::string varname = taggername+ "_" + variablename;
315 Accessor< T > acc( varname );
316 acc( *this ) = value;
317 return;
318 }
319
320} // namespace xAOD
321
322#endif // XAODBTAGGING_VERSIONS_BTAGGING_V1_H
Base class for elements of a container that can have aux data.
Define macros for attributes used to control the static checker.
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
std::vector< ElementLink< xAOD::BTagVertexContainer > > BTagVxELVec_t
Definition BTagging_v1.h:47
bool taggerInfo(bool &value, BTagInfo info) const
get taggers information (bool)
void clearIP3D_TrackParticleLinks()
clear vector of IP3D TrackParticle ElementLinks
float SV1_pc() const
SV1 c probability.
float SV0_significance3D() const
SV0 3D significance.
bool loglikelihoodratio(const std::string &taggername, double &value, const std::string &signal="pb", const std::string &bckgd="pu") const
bool pc(const std::string &taggername, double &value) const
void setVariable(const std::string &taggername, const std::string &variablename, const T &value)
set variables by string
bool pu(const std::string &taggername, double &value) const
float IP2D_loglikelihoodratio() const
get IP2D log likelihood ratio
bool pb(const std::string &taggername, double &value) const
const TPELVec_t & IP3D_TrackParticleLinks() const
get vector of IP3D TrackParticle ElementLinks
bool taggerInfo(std::vector< float > &value, BTagInfo info) const
get taggers information (vector<float>)
const xAOD::TrackParticle * SV0_TrackParticle(size_t i) const
Get one particular SV0 TrackParticle as a bare pointer.
float MV1_discriminant() const
MV1 discriminant.
void setDynBTagVxELName(const std::string &taggername, const std::string &variablename)
void setTaggerInfo(int value, BTagInfo info)
set taggers information (int)
const TPELVec_t & SV0_TrackParticleLinks() const
get vector of SV0 TrackParticle ElementLinks
bool taggerInfo(std::string &value, BTagInfo info) const
get taggers information (string)
float SV1_pu() const
SV1 light probability.
void clearSV1_TrackParticleLinks()
clear vector of SV1 TrackParticle ElementLinks
void setIP3D_pb(float value)
set IP3D b probability
void setDynVxELName(const std::string &taggername, const std::string &variablename)
size_t nSV0_TrackParticles() const
Get the number of SV0 TrackParticles associated with the object.
void setSV0_TrackParticleLinks(const TPELVec_t &value)
set vector of SV0 TrackParticle ElementLinks
std::vector< ElementLink< xAOD::VertexContainer > > VxELVec_t
Definition BTagging_v1.h:46
bool taggerInfo(std::vector< bool > &value, BTagInfo info) const
get taggers information (vector<bool>)
float IP2D_pb() const
IP2D b probability.
size_t nIP2D_TrackParticles() const
Get the number of IP2D TrackParticles associated with the object.
const xAOD::TrackParticle * SV1_TrackParticle(size_t i) const
Get one particular SV1 TrackParticle as a bare pointer.
float JetFitter_pc() const
JetFitter c probability.
float IP3D_pb() const
IP3D b probability.
float IP2D_pc() const
IP2D c probability.
size_t nSV1_TrackParticles() const
Get the number of SV1 TrackParticles associated with the object.
void addIP3D_TrackParticle(const ElementLink< xAOD::TrackParticleContainer > &link)
add a TrackParticle ElementLink for IP3D
bool taggerInfo(float &value, BTagInfo info) const
get taggers information (float)
float SV1_pb() const
SV1 b probability.
float SV1plusIP3D_discriminant() const
float IP3D_pc() const
IP3D c probability.
void setIP3D_pu(float value)
set IP3D light probability
bool ptau(const std::string &taggername, double &value) const
float calcLLR(double num, double den) const
float IP3D_pu() const
IP3D light probability.
void addIP2D_TrackParticle(const ElementLink< xAOD::TrackParticleContainer > &link)
add a TrackParticle ElementLink for IP2D
bool taggerInfo(std::vector< int > &value, BTagInfo info) const
get taggers information (vector<int>)
const xAOD::TrackParticle * IP3D_TrackParticle(size_t i) const
Get one particular IP3D TrackParticle as a bare pointer.
void setSV0_significance3D(float value)
set SV0 3D significance
void setSV1_TrackParticleLinks(const TPELVec_t &value)
set vector of SV1 TrackParticle ElementLinks
float JetFitter_pu() const
JetFitter light probability.
void clearIP2D_TrackParticleLinks()
clear vector of IP2D TrackParticle ElementLinks
void setIP2D_pu(float value)
set IP2D light probability
void setDynTPELName(const std::string &taggername, const std::string &variablename)
float JetFitter_loglikelihoodratio() const
get JetFitter log likelihood ratio
const TPELVec_t & SV1_TrackParticleLinks() const
get vector of SV1 TrackParticle ElementLinks
void setMV1_discriminant(float value)
set MV1 discriminant
void setSV1_pu(float value)
set SV1 light probability
const TPELVec_t & IP2D_TrackParticleLinks() const
get vector of IP2D TrackParticle ElementLinks
void setIP2D_pb(float value)
set IP2D b probability
void setSV1_pb(float value)
set SV1 b probability
const xAOD::TrackParticle * IP2D_TrackParticle(size_t i) const
Get one particular IP2D TrackParticle as a bare pointer.
void setJetFitter_pu(float value)
set JetFitter light probability
bool taggerInfo(int &value, BTagInfo info) const
get taggers information (int)
void setJetFitter_pb(float value)
set JetFitter b probability
void setIP3D_TrackParticleLinks(const TPELVec_t &value)
set vector of IP3D TrackParticle ElementLinks
bool variable(const std::string &taggername, const std::string &variablename, T &value) const
get variables by string
void setIP2D_TrackParticleLinks(const TPELVec_t &value)
set vector of IP2D TrackParticle ElementLinks
BTagging_v1()
Default constructor.
std::vector< ElementLink< xAOD::TrackParticleContainer > > TPELVec_t
A helper typedef.
Definition BTagging_v1.h:45
void addSV0_TrackParticle(const ElementLink< xAOD::TrackParticleContainer > &link)
add a TrackParticle ElementLink for SV0
float IP2D_pu() const
IP2D light probability.
void setSV1_pc(float value)
set SV1 c probability
void setIP3D_pc(float value)
set IP3D c probability
float IP3D_loglikelihoodratio() const
get IP3D log likelihood ratio
double SV1_loglikelihoodratio() const
get SV1 log likelihood ratio
Definition BTagging_v1.h:95
size_t nIP3D_TrackParticles() const
Get the number of IP3D TrackParticles associated with the object.
float JetFitter_pb() const
JetFitter b probability.
void setIP2D_pc(float value)
set IP2D c probability
void addSV1_TrackParticle(const ElementLink< xAOD::TrackParticleContainer > &link)
add a TrackParticle ElementLink for SV1
void setJetFitter_pc(float value)
set JetFitter c probability
bool MVx_discriminant(const std::string &taggername, double &value) const
void clearSV0_TrackParticleLinks()
clear vector of SV0 TrackParticle ElementLinks
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
TrackParticle_v1 TrackParticle
Reference the current persistent version: