ATLAS Offline Software
IParticleSelector.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$
16 
17 
24  ISvcLocator* pSvcLocator)
25  : SelectorBase<IParticleSelector>(name, pSvcLocator)
26 {
27  declareProperty("Selectors",m_selectorHandles,"The Selectors");
28 
29  // Set defaults to do no selection.
30  m_ptmin = -1e10;
31  m_ptmax = 1e10;
32  m_etamin = -1e10;
33  m_etamax = 1e10;
34  m_absetamin = 0;
35  m_absetamax = 1e10;
36 }
37 
38 
43 {
45  CHECK( m_selectorHandles.retrieve() );
46  return StatusCode::SUCCESS;
47 }
48 
49 
55 {
56  return accept (*link);
57 }
58 
59 
65 {
66  // Apply basic kinematic selection.
67  if(!pt_eta_range(part->pt(),part->eta())) return false;
68 
69  // Apply additional selection tools.
70  for (size_t i = 0; i < m_selectorHandles.size(); i++) {
71  // FIXME: ISelector::accept should take a const pointer!
72  if (!m_selectorHandles[i]->getTool()->accept (const_cast<Contained*>(part)))
73  return false;
74  }
75 
76  return true;
77 }
78 
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
IParticleSelector::accept
bool accept(const IParticleLink &link)
Test to see if a particle passes the selection.
Definition: IParticleSelector.cxx:54
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
SelectorBase
Definition: SelectorBase.h:36
IParticleSelector.h
A Selector class with IParticleContainer.
lumiFormat.i
int i
Definition: lumiFormat.py:92
IParticleSelector
A Selector class with IParticleContainer.
Definition: IParticleSelector.h:71
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SelectorBase< IParticleSelector >::m_absetamin
double m_absetamin
Definition: SelectorBase.h:86
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
SelectorBase< IParticleSelector >::m_ptmax
double m_ptmax
Definition: SelectorBase.h:82
SelectorBase< IParticleSelector >::m_etamax
double m_etamax
Definition: SelectorBase.h:84
SelectorBase< IParticleSelector >::m_absetamax
double m_absetamax
Definition: SelectorBase.h:85
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
errorcheck.h
Helpers for checking error return status codes and reporting errors.
SelectorBase< IParticleSelector >::m_etamin
double m_etamin
Definition: SelectorBase.h:83
IParticleSelector::initialize
virtual StatusCode initialize()
Standard Gaudi initialize() method.
Definition: IParticleSelector.cxx:42
IParticleSelector::IParticleSelector
IParticleSelector(const std::string &name, ISvcLocator *pSvcLocator)
Standard Gaudi algorithm constructor.
Definition: IParticleSelector.cxx:23
SelectorBase< IParticleSelector >::pt_eta_range
bool pt_eta_range(double pt, double eta)
Definition: SelectorBase.h:279
IParticleSelector::m_selectorHandles
ToolHandleArray< ISelector > m_selectorHandles
Property: List of additional selection tools.
Definition: IParticleSelector.h:106
IParticle
Definition: Event/EventKernel/EventKernel/IParticle.h:43
SelectorBase< IParticleSelector >::m_ptmin
double m_ptmin
Definition: SelectorBase.h:81