ATLAS Offline Software
FilterUsingSpacePoints.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include <sstream>
9 
10 /****
11  * simple filter for splash events based on MBTS multiplicites
12  * @author: Brian Thomas Martin
13  ****/
14 
15  FilterUsingSpacePoints::FilterUsingSpacePoints(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator)
16 {
17  declareProperty("NumberOfSpacePoints", m_SpacePoints_required=4);
18  declareProperty("SpacePointContainer", m_SpacePointContainerName="SCT_SpacePoints");
19 }
20 
22 {
23  ATH_MSG_INFO( "Initializing " << name() );
24  return StatusCode::SUCCESS;
25 }
26 
28 {
29  //Get the space point container
30  const SpacePointContainer* spacePointContainer;
31 
32  ATH_CHECK( evtStore()->retrieve(spacePointContainer, m_SpacePointContainerName) );
33 
34  unsigned long NSpacePoints = 0;
35 
36  //Get an iterator over the SpacePoint container itself
37  SpacePointContainer::const_iterator SpacePointCollItr = spacePointContainer->begin();
38  for (; SpacePointCollItr!= spacePointContainer->end(); ++SpacePointCollItr)
39  NSpacePoints += (**SpacePointCollItr).size();
40 
41 
42  //be verbose
43  ATH_MSG_DEBUG( "Number of SpacePoints is " << NSpacePoints );
44 
45  //And cut
46  if (NSpacePoints >= m_SpacePoints_required) {
47  setFilterPassed(true);
48  ATH_MSG_INFO( "Event is accepted" );
49  } else {
50  setFilterPassed(false);
51  ATH_MSG_INFO( "Event is rejected" );
52  }
53 
54  return StatusCode::SUCCESS;
55 }
56 
58 {
59  return StatusCode::SUCCESS;
60 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
FilterUsingSpacePoints::execute
StatusCode execute()
Definition: FilterUsingSpacePoints.cxx:27
FilterUsingSpacePoints::finalize
StatusCode finalize()
Definition: FilterUsingSpacePoints.cxx:57
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
FilterUsingSpacePoints::initialize
StatusCode initialize()
Definition: FilterUsingSpacePoints.cxx:21
FilterUsingSpacePoints::m_SpacePointContainerName
std::string m_SpacePointContainerName
Definition: FilterUsingSpacePoints.h:21
SpacePointContainer.h
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
FilterUsingSpacePoints.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:242
FilterUsingSpacePoints::FilterUsingSpacePoints
FilterUsingSpacePoints(const std::string &name, ISvcLocator *pSvcLocator)
Definition: FilterUsingSpacePoints.cxx:15
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:82
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:236
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FilterUsingSpacePoints::m_SpacePoints_required
unsigned int m_SpacePoints_required
Definition: FilterUsingSpacePoints.h:20
SpacePointContainer
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePointContainer.h:29