CGEM BOSS 6.6.5.f
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
12static const AlgFactory<PurgeUnstableParticles> Factory;
13const IAlgFactory& PurgeUnstableParticlesFactory = Factory;
14
16 (const std::string& name, ISvcLocator* pSvcLocator) :
17 Algorithm(name, pSvcLocator) {}
18
19
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
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
52
53 return StatusCode::SUCCESS;
54
55}
const IAlgFactory & PurgeUnstableParticlesFactory
PurgeUnstableParticles(const std::string &name, ISvcLocator *pSvcLocator)