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