Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 ()
 
StatusCode initialize ()
 
StatusCode finalize ()
 
virtual StatusCode addBranches () const
 

Private Attributes

std::string m_jetCollectionName
 
std::string m_vtxAlgName
 

Detailed Description

Definition at line 25 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 19 of file JetMSVAugmentation.cxx.

19  :
20  base_class(t,n,p)
21 {
22 
23 
24  declareProperty("JetCollectionName",m_jetCollectionName="AntiKt4EMTopoJets");
25  declareProperty("vertexAlgName",m_vtxAlgName="MSV");
26 
27 }

◆ ~JetMSVAugmentation()

DerivationFramework::JetMSVAugmentation::~JetMSVAugmentation ( )

Definition at line 31 of file JetMSVAugmentation.cxx.

31 {}

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::JetMSVAugmentation::addBranches ( ) const
virtual

Definition at line 54 of file JetMSVAugmentation.cxx.

54  {
55 
56 
57  const xAOD::JetContainer* jets;
58  if( evtStore()->retrieve( jets, m_jetCollectionName ).isFailure() ) {
59  ATH_MSG_ERROR ("Couldn't retrieve jets with key: " << m_jetCollectionName );
60  return StatusCode::FAILURE;
61  }
62 
63 
64  static const SG::AuxElement::Decorator<std::vector<float> > dec_vtxmass(m_vtxAlgName+"_vtxmass");
65  static const SG::AuxElement::Decorator<std::vector<float> > dec_vtxpt(m_vtxAlgName+"_vtxpt");
66  static const SG::AuxElement::Decorator<std::vector<float> > dec_vtxeta(m_vtxAlgName+"_vtxeta");
67  static const SG::AuxElement::Decorator<std::vector<float> > dec_vtxphi(m_vtxAlgName+"_vtxphi");
68  static const SG::AuxElement::Decorator<std::vector<float> > dec_vtxefrac(m_vtxAlgName+"_vtxefrac");
69 
70  static const SG::AuxElement::Decorator<std::vector<float> > dec_vtxx(m_vtxAlgName+"_vtxx");
71  static const SG::AuxElement::Decorator<std::vector<float> > dec_vtxy(m_vtxAlgName+"_vtxy");
72  static const SG::AuxElement::Decorator<std::vector<float> > dec_vtxz(m_vtxAlgName+"_vtxz");
73 
74  static const SG::AuxElement::Decorator<std::vector<int> > dec_vtxntrk(m_vtxAlgName+"_vtxntrk");
75  static const SG::AuxElement::Decorator<std::vector<float> > dec_vtxdls(m_vtxAlgName+"_vtxdls");
76 
77 
78  for(auto jet : *jets){
80 
81  if(!bjet){
82  ATH_MSG_WARNING("btagging information not available" );
83  continue;
84  }
85 
86  std::vector< ElementLink< xAOD::VertexContainer > > msvVertices;
87  bjet->variable<std::vector<ElementLink<xAOD::VertexContainer> > >(m_vtxAlgName, "vertices", msvVertices);
88 
89  std::vector<float> vtx_mass;
90  std::vector<float> vtx_pt;
91  std::vector<float> vtx_eta;
92  std::vector<float> vtx_phi;
93  std::vector<float> vtx_efrac;
94  std::vector<float> vtx_x;
95  std::vector<float> vtx_y;
96  std::vector<float> vtx_z;
97  std::vector<int> vtx_ntrk;
98  std::vector<float> vtx_dls;
99 
100 
101  for(auto vtx : msvVertices){//loop in vertices
102 
103  int ntrk = xAOD::SecVtxHelper::VtxNtrk(*vtx);
104  float mass = xAOD::SecVtxHelper::VertexMass(*vtx);
105  float efrc = xAOD::SecVtxHelper::EnergyFraction(*vtx);
106  float pt = xAOD::SecVtxHelper::Vtxpt(*vtx);
107  float eta = xAOD::SecVtxHelper::Vtxeta(*vtx);
108  float phi = xAOD::SecVtxHelper::Vtxphi(*vtx);
109  float dls = xAOD::SecVtxHelper::VtxnormDist(*vtx);
110  float xp = (*vtx)->x();
111  float yp = (*vtx)->y();
112  float zp = (*vtx)->z();
113  // float chi = (*vtx)->chiSquared();
114  // float ndf = (*vtx)->numberDoF();
115 
116  TLorentzVector p;
117  p.SetPtEtaPhiM(pt,eta,phi,mass);
118 
119  vtx_mass.push_back(mass);
120  vtx_pt.push_back(pt);
121  vtx_eta.push_back(eta);
122  vtx_phi.push_back(phi);
123  vtx_efrac.push_back(efrc);
124  vtx_x.push_back(xp);
125  vtx_y.push_back(yp);
126  vtx_z.push_back(zp);
127  vtx_ntrk.push_back(ntrk);
128  vtx_dls.push_back(dls);
129  }
130 
131  dec_vtxmass(*bjet)=vtx_mass;
132  dec_vtxpt(*bjet)=vtx_pt;
133  dec_vtxeta(*bjet)=vtx_eta;
134  dec_vtxphi(*bjet)=vtx_phi;
135  dec_vtxefrac(*bjet)=vtx_efrac;
136  dec_vtxx(*bjet)=vtx_x;
137  dec_vtxy(*bjet)=vtx_y;
138  dec_vtxz(*bjet)=vtx_z;
139  dec_vtxdls(*bjet)=vtx_dls;
140  dec_vtxntrk(*bjet)=vtx_ntrk;
141 
142  }
143 
144  return StatusCode::SUCCESS;
145 
146 }

◆ finalize()

StatusCode DerivationFramework::JetMSVAugmentation::finalize ( )

Definition at line 46 of file JetMSVAugmentation.cxx.

46  {
47 
48  return StatusCode::SUCCESS;
49 
50 }

◆ initialize()

StatusCode DerivationFramework::JetMSVAugmentation::initialize ( )

Definition at line 35 of file JetMSVAugmentation.cxx.

35  {
36 
37  ATH_MSG_INFO("Initialize " );
38 
39 
40  return StatusCode::SUCCESS;
41 
42 }

Member Data Documentation

◆ m_jetCollectionName

std::string DerivationFramework::JetMSVAugmentation::m_jetCollectionName
private

Definition at line 39 of file JetMSVAugmentation.h.

◆ m_vtxAlgName

std::string DerivationFramework::JetMSVAugmentation::m_vtxAlgName
private

Definition at line 40 of file JetMSVAugmentation.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
python.BuildSignatureFlags.bjet
AthConfigFlags bjet(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:339
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
test_pyathena.pt
pt
Definition: test_pyathena.py:11
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
xAOD::SecVtxHelper::VtxNtrk
int VtxNtrk(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:39
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::SecVtxHelper::VertexMass
float VertexMass(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:9
xAOD::SecVtxHelper::VtxnormDist
float VtxnormDist(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:95
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
beamspotman.n
n
Definition: beamspotman.py:731
xAOD::SecVtxHelper::Vtxphi
float Vtxphi(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:81
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::JetMSVAugmentation::m_jetCollectionName
std::string m_jetCollectionName
Definition: JetMSVAugmentation.h:39
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_vtxAlgName
std::string m_vtxAlgName
Definition: JetMSVAugmentation.h:40
xAOD::SecVtxHelper::Vtxeta
float Vtxeta(const xAOD::Vertex *)
Definition: SecVtxHelper.cxx:67