ATLAS Offline Software
DiTauMassDecorator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // DiTauMassDecorator.cxx
7 // Author: Nadav Tamir (nadavtamir@mail.tau.ac.il)
9 
11 #include "xAODTracking/Vertex.h"
13 
14 namespace DerivationFramework {
15 
16  DiTauMassDecorator::DiTauMassDecorator(const std::string& t, const std::string& n, const IInterface* p) :
17  AthAlgTool(t,n,p),
18  m_ditauContainerName("DiTauJets")
19  {
20  declareInterface<DerivationFramework::IAugmentationTool>(this);
21  declareProperty("DiTauContainerName", m_ditauContainerName);
22  }
23 
25  {
26  // retrieve container
27  const xAOD::DiTauJetContainer* xDTContainer = evtStore()->retrieve< const xAOD::DiTauJetContainer >( m_ditauContainerName );
28  if( ! xDTContainer ) {
29  ATH_MSG_ERROR ("Couldn't retrieve di-tau container with key: " << m_ditauContainerName );
30  return StatusCode::FAILURE;
31  }
32 
33  for(auto xDT : *xDTContainer) {
34  TLorentzVector tlvLead = TLorentzVector();
35  TLorentzVector tlvSubLead = TLorentzVector();
36  tlvLead.SetPtEtaPhiE(xDT->subjetPt(0), xDT->subjetEta(0), xDT->subjetPhi(0), xDT->subjetE(0));
37  if(xDT->nSubjets() >=2) {
38  tlvSubLead.SetPtEtaPhiE(xDT->subjetPt(1), xDT->subjetEta(1), xDT->subjetPhi(1), xDT->subjetE(1));
39  }
40  float DTmass = (tlvLead+tlvSubLead).M();
41  SG::AuxElement::Decorator< float > LSLMassDeco( "LSLMass" );
42  LSLMassDeco(*xDT) = DTmass;
43  }
44 
45  return StatusCode::SUCCESS;
46  }
47 }
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
DiTauJetContainer.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::DiTauMassDecorator::m_ditauContainerName
std::string m_ditauContainerName
Definition: DiTauMassDecorator.h:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
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:58
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DiTauMassDecorator.h
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Vertex.h
DerivationFramework::DiTauMassDecorator::addBranches
virtual StatusCode addBranches() const
Pass the thinning service
Definition: DiTauMassDecorator.cxx:24
DerivationFramework::DiTauMassDecorator::DiTauMassDecorator
DiTauMassDecorator(const std::string &t, const std::string &n, const IInterface *p)
Definition: DiTauMassDecorator.cxx:16
AthAlgTool
Definition: AthAlgTool.h:26