BOSS
7.0.7
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/SmartDataPtr.h"
10
#include "GaudiKernel/DataSvc.h"
11
12
static
const
AlgFactory<PurgeUnstableParticles>
Factory;
13
const
IAlgFactory&
PurgeUnstableParticlesFactory
= Factory;
14
15
PurgeUnstableParticles::PurgeUnstableParticles
16
(
const
std::string& name, ISvcLocator* pSvcLocator) :
17
Algorithm(name, pSvcLocator) {}
18
19
20
StatusCode
PurgeUnstableParticles::initialize
(){
21
22
IDataManagerSvc* m_DMS;
23
StatusCode sc = serviceLocator()->getService(
"EventDataSvc"
,
24
IID_IDataManagerSvc,
25
(IInterface*&)m_DMS);
26
if
(sc.isFailure()) {
return
sc; }
27
28
std::string rootEventName = m_DMS->rootEventName();
29
m_mcEventColl = rootEventName +
"/McEventCollection"
;
30
31
return
StatusCode::SUCCESS;
32
33
}
34
35
StatusCode
PurgeUnstableParticles::execute
(){
36
37
SmartDataPtr<McEventCollection> mcCollptr(eventDataService(),
38
m_mcEventColl);
39
if
(mcCollptr) {
40
McEventCollection::iterator it;
41
for
(it=mcCollptr->begin(); it!=mcCollptr->end(); it++) {
42
(*it)->purgeUnstableParticles();
43
44
}
45
}
46
47
return
StatusCode::SUCCESS;
48
49
}
50
51
StatusCode
PurgeUnstableParticles::finalize
(){
52
53
return
StatusCode::SUCCESS;
54
55
}
PurgeUnstableParticlesFactory
const IAlgFactory & PurgeUnstableParticlesFactory
Definition:
PurgeUnstableParticles.cxx:13
PurgeUnstableParticles.h
AlgFactory
Definition:
G4SimEvent.h:21
PurgeUnstableParticles::PurgeUnstableParticles
PurgeUnstableParticles(const std::string &name, ISvcLocator *pSvcLocator)
Definition:
PurgeUnstableParticles.cxx:16
PurgeUnstableParticles::finalize
StatusCode finalize()
Definition:
PurgeUnstableParticles.cxx:51
PurgeUnstableParticles::execute
StatusCode execute()
Definition:
PurgeUnstableParticles.cxx:35
PurgeUnstableParticles::initialize
StatusCode initialize()
Definition:
PurgeUnstableParticles.cxx:20
source
Generator
GeneratorModule
GeneratorModule-00-01-05
src
PurgeUnstableParticles.cxx
Generated by
1.9.6