CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
RootEvtSelector.h
Go to the documentation of this file.
1#ifndef ROOTEVTSELECTOR_H
2#define ROOTEVTSELECTOR_H 1
3
4#include "GaudiKernel/IEvtSelector.h"
5#include "GaudiKernel/ISvcLocator.h"
6#include "GaudiKernel/Service.h"
7
8class IAddressCreator;
9class IDataProviderSvc;
10class RootInterface;
12
13static const InterfaceID IID_IRootEvtSelector("IRootEvtSelector", 1, 0);
14
15/** @class RootEvtSelector
16* @brief RootEvtSelector performs the function of controlling the
17* ApplicationMgr loop.
18*
19* Adapted to RootCnvSvc from GlastSvc/EventSelector.
20* The input property can now be set either to NONE or to ROOT.
21* If it is NONE, the loop
22* will run until it hits EvtMax. A new class variable was added :m_evtMax
23* which is a local copy of the AppMgrs property.
24*
25* $Header: /bes/bes/CgemBossCvs/Event/RootCnvSvc/RootCnvSvc/RootEvtSelector.h,v 1.1.1.1 2013/11/22 02:06:44 juxd Exp $
26*/
27class RootEvtSelector : virtual public Service,
28 virtual public IEvtSelector,
29 virtual public IProperty {
30public:
31 // constructor and destructor
32 RootEvtSelector( const std::string& name, ISvcLocator* svcloc );
34
35 // IEvtSelector implementation
36 virtual StatusCode initialize();
37
38 // Implementation of the IEvtSelector interface methods.
39 virtual StatusCode createContext(Context*& it) const;
40 StatusCode next() const;
41 virtual StatusCode next(Context& it) const;
42 virtual StatusCode next(Context& it, int jump) const;
43 virtual StatusCode previous(Context& it) const;
44 virtual StatusCode previous(Context& it, int jump) const;
45
46 virtual StatusCode last(Context& it) const;
47 virtual StatusCode rewind(Context& it) const;
48
49 virtual StatusCode createAddress(const Context& it,IOpaqueAddress*& iop) const;
50 virtual StatusCode releaseContext(Context*& it) const;
51 virtual StatusCode resetCriteria(const std::string& criteria, Context& context) const;
52
53 virtual StatusCode setCriteria( const std::string& criteria );
54
55 // IInterface implementation
56 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
57
58 // int IEvtSelector::getrecId();
59 int getRecId() const { return (*m_recId); }
60
61private:
62 enum CriteriaType {
63 ROOT, //When the input is a ROOT file
64 NONE //When there is no input
65 };
66
67 // Used internally to get the MaxEvent from the ApplicationMgr
68 StatusCode getMaxEvent();
69
70 RootEventContext* p_beginContext;
71 RootEventContext* p_endContext;
72
73 std::string m_criteria;
74 StringProperty m_jobInput;
75 CriteriaType m_criteriaType;
76
77 // pointer to RootInterface
78 RootInterface* m_rootInterface;
79
80 // pointer to AddressCreator
81 IAddressCreator* m_addrCreator;
82
83 // CLID of root basic object
84 CLID m_rootCLID;
85
86 /// max nr of events to be treated
87 int m_evtMax;
88
89 /// counts number of event
90 int* m_recId;
91};
92
93#endif // RootEvtSelector_H
This class provides the Context for RootEventSelector.
RootEvtSelector performs the function of controlling the ApplicationMgr loop.
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
virtual StatusCode setCriteria(const std::string &criteria)
virtual StatusCode previous(Context &it, int jump) const
virtual StatusCode createContext(Context *&it) const
StatusCode next() const
virtual StatusCode initialize()
virtual StatusCode next(Context &it, int jump) const
virtual StatusCode createAddress(const Context &it, IOpaqueAddress *&iop) const
virtual StatusCode rewind(Context &it) const
virtual StatusCode previous(Context &it) const
virtual StatusCode resetCriteria(const std::string &criteria, Context &context) const
virtual StatusCode releaseContext(Context *&it) const
int getRecId() const
virtual StatusCode next(Context &it) const
virtual StatusCode last(Context &it) const
RootEvtSelector(const std::string &name, ISvcLocator *svcloc)