BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
PurgeUnstableParticles.cxx
Go to the documentation of this file.
1#include "GeneratorModule/PurgeUnstableParticles.h"
2#include "GeneratorObjects/McEventCollection.h"
3
4#include "GaudiKernel/AlgFactory.h"
5#include "GaudiKernel/ISvcLocator.h"
6
7#include "GaudiKernel/IDataManagerSvc.h"
8
9#include "GaudiKernel/DataSvc.h"
10#include "GaudiKernel/SmartDataPtr.h"
11
12static const AlgFactory<PurgeUnstableParticles> Factory;
13const IAlgFactory& PurgeUnstableParticlesFactory = Factory;
14
16 ISvcLocator* pSvcLocator )
17 : Algorithm( name, pSvcLocator ) {}
18
20
21 IDataManagerSvc* m_DMS;
22 StatusCode sc =
23 serviceLocator()->getService( "EventDataSvc", IID_IDataManagerSvc, (IInterface*&)m_DMS );
24 if ( sc.isFailure() ) { return sc; }
25
26 std::string rootEventName = m_DMS->rootEventName();
27 m_mcEventColl = rootEventName + "/McEventCollection";
28
29 return StatusCode::SUCCESS;
30}
31
33
34 SmartDataPtr<McEventCollection> mcCollptr( eventDataService(), m_mcEventColl );
35 if ( mcCollptr )
36 {
37 McEventCollection::iterator it;
38 for ( it = mcCollptr->begin(); it != mcCollptr->end(); it++ )
39 { ( *it )->purgeUnstableParticles(); }
40 }
41
42 return StatusCode::SUCCESS;
43}
44
45StatusCode PurgeUnstableParticles::finalize() { return StatusCode::SUCCESS; }
const IAlgFactory & PurgeUnstableParticlesFactory
PurgeUnstableParticles(const std::string &name, ISvcLocator *pSvcLocator)