BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RootCnvSvc/include/RootCnvSvc/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#include "TagFilterSvc/ITagFilterSvc.h"
9
10class IAddressCreator;
11class IDataProviderSvc;
12class RootInterface;
14// class TagFilterSvc;
15
16static const InterfaceID IID_IRootEvtSelector( "IRootEvtSelector", 1, 0 );
17
18/** @class RootEvtSelector
19 * @brief RootEvtSelector performs the function of controlling the
20 * ApplicationMgr loop.
21 *
22 * Adapted to RootCnvSvc from GlastSvc/EventSelector.
23 * The input property can now be set either to NONE or to ROOT.
24 * If it is NONE, the loop
25 * will run until it hits EvtMax. A new class variable was added :m_evtMax
26 * which is a local copy of the AppMgrs property.
27 *
28 * $Header: /bes/bes/BossCvs/Event/RootCnvSvc/RootCnvSvc/RootEvtSelector.h,v 1.17 2022/01/24
29 * 04:07:17 maqm Exp $
30 */
31class GAUDI_API RootEvtSelector : public extends<Service, IEvtSelector>,
32 virtual public IProperty {
33public:
34 // constructor and destructor
35 RootEvtSelector( const std::string& name, ISvcLocator* svcloc );
37
38 // IEvtSelector implementation
39 virtual StatusCode initialize();
40
41 // Implementation of the IEvtSelector interface methods.
42 virtual StatusCode createContext( Context*& it ) const;
43 StatusCode next() const;
44 virtual StatusCode next( Context& it ) const;
45 virtual StatusCode next( Context& it, int jump ) const;
46 virtual StatusCode previous( Context& it ) const;
47 virtual StatusCode previous( Context& it, int jump ) const;
48
49 virtual StatusCode last( Context& it ) const;
50 virtual StatusCode rewind( Context& it ) const;
51
52 virtual StatusCode createAddress( const Context& it, IOpaqueAddress*& iop ) const;
53 virtual StatusCode releaseContext( Context*& it ) const;
54 virtual StatusCode resetCriteria( const std::string& criteria, Context& context ) const;
55
56 virtual StatusCode setCriteria( const std::string& criteria );
57
58 // IInterface implementation
59 virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface );
60
61 // int IEvtSelector::getrecId();
62 int getRecId() const { return ( *m_recId ); }
63
64 void getEntryFromTag() const;
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 ITagFilterSvc* m_tagFilterSvc;
98};
99
100#endif // RootEvtSelector_H
This class provides the Context for RootEventSelector.
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 rewind(Context &it) const
virtual StatusCode resetCriteria(const std::string &criteria, Context &context) const
StatusCode next() const
virtual StatusCode initialize()
virtual StatusCode last(Context &it) const
virtual StatusCode releaseContext(Context *&it) const
virtual StatusCode next(Context &it, int jump) const
virtual StatusCode previous(Context &it) const
virtual StatusCode next(Context &it) const
virtual StatusCode createContext(Context *&it) const
virtual StatusCode createAddress(const Context &it, IOpaqueAddress *&iop) const
RootEvtSelector(const std::string &name, ISvcLocator *svcloc)