BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RootCnvSvc/RootCnvSvc-02-01-13/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 bool m_selectFromTag;
70 std::vector<std::string> m_tagInputFile;
71 //int m_tagFileFormat;
72
73 /// access to the RootInterface
74 RootInterface* m_rootInterface;
75 /// access to the EventSelector
76 RootEvtSelector* m_evtsel;
77 /// Map with leaf entries
78 typedef std::map<std::string, Leaf*> LeafMap;
79 LeafMap m_leaves;
80
81 /// properties
82 /// minimal split required
83 const int m_minSplit;
84
85 /// digi input filename
86 std::vector<std::string> m_difileName;
87 // std::string m_difileName;
88 /// digi output filename
89 std::string m_dofileName;
90
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 /// pointers to top converters
105 DigiCnv *m_dCnv;
106 DstCnv *m_dstCnv;
107 McCnv *m_mcCnv;
108 TrigCnv *m_trigCnv; //caogf
109 HltCnv *m_hltCnv; //fucd
110 EvtRecCnv *m_evtRecCnv; //zoujh
111
112 RecTrackCnv *m_rectrackCnv; //*********liangyt
113 EvtHeaderCnv *m_evtheaderCnv;
114 EvtNavigatorCnv *m_evtnavigatorCnv;
115 EventCnv *m_eventCnv;
116
117 /// relational maps to be cleared
118 commonData m_common;
119
120 StatusCode initFiles();
121
122public:
123
124 RootInterface * getRootInterface() {return m_rootInterface;}
125
126 virtual StatusCode initialize();
127
128 virtual StatusCode finalize();
129
130 virtual StatusCode updateServiceState(IOpaqueAddress* pAddress);
131
132 /// Override inherited queryInterface due to enhanced interface
133 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
134
135 /// Associates a path on TDS with a particular converter
136 virtual StatusCode declareObject(const Leaf& leaf);
137
138 /// Commit pending output (fill the TTrees).
139 virtual StatusCode commitOutput(const std::string& output, bool do_commit);
140
141 /// create address containing ROOT treename, branchname, entry number
142 virtual StatusCode createAddress( long int svc_type,
143 const CLID& clid,
144 const std::string* par,
145 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 DigiCnv *getDigiCnv() {return m_dCnv;}
152 DstCnv *getDstCnv() {return m_dstCnv;}
153 McCnv *getMcCnv() {return m_mcCnv;}
154 TrigCnv *getTrigCnv() { return m_trigCnv; } //caogf
155 HltCnv *getHltCnv() { return m_hltCnv; } //fucd
156 EvtRecCnv *getEvtRecCnv() { return m_evtRecCnv; } //zoujh
157
158 void setDigiCnv(DigiCnv *reccnv){m_dCnv=reccnv;}
159 void setDstCnv(DstCnv *dstcnv){m_dstCnv=dstcnv;}
160 void setMcCnv (McCnv *mccnv) {m_mcCnv=mccnv;}
161 void setTrigCnv (TrigCnv *trigcnv) { m_trigCnv = trigcnv; } //caogf
162 void setHltCnv (HltCnv *hltcnv) { m_hltCnv = hltcnv; } //fucd
163 void setEvtRecCnv (EvtRecCnv *evtreccnv) { m_evtRecCnv = evtreccnv; } //zoujh
164 void setRecTrackCnv (RecTrackCnv *rectrackcnv) {m_rectrackCnv=rectrackcnv;}
165 void setEvtHeaderCnv (EvtHeaderCnv *evtheadercnv){m_evtheaderCnv=evtheadercnv;}
166 void setEvtNavigatorCnv (EvtNavigatorCnv *evtnavigatorcnv){m_evtnavigatorCnv=evtnavigatorcnv;}
167 void setEventCnv(EventCnv* eventCnv){m_eventCnv=eventCnv;}
168
169
170 RecTrackCnv *getRecTrackCnv() {return m_rectrackCnv;} //*******liangyt
171 EvtHeaderCnv *getEvtHeaderCnv(){return m_evtheaderCnv;}
172 EvtNavigatorCnv *getEvtNavigatorCnv(){return m_evtnavigatorCnv;}
173 EventCnv *getEventCnv(){return m_eventCnv;}
174protected:
175
176
177 RootCnvSvc(const std::string& name, ISvcLocator* svc);
178
179 virtual ~RootCnvSvc() { };
180
181
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
const InterfaceID IID_IRootCnvSvc
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.
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 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
Definition: RootCnvSvc.cxx:372
void setEvtNavigatorCnv(EvtNavigatorCnv *evtnavigatorcnv)
virtual StatusCode initialize()
Definition: RootCnvSvc.cxx:143
virtual StatusCode updateServiceState(IOpaqueAddress *pAddress)
Update state of the service.
Definition: RootCnvSvc.cxx:312
virtual StatusCode commitOutput(const std::string &output, bool do_commit)
Commit pending output (fill the TTrees).
Definition: RootCnvSvc.cxx:397
virtual StatusCode declareObject(const Leaf &leaf)
Associates a path on TDS with a particular converter.
Definition: RootCnvSvc.cxx:297
virtual StatusCode finalize()
Definition: RootCnvSvc.cxx:198
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
Override inherited queryInterface due to enhanced interface.
Definition: RootCnvSvc.cxx:359
RootEvtSelector performs the function of controlling the ApplicationMgr loop.
Concrete converter for the Rec branch.