BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RootCnvSvc/include/RootCnvSvc/RootCnvSvc.h
Go to the documentation of this file.
1#ifndef ROOTCNVSVC_H
2#define ROOTCNVSVC_H 1
3
4#include <map>
5
6#include "GaudiKernel/ConversionSvc.h"
7#include "GaudiKernel/DataObject.h"
8#include "Util.h"
9#include "commonData.h"
10
11#include "IRootCnvSvc.h"
12
13template <class TYPE> class SvcFactory;
14class RootInterface;
15class DigiCnv;
16class DstCnv;
17class EvtHeaderCnv;
18class EvtNavigatorCnv;
19class EventCnv;
20class McCnv;
21class RootEvtSelector;
22class RecTrackCnv;
23class EvtRecCnv; // zoujh
24class TrigCnv; // caogf
25class HltCnv; // fucd
26
27// static const InterfaceID IID_IRootCnvSvc( "IRootCnvSvc", 1, 0 );
28
29/** @class RootCnvSvc
30 * @brief Root Event Conversion Service which coordinates all of our converters.
31 *
32 * When a component requests an item not yet available on the TDS,
33 * the RootcnvSvc is called to find the appropriiate converter to gain
34 * access to the data and put it on the TDS.
35 * Based on SICb service written by Markus Frank.
36 * If an item is mentioned in the jobOptions as one to be written out, it
37 * will be converted from TDS to ROOT by the appropriate converter
38 *
39 * Based on the RootCnvSvc of GLast.
40 */
41
42// class RootCnvSvc : virtual public ConversionSvc {
43class RootCnvSvc : public extends<ConversionSvc, IRootCnvSvc> {
44 friend class SvcFactory<RootCnvSvc>;
45
46public:
47 /** @class Leaf
48 * @brief object regrouping CLID and pathname with treename/branchname
49 */
50 class Leaf : public std::vector<Leaf*> {
51 public:
52 std::string path;
53 std::string treename;
54 std::string branchname;
55 CLID clid;
56 Leaf( const std::string& p, const CLID& c, const std::string& tree,
57 const std::string& branch )
58 : path( p ), treename( tree ), branchname( branch ), clid( c ) {}
59
60 bool operator==( const Leaf& copy ) const {
61 return path == copy.path && treename == copy.treename && branchname == copy.branchname &&
62 clid == copy.clid;
63 }
64 };
65
66private:
67 /// Add converters to the service
68 StatusCode addConverters();
69
70 bool m_selectFromTag;
71 std::vector<std::string> m_tagInputFile;
72 // int m_tagFileFormat;
73
74 /// access to the RootInterface
75 RootInterface* m_rootInterface;
76 /// access to the EventSelector
77 RootEvtSelector* m_evtsel;
78 /// Map with leaf entries
79 typedef std::map<std::string, Leaf*> LeafMap;
80 LeafMap m_leaves;
81
82 /// properties
83 /// minimal split required
84 const int m_minSplit;
85
86 /// digi input filename
87 std::vector<std::string> m_difileName;
88 // std::string m_difileName;
89 /// digi output filename
90 std::string m_dofileName;
91
92 /// digi split mode
93 int m_dsplitMode;
94
95 /// buffer size for digi file
96 int m_dbufSize;
97
98 /// compression level for digix file
99 int m_dcompressionLevel;
100
101 /// digi treename
102 std::string m_dtreeName;
103
104 /// a switch for ETS data
105 bool m_readETS;
106
107 /// pointers to top converters
108 DigiCnv* m_dCnv;
109 DstCnv* m_dstCnv;
110 McCnv* m_mcCnv;
111 TrigCnv* m_trigCnv; // caogf
112 HltCnv* m_hltCnv; // fucd
113 EvtRecCnv* m_evtRecCnv; // zoujh
114
115 RecTrackCnv* m_rectrackCnv; //*********liangyt
116 EvtHeaderCnv* m_evtheaderCnv;
117 EvtNavigatorCnv* m_evtnavigatorCnv;
118 EventCnv* m_eventCnv;
119
120 /// relational maps to be cleared
121 commonData m_common;
122
123 StatusCode initFiles();
124
125public:
126 RootInterface* getRootInterface() { return m_rootInterface; }
127
128 virtual StatusCode initialize();
129
130 virtual StatusCode finalize();
131
132 virtual StatusCode updateServiceState( IOpaqueAddress* pAddress );
133
134 /// Override inherited queryInterface due to enhanced interface
135 // virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface );
136
137 /// Associates a path on TDS with a particular converter
138 virtual StatusCode declareObject( const Leaf& leaf );
139
140 /// Commit pending output (fill the TTrees).
141 virtual StatusCode commitOutput( const std::string& output, bool do_commit );
142
143 /// create address containing ROOT treename, branchname, entry number
144 virtual StatusCode createAddress( long int svc_type, const CLID& clid,
145 const std::string* par, const unsigned long* ip,
146 IOpaqueAddress*& refpAddress );
147
148 virtual StatusCode createAddress( DataObject* obj, IOpaqueAddress*& refpAddress );
149 virtual StatusCode createAddress( std::string path, IOpaqueAddress*& refpAddress );
150
151 IConverter* createConverter( long typ, const CLID& wanted, const ICnvFactory* fac ) override;
152
153 DigiCnv* getDigiCnv() { return m_dCnv; }
154 DstCnv* getDstCnv() { return m_dstCnv; }
155 McCnv* getMcCnv() { return m_mcCnv; }
156 TrigCnv* getTrigCnv() { return m_trigCnv; } // caogf
157 HltCnv* getHltCnv() { return m_hltCnv; } // fucd
158 EvtRecCnv* getEvtRecCnv() { return m_evtRecCnv; } // zoujh
159
160 void setDigiCnv( DigiCnv* reccnv ) { m_dCnv = reccnv; }
161 void setDstCnv( DstCnv* dstcnv ) { m_dstCnv = dstcnv; }
162 void setMcCnv( McCnv* mccnv ) { m_mcCnv = mccnv; }
163 void setTrigCnv( TrigCnv* trigcnv ) { m_trigCnv = trigcnv; } // caogf
164 void setHltCnv( HltCnv* hltcnv ) { m_hltCnv = hltcnv; } // fucd
165 void setEvtRecCnv( EvtRecCnv* evtreccnv ) { m_evtRecCnv = evtreccnv; } // zoujh
166 void setRecTrackCnv( RecTrackCnv* rectrackcnv ) { m_rectrackCnv = rectrackcnv; }
167 void setEvtHeaderCnv( EvtHeaderCnv* evtheadercnv ) { m_evtheaderCnv = evtheadercnv; }
168 void setEvtNavigatorCnv( EvtNavigatorCnv* evtnavigatorcnv ) {
169 m_evtnavigatorCnv = evtnavigatorcnv;
170 }
171 void setEventCnv( EventCnv* eventCnv ) { m_eventCnv = eventCnv; }
172
173 RecTrackCnv* getRecTrackCnv() { return m_rectrackCnv; } //*******liangyt
174 EvtHeaderCnv* getEvtHeaderCnv() { return m_evtheaderCnv; }
175 EvtNavigatorCnv* getEvtNavigatorCnv() { return m_evtnavigatorCnv; }
176 EventCnv* getEventCnv() { return m_eventCnv; }
177
178public:
179 RootCnvSvc( const std::string& name, ISvcLocator* svc );
180
181 virtual ~RootCnvSvc(){};
182};
183
184#endif // ROOTCNVSVC_H
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per saves r n generator level $ !Flag for chat level in output
Definition FoamA.h:89
Concrete converter for the Rec branch.
Concrete converter for the Dst branch.
Concrete converter for the Event header stored in the TDS /Event Based on the EventCnv of GLAST.
Concrete converter for the EvtHeader branch.
Concrete converter for the EvtNavigator branch.
Concrete converter for the Rec branch.
Concrete converter for the Mc branch.
Leaf(const std::string &p, const CLID &c, const std::string &tree, const std::string &branch)
virtual StatusCode createAddress(long int svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
create address containing ROOT treename, branchname, entry number
void setEvtNavigatorCnv(EvtNavigatorCnv *evtnavigatorcnv)
virtual StatusCode initialize()
void setRecTrackCnv(RecTrackCnv *rectrackcnv)
void setEvtHeaderCnv(EvtHeaderCnv *evtheadercnv)
virtual StatusCode updateServiceState(IOpaqueAddress *pAddress)
Update state of the service.
virtual StatusCode commitOutput(const std::string &output, bool do_commit)
Commit pending output (fill the TTrees).
IConverter * createConverter(long typ, const CLID &wanted, const ICnvFactory *fac) override
RootCnvSvc(const std::string &name, ISvcLocator *svc)
virtual StatusCode declareObject(const Leaf &leaf)
Override inherited queryInterface due to enhanced interface.
virtual StatusCode finalize()
RootEvtSelector performs the function of controlling the ApplicationMgr loop.
Forward and external declarations.
Concrete converter for the Rec branch.