ATLAS Offline Software
TestIsolationAthenaAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: TestIsolationAthenaAlg.cxx 672993 2015-06-06 16:55:34Z dzhang $
6 
7 // Local include(s):
9 
10 // EDM include(s):
13 #include "xAODMuon/MuonContainer.h"
14 
15 // other include(s):
16 #include <cmath>
17 
18 namespace CP {
19 
20  TestIsolationAthenaAlg::TestIsolationAthenaAlg(const std::string& name, ISvcLocator* svcLoc) :
21  AthAlgorithm(name, svcLoc), m_sgKeyPhotons("Photons"), m_sgKeyElectrons("Electrons"), m_sgKeyMuons("Muons") {
22  declareProperty("sgKeyPhotons", m_sgKeyPhotons);
23  declareProperty("sgKeyElectrons", m_sgKeyElectrons);
24  declareProperty("sgKeyMuons", m_sgKeyMuons);
25  declareProperty("IsoTool", m_isoTool);
26  }
27 
29  ATH_CHECK(m_isoTool.retrieve());
30 
31  // Return gracefully:
32  return StatusCode::SUCCESS;
33  }
34 
36  const xAOD::PhotonContainer* photons(nullptr);
38  for (auto x : *photons) {
39  if (x->pt() > 7000.) {
40  if (x->caloCluster() != nullptr) {
41  if (fabs(x->caloCluster()->eta()) < 2.47) {
42  if (m_isoTool->accept(*x)) { ATH_MSG_INFO(" Photon passes Isolation"); }
43  }
44  }
45  }
46  }
47 
48  const xAOD::ElectronContainer* electrons(nullptr);
50  for (auto x : *electrons) {
51  if (x->pt() > 7000.) {
52  if (x->caloCluster() != nullptr) {
53  if (fabs(x->caloCluster()->eta()) < 2.47) {
54  if (m_isoTool->accept(*x)) { ATH_MSG_INFO(" Electron passes Isolation"); }
55  }
56  }
57  }
58  }
59 
60  const xAOD::MuonContainer* muons(nullptr);
62  for (auto x : *muons) {
63  if (x->pt() > 7000.) {
64  if (fabs(x->eta()) < 2.5) {
65  if (m_isoTool->accept(*x)) { ATH_MSG_INFO(" Muon passes Isolation"); }
66  }
67  }
68  }
69 
70  // Return gracefully:
71  return StatusCode::SUCCESS;
72  }
73 } // namespace CP
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CP::TestIsolationAthenaAlg::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: TestIsolationAthenaAlg.cxx:28
x
#define x
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
CP::TestIsolationAthenaAlg::m_sgKeyMuons
std::string m_sgKeyMuons
Definition: TestIsolationAthenaAlg.h:31
CP::TestIsolationAthenaAlg::m_sgKeyElectrons
std::string m_sgKeyElectrons
Definition: TestIsolationAthenaAlg.h:30
ElectronContainer.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::TestIsolationAthenaAlg::m_sgKeyPhotons
std::string m_sgKeyPhotons
Definition: TestIsolationAthenaAlg.h:29
CP::TestIsolationAthenaAlg::m_isoTool
ToolHandle< CP::IIsolationSelectionTool > m_isoTool
Definition: TestIsolationAthenaAlg.h:32
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CP::TestIsolationAthenaAlg::execute
virtual StatusCode execute()
Function executing the algorithm.
Definition: TestIsolationAthenaAlg.cxx:35
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MuonContainer.h
CP::TestIsolationAthenaAlg::TestIsolationAthenaAlg
TestIsolationAthenaAlg(const std::string &name, ISvcLocator *svcLoc)
Definition: TestIsolationAthenaAlg.cxx:20
PhotonContainer.h
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
TestIsolationAthenaAlg.h