ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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 
41  if ( !jets.isValid() ) {
42  ATH_MSG_ERROR ("Couldn't retrieve jets with key: " << m_jetCollectionName );
43  return StatusCode::FAILURE;
44  }
45 
46 
52 
56 
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 }

◆ initialize()

StatusCode DerivationFramework::JetMSVAugmentation::initialize ( )
finaloverridevirtual

Definition at line 28 of file JetMSVAugmentation.cxx.

28  {
29  ATH_MSG_DEBUG("Initialize " );
31 
32  return StatusCode::SUCCESS;
33 
34 }

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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ m_jetCollectionName

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

Definition at line 37 of file JetMSVAugmentation.h.

◆ m_vtxAlgName

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

Definition at line 52 of file JetMSVAugmentation.h.


The documentation for this class was generated from the following files:
python.BuildSignatureFlags.bjet
AthConfigFlags bjet(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:375
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
test_pyathena.pt
pt
Definition: test_pyathena.py:11
DerivationFramework::JetMSVAugmentation::m_jetCollectionName
SG::ReadHandleKey< xAOD::JetContainer > m_jetCollectionName
Definition: JetMSVAugmentation.h:37
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
xAOD::SecVtxHelper::VtxNtrk
int VtxNtrk(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:39
DerivationFramework::JetMSVAugmentation::m_vtxAlgName
Gaudi::Property< std::string > m_vtxAlgName
Definition: JetMSVAugmentation.h:52
DerivationFramework::JetMSVAugmentation::m_dec_vtxz
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxz
Definition: JetMSVAugmentation.h:47
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::JetMSVAugmentation::m_dec_vtxpt
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxpt
Definition: JetMSVAugmentation.h:40
xAOD::SecVtxHelper::VertexMass
float VertexMass(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:9
DerivationFramework::JetMSVAugmentation::m_dec_vtxphi
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxphi
Definition: JetMSVAugmentation.h:42
DerivationFramework::JetMSVAugmentation::m_dec_vtxntrk
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxntrk
Definition: JetMSVAugmentation.h:49
xAOD::SecVtxHelper::VtxnormDist
float VtxnormDist(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:95
DerivationFramework::JetMSVAugmentation::m_dec_vtxefrac
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxefrac
Definition: JetMSVAugmentation.h:43
DerivationFramework::JetMSVAugmentation::m_dec_vtxy
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxy
Definition: JetMSVAugmentation.h:46
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:727
xAOD::SecVtxHelper::Vtxphi
float Vtxphi(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:81
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::JetMSVAugmentation::m_dec_vtxeta
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxeta
Definition: JetMSVAugmentation.h:41
DerivationFramework::JetMSVAugmentation::m_dec_vtxdls
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxdls
Definition: JetMSVAugmentation.h:50
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
DerivationFramework::JetMSVAugmentation::m_dec_vtxx
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxx
Definition: JetMSVAugmentation.h:45
xAOD::BTaggingUtilities::getBTagging
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
Definition: BTaggingUtilities.cxx:37
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::SecVtxHelper::EnergyFraction
float EnergyFraction(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:24
xAOD::SecVtxHelper::Vtxpt
float Vtxpt(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:53
DerivationFramework::JetMSVAugmentation::m_dec_vtxmass
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_vtxmass
Definition: JetMSVAugmentation.h:39
xAOD::SecVtxHelper::Vtxeta
float Vtxeta(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:67