27#include "GaudiKernel/MsgStream.h"
28#include "GaudiKernel/AlgTool.h"
29#include "GaudiKernel/ToolHandle.h"
31#include "CLHEP/Units/SystemOfUnits.h"
35template<
class Derived>
39 SelectorBase(
const std::string& name, ISvcLocator* pSvcLocator);
77template<
class Derived>
99template<
class Derived>
114 <<
", OutParticleLinksKey="<<
m_linksKey.c_str() );
116 << MSG::INFO<<
", PtMax="<<
m_ptmax
121 << MSG::INFO<<
", SelectAll="<<
m_all );
126 ATH_MSG_FATAL(
"Must supply names for InputKey, OutSelectedParticlesKey and/or OutParticleLinksKey" );
130 ATH_MSG_FATAL(
"Cannot have both InSelectedParticlesKey and InParticlesLinksKey, must chose one" );
134 return StatusCode::SUCCESS;
137template<
class Derived>
140 typedef typename Derived::Container
Container;
142 typedef typename Derived::Links Links;
149 const Links* inlinks=0;
158 int npart=particles->size();
159 ATH_MSG_DEBUG(
" >>>> got Container, no. of particles="<<npart );
167 typename Container::const_iterator ipItr = particles->begin();
168 typename Container::const_iterator ipEnd = particles->end();
169 int npart=particles->size();
174 <<
"), no. particles="<<inselparts->
numGood()
177 for(; ipItr != ipEnd; ++ipItr) {
183 if(
m_all ||
static_cast<Derived*
>(
this)->accept(*ipItr)){
191 typename Links::const_iterator ilItr = inlinks->begin();
192 typename Links::const_iterator ilEnd = inlinks->end();
194 <<inlinks->size()<<
" <<<<<" );
196 for(; ilItr != ilEnd; ++ilItr) {
197 ipart=(*ilItr).index();
200 if(
m_all ||
static_cast<Derived*
>(
this)->accept(*ilItr) ){
212 Links* links=
new Links();
217 typename Container::const_iterator ipItr = particles->begin();
218 typename Container::const_iterator ipEnd = particles->end();
220 for(; ipItr != ipEnd; ++ipItr) {
221 if(selparts->
isGood(ipart)){
223 links->push_back(el);
227 return StatusCode::SUCCESS;
230 typename Links::const_iterator ilItr = inlinks->begin();
231 typename Links::const_iterator ilEnd = inlinks->end();
233 <<inlinks->size()<<
" <<<<<" );
235 for(; ilItr != ilEnd; ++ilItr) {
236 ipart=(*ilItr).index();
239 if(
m_all ||
static_cast<Derived*
>(
this)->accept(*ilItr) ){
240 links->push_back(*ilItr);
246 <<
"), no. particles="<<inselparts->
numGood()
249 typename Container::const_iterator ipItr = particles->begin();
250 typename Container::const_iterator ipEnd = particles->end();
252 for(; ipItr != ipEnd; ++ipItr) {
258 if(
m_all ||
static_cast<Derived*
>(
this)->accept(*ipItr) ){
260 links->push_back(el);
261 ATH_MSG_DEBUG(
" accepted ipart="<<ipart<<
", pt="<<(*el)->pt()/Athena::Units::GeV );
267 return StatusCode::SUCCESS;
270template<
class Derived>
275 return StatusCode::SUCCESS;
278template<
class Derived>
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
Wrapper to avoid constant divisions when using units.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
ElementLink implementation for ROOT usage.
storage of the time histories of all the cells
void SetMaxBits(unsigned maxbits)
void SetBit(unsigned i, bool good=true)
std::string displayBits() const
bool isGood(unsigned i) const
SelectorBase(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode finalize()
std::string m_inselectedKey
virtual StatusCode initialize()
bool pt_eta_range(double pt, double eta)
virtual StatusCode userExecute()
std::string m_selectedKey
const std::string & getInputKey()