ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::JetMSVAugmentation Class Reference

#include <JetMSVAugmentation.h>

Inheritance diagram for DerivationFramework::JetMSVAugmentation:
Collaboration diagram for DerivationFramework::JetMSVAugmentation:

Public Member Functions

 JetMSVAugmentation (const std::string &t, const std::string &n, const IInterface *p)
 ~JetMSVAugmentation ()
virtual StatusCode initialize () override final
virtual StatusCode addBranches (const EventContext &ctx) const override final

Private Attributes

SG::ReadHandleKey< xAOD::JetContainerm_jetCollectionName {this, "JetCollectionName", "AntiKt4EMTopoJets"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dec_vtxmass {this, "vtxmassDecorKey", m_jetCollectionName, "MSV_vtxmass"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dec_vtxpt {this, "vtxptDecorKey", m_jetCollectionName, "MSV_vtxpt"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dec_vtxeta {this, "vtxetaDecorKey", m_jetCollectionName, "MSV_vtxeta"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dec_vtxphi {this, "vtxphiDecorKey", m_jetCollectionName, "MSV_vtxphi"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dec_vtxefrac {this, "vtxefracDecorKey", m_jetCollectionName, "MSV_vtxefrac"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dec_vtxx {this, "vtxxDecorKey", m_jetCollectionName, "MSV_vtxx"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dec_vtxy {this, "vtxyDecorKey", m_jetCollectionName, "MSV_vtxy"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dec_vtxz {this, "vtxzDecorKey", m_jetCollectionName, "MSV_vtxz"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dec_vtxntrk {this, "vtxntrkDecorKey", m_jetCollectionName, "MSV_vtxntrk"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_dec_vtxdls {this, "vtxdlsDecorKey", m_jetCollectionName, "MSV_vtxdls"}
Gaudi::Property< std::string > m_vtxAlgName {this, "vertexAlgName", "MSV"}

Detailed Description

Definition at line 27 of file JetMSVAugmentation.h.

Constructor & Destructor Documentation

◆ JetMSVAugmentation()

DerivationFramework::JetMSVAugmentation::JetMSVAugmentation ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 17 of file JetMSVAugmentation.cxx.

17 :
18 base_class(t,n,p)
19{
20}

◆ ~JetMSVAugmentation()

DerivationFramework::JetMSVAugmentation::~JetMSVAugmentation ( )
default

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::JetMSVAugmentation::addBranches ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 38 of file JetMSVAugmentation.cxx.

38 {
39
40 SG::ReadHandle<xAOD::JetContainer> jets{m_jetCollectionName, ctx};
41 if ( !jets.isValid() ) {
42 ATH_MSG_ERROR ("Couldn't retrieve jets with key: " << m_jetCollectionName );
43 return StatusCode::FAILURE;
44 }
45
46
47 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> dec_vtxmass(m_dec_vtxmass, ctx);
48 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> dec_vtxpt(m_dec_vtxpt, ctx);
49 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> dec_vtxeta(m_dec_vtxeta, ctx);
50 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> dec_vtxphi(m_dec_vtxphi, ctx);
51 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> dec_vtxefrac(m_dec_vtxefrac, ctx);
52
53 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> dec_vtxx(m_dec_vtxx, ctx);
54 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> dec_vtxy(m_dec_vtxy, ctx);
55 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> dec_vtxz(m_dec_vtxz, ctx);
56
57 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<int>> dec_vtxntrk(m_dec_vtxntrk, ctx);
58 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> dec_vtxdls(m_dec_vtxdls, ctx);
59
60
61 for (auto jet : *jets) {
63 if (!bjet) {
64 ATH_MSG_WARNING("btagging information not available" );
65 continue;
66 }
67
68 std::vector< ElementLink< xAOD::VertexContainer > > msvVertices;
69 bjet->variable<std::vector<ElementLink<xAOD::VertexContainer> > >(m_vtxAlgName, "vertices", msvVertices);
70
71 std::vector<float> vtx_mass;
72 std::vector<float> vtx_pt;
73 std::vector<float> vtx_eta;
74 std::vector<float> vtx_phi;
75 std::vector<float> vtx_efrac;
76 std::vector<float> vtx_x;
77 std::vector<float> vtx_y;
78 std::vector<float> vtx_z;
79 std::vector<int> vtx_ntrk;
80 std::vector<float> vtx_dls;
81
82
83 for (auto vtx : msvVertices) {//loop in vertices
84
85 int ntrk = xAOD::SecVtxHelper::VtxNtrk(*vtx);
87 float efrc = xAOD::SecVtxHelper::EnergyFraction(*vtx);
88 float pt = xAOD::SecVtxHelper::Vtxpt(*vtx);
89 float eta = xAOD::SecVtxHelper::Vtxeta(*vtx);
90 float phi = xAOD::SecVtxHelper::Vtxphi(*vtx);
91 float dls = xAOD::SecVtxHelper::VtxnormDist(*vtx);
92 float xp = (*vtx)->x();
93 float yp = (*vtx)->y();
94 float zp = (*vtx)->z();
95 // float chi = (*vtx)->chiSquared();
96 // float ndf = (*vtx)->numberDoF();
97
98 TLorentzVector p;
99 p.SetPtEtaPhiM(pt,eta,phi,mass);
100
101 vtx_mass.push_back(mass);
102 vtx_pt.push_back(pt);
103 vtx_eta.push_back(eta);
104 vtx_phi.push_back(phi);
105 vtx_efrac.push_back(efrc);
106 vtx_x.push_back(xp);
107 vtx_y.push_back(yp);
108 vtx_z.push_back(zp);
109 vtx_ntrk.push_back(ntrk);
110 vtx_dls.push_back(dls);
111 }
112
113 dec_vtxmass(*bjet)=vtx_mass;
114 dec_vtxpt(*bjet)=vtx_pt;
115 dec_vtxeta(*bjet)=vtx_eta;
116 dec_vtxphi(*bjet)=vtx_phi;
117 dec_vtxefrac(*bjet)=vtx_efrac;
118 dec_vtxx(*bjet)=vtx_x;
119 dec_vtxy(*bjet)=vtx_y;
120 dec_vtxz(*bjet)=vtx_z;
121 dec_vtxdls(*bjet)=vtx_dls;
122 dec_vtxntrk(*bjet)=vtx_ntrk;
123
124 }
125
126 return StatusCode::SUCCESS;
127
128}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxpt
SG::ReadHandleKey< xAOD::JetContainer > m_jetCollectionName
Gaudi::Property< std::string > m_vtxAlgName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxmass
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxx
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxntrk
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxz
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxy
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxeta
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxphi
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxefrac
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxdls
AthConfigFlags bjet(AthConfigFlags flags, str instanceName, str recoMode)
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
int VtxNtrk(const xAOD::Vertex *)
float Vtxpt(const xAOD::Vertex *)
float Vtxeta(const xAOD::Vertex *)
float EnergyFraction(const xAOD::Vertex *)
float VertexMass(const xAOD::Vertex *)
float Vtxphi(const xAOD::Vertex *)
float VtxnormDist(const xAOD::Vertex *)
BTagging_v1 BTagging
Definition of the current "BTagging version".
Definition BTagging.h:17

◆ initialize()

StatusCode DerivationFramework::JetMSVAugmentation::initialize ( )
finaloverridevirtual

Definition at line 28 of file JetMSVAugmentation.cxx.

28 {
29 ATH_MSG_DEBUG("Initialize " );
30 ATH_CHECK(m_jetCollectionName.initialize());
31
32 return StatusCode::SUCCESS;
33
34}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)

Member Data Documentation

◆ m_dec_vtxdls

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::JetMSVAugmentation::m_dec_vtxdls {this, "vtxdlsDecorKey", m_jetCollectionName, "MSV_vtxdls"}
private

Definition at line 50 of file JetMSVAugmentation.h.

50{this, "vtxdlsDecorKey", m_jetCollectionName, "MSV_vtxdls"};

◆ m_dec_vtxefrac

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::JetMSVAugmentation::m_dec_vtxefrac {this, "vtxefracDecorKey", m_jetCollectionName, "MSV_vtxefrac"}
private

Definition at line 43 of file JetMSVAugmentation.h.

43{this, "vtxefracDecorKey", m_jetCollectionName, "MSV_vtxefrac"};

◆ m_dec_vtxeta

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::JetMSVAugmentation::m_dec_vtxeta {this, "vtxetaDecorKey", m_jetCollectionName, "MSV_vtxeta"}
private

Definition at line 41 of file JetMSVAugmentation.h.

41{this, "vtxetaDecorKey", m_jetCollectionName, "MSV_vtxeta"};

◆ m_dec_vtxmass

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::JetMSVAugmentation::m_dec_vtxmass {this, "vtxmassDecorKey", m_jetCollectionName, "MSV_vtxmass"}
private

Definition at line 39 of file JetMSVAugmentation.h.

39{this, "vtxmassDecorKey", m_jetCollectionName, "MSV_vtxmass"};

◆ m_dec_vtxntrk

SG::WriteDecorHandleKey<xAOD::JetContainer > DerivationFramework::JetMSVAugmentation::m_dec_vtxntrk {this, "vtxntrkDecorKey", m_jetCollectionName, "MSV_vtxntrk"}
private

Definition at line 49 of file JetMSVAugmentation.h.

49{this, "vtxntrkDecorKey", m_jetCollectionName, "MSV_vtxntrk"};

◆ m_dec_vtxphi

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::JetMSVAugmentation::m_dec_vtxphi {this, "vtxphiDecorKey", m_jetCollectionName, "MSV_vtxphi"}
private

Definition at line 42 of file JetMSVAugmentation.h.

42{this, "vtxphiDecorKey", m_jetCollectionName, "MSV_vtxphi"};

◆ m_dec_vtxpt

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::JetMSVAugmentation::m_dec_vtxpt {this, "vtxptDecorKey", m_jetCollectionName, "MSV_vtxpt"}
private

Definition at line 40 of file JetMSVAugmentation.h.

40{this, "vtxptDecorKey", m_jetCollectionName, "MSV_vtxpt"};

◆ m_dec_vtxx

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::JetMSVAugmentation::m_dec_vtxx {this, "vtxxDecorKey", m_jetCollectionName, "MSV_vtxx"}
private

Definition at line 45 of file JetMSVAugmentation.h.

45{this, "vtxxDecorKey", m_jetCollectionName, "MSV_vtxx"};

◆ m_dec_vtxy

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::JetMSVAugmentation::m_dec_vtxy {this, "vtxyDecorKey", m_jetCollectionName, "MSV_vtxy"}
private

Definition at line 46 of file JetMSVAugmentation.h.

46{this, "vtxyDecorKey", m_jetCollectionName, "MSV_vtxy"};

◆ m_dec_vtxz

SG::WriteDecorHandleKey<xAOD::JetContainer> DerivationFramework::JetMSVAugmentation::m_dec_vtxz {this, "vtxzDecorKey", m_jetCollectionName, "MSV_vtxz"}
private

Definition at line 47 of file JetMSVAugmentation.h.

47{this, "vtxzDecorKey", m_jetCollectionName, "MSV_vtxz"};

◆ m_jetCollectionName

SG::ReadHandleKey<xAOD::JetContainer> DerivationFramework::JetMSVAugmentation::m_jetCollectionName {this, "JetCollectionName", "AntiKt4EMTopoJets"}
private

Definition at line 37 of file JetMSVAugmentation.h.

37{this, "JetCollectionName", "AntiKt4EMTopoJets"};

◆ m_vtxAlgName

Gaudi::Property<std::string> DerivationFramework::JetMSVAugmentation::m_vtxAlgName {this, "vertexAlgName", "MSV"}
private

Definition at line 52 of file JetMSVAugmentation.h.

52{this, "vertexAlgName", "MSV"};

The documentation for this class was generated from the following files: