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
12
static
const
AlgFactory<PurgeUnstableParticles>
Factory;
13
const
IAlgFactory&
PurgeUnstableParticlesFactory
= Factory;
14
15
PurgeUnstableParticles::PurgeUnstableParticles
(
const
std::string& name,
16
ISvcLocator* pSvcLocator )
17
: Algorithm( name, pSvcLocator ) {}
18
19
StatusCode
PurgeUnstableParticles::initialize
() {
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
32
StatusCode
PurgeUnstableParticles::execute
() {
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
45
StatusCode
PurgeUnstableParticles::finalize
() {
return
StatusCode::SUCCESS; }
PurgeUnstableParticlesFactory
const IAlgFactory & PurgeUnstableParticlesFactory
Definition
PurgeUnstableParticles.cxx:13
AlgFactory
Definition
G4SimEvent.h:21
PurgeUnstableParticles::PurgeUnstableParticles
PurgeUnstableParticles(const std::string &name, ISvcLocator *pSvcLocator)
Definition
PurgeUnstableParticles.cxx:15
PurgeUnstableParticles::finalize
StatusCode finalize()
Definition
PurgeUnstableParticles.cxx:45
PurgeUnstableParticles::execute
StatusCode execute()
Definition
PurgeUnstableParticles.cxx:32
PurgeUnstableParticles::initialize
StatusCode initialize()
Definition
PurgeUnstableParticles.cxx:19
8.0.0
BOSS_Gen
GeneratorModule
src
PurgeUnstableParticles.cxx
Generated by
1.16.1