BOSS 7.0.9
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
8
9class IAddressCreator;
10class IDataProviderSvc;
11class RootInterface;
13class TagFilterSvc;
14
15static const InterfaceID IID_IRootEvtSelector("IRootEvtSelector", 1, 0);
16
17/** @class RootEvtSelector
18* @brief RootEvtSelector performs the function of controlling the
19* ApplicationMgr loop.
20*
21* Adapted to RootCnvSvc from GlastSvc/EventSelector.
22* The input property can now be set either to NONE or to ROOT.
23* If it is NONE, the loop
24* will run until it hits EvtMax. A new class variable was added :m_evtMax
25* which is a local copy of the AppMgrs property.
26*
27* $Header: /bes/bes/BossCvs/Event/RootCnvSvc/RootCnvSvc/RootEvtSelector.h,v 1.16 2019/03/21 04:33:15 dengzy Exp $
28*/
29class RootEvtSelector : virtual public Service,
30 virtual public IEvtSelector,
31 virtual public IProperty {
32public:
33 // constructor and destructor
34 RootEvtSelector( const std::string& name, ISvcLocator* svcloc );
36
37 // IEvtSelector implementation
38 virtual StatusCode initialize();
39
40 // Implementation of the IEvtSelector interface methods.
41 virtual StatusCode createContext(Context*& it) const;
42 StatusCode next() const;
43 virtual StatusCode next(Context& it) const;
44 virtual StatusCode next(Context& it, int jump) const;
45 virtual StatusCode previous(Context& it) const;
46 virtual StatusCode previous(Context& it, int jump) const;
47
48 virtual StatusCode last(Context& it) const;
49 virtual StatusCode rewind(Context& it) const;
50
51 virtual StatusCode createAddress(const Context& it,IOpaqueAddress*& iop) const;
52 virtual StatusCode releaseContext(Context*& it) const;
53 virtual StatusCode resetCriteria(const std::string& criteria, Context& context) const;
54
55 virtual StatusCode setCriteria( const std::string& criteria );
56
57 // IInterface implementation
58 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
59
60 // int IEvtSelector::getrecId();
61 int getRecId() const { return (*m_recId); }
62
63 void getEntryFromTag() const ;
64
65
66private:
67 enum CriteriaType {
68 ROOT, //When the input is a ROOT file
69 NONE //When there is no input
70 };
71
72 // Used internally to get the MaxEvent from the ApplicationMgr
73 StatusCode getMaxEvent();
74
75 RootEventContext* p_beginContext;
76 RootEventContext* p_endContext;
77
78 std::string m_criteria;
79 StringProperty m_jobInput;
80 CriteriaType m_criteriaType;
81
82 // pointer to RootInterface
83 RootInterface* m_rootInterface;
84
85 // pointer to AddressCreator
86 IAddressCreator* m_addrCreator;
87
88 // CLID of root basic object
89 CLID m_rootCLID;
90
91 /// max nr of events to be treated
92 int m_evtMax;
93
94 /// counts number of event
95 int* m_recId;
96
97 TagFilterSvc* m_tagFilterSvc;
98};
99
100#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
void getEntryFromTag() 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