BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
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
40//class RootCnvSvc : virtual public ConversionSvc {
41class GAUDI_API RootCnvSvc : virtual public ConversionSvc {
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 /// 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
127 RootInterface * getRootInterface() {return m_rootInterface;}
128
129 virtual StatusCode initialize();
130
131 virtual StatusCode finalize();
132
133 virtual StatusCode updateServiceState(IOpaqueAddress* pAddress);
134
135 /// Override inherited queryInterface due to enhanced interface
136 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
137
138 /// Associates a path on TDS with a particular converter
139 virtual StatusCode declareObject(const Leaf& leaf);
140
141 /// Commit pending output (fill the TTrees).
142 virtual StatusCode commitOutput(const std::string& output, bool do_commit);
143
144 /// create address containing ROOT treename, branchname, entry number
145 virtual StatusCode createAddress( long int svc_type,
146 const CLID& clid,
147 const std::string* par,
148 const unsigned long* ip,
149 IOpaqueAddress*& refpAddress);
150
151 virtual StatusCode createAddress(DataObject *obj, IOpaqueAddress*& refpAddress);
152 virtual StatusCode createAddress(std::string path, IOpaqueAddress*& refpAddress);
153
154 DigiCnv *getDigiCnv() {return m_dCnv;}
155 DstCnv *getDstCnv() {return m_dstCnv;}
156 McCnv *getMcCnv() {return m_mcCnv;}
157 TrigCnv *getTrigCnv() { return m_trigCnv; } //caogf
158 HltCnv *getHltCnv() { return m_hltCnv; } //fucd
159 EvtRecCnv *getEvtRecCnv() { return m_evtRecCnv; } //zoujh
160
161 void setDigiCnv(DigiCnv *reccnv){m_dCnv=reccnv;}
162 void setDstCnv(DstCnv *dstcnv){m_dstCnv=dstcnv;}
163 void setMcCnv (McCnv *mccnv) {m_mcCnv=mccnv;}
164 void setTrigCnv (TrigCnv *trigcnv) { m_trigCnv = trigcnv; } //caogf
165 void setHltCnv (HltCnv *hltcnv) { m_hltCnv = hltcnv; } //fucd
166 void setEvtRecCnv (EvtRecCnv *evtreccnv) { m_evtRecCnv = evtreccnv; } //zoujh
167 void setRecTrackCnv (RecTrackCnv *rectrackcnv) {m_rectrackCnv=rectrackcnv;}
168 void setEvtHeaderCnv (EvtHeaderCnv *evtheadercnv){m_evtheaderCnv=evtheadercnv;}
169 void setEvtNavigatorCnv (EvtNavigatorCnv *evtnavigatorcnv){m_evtnavigatorCnv=evtnavigatorcnv;}
170 void setEventCnv(EventCnv* eventCnv){m_eventCnv=eventCnv;}
171
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//protected:
178public:
179
180 RootCnvSvc(const std::string& name, ISvcLocator* svc);
181
182 virtual ~RootCnvSvc() { };
183
184
185};
186
187#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.
Definition: DigiCnv.h:20
Concrete converter for the Dst branch.
Definition: DstCnv.h:20
Concrete converter for the Event header stored in the TDS /Event Based on the EventCnv of GLAST.
Definition: EventCnv.h:21
Concrete converter for the EvtHeader branch.
Definition: EvtHeaderCnv.h:21
Concrete converter for the EvtNavigator branch.
Concrete converter for the Rec branch.
Definition: HltCnv.h:20
Concrete converter for the Mc branch.
Definition: McCnv.h:20
object regrouping CLID and pathname with treename/branchname
Definition: RootCnvSvc.h:48
std::string path
Definition: RootCnvSvc.h:50
bool operator==(const Leaf &copy) const
Definition: RootCnvSvc.h:57
std::string treename
Definition: RootCnvSvc.h:51
Leaf(const std::string &p, const CLID &c, const std::string &tree, const std::string &branch)
Definition: RootCnvSvc.h:54
std::string branchname
Definition: RootCnvSvc.h:52
Root Event Conversion Service which coordinates all of our converters.
Definition: RootCnvSvc.h:41
virtual ~RootCnvSvc()
Definition: RootCnvSvc.h:182
HltCnv * getHltCnv()
Definition: RootCnvSvc.h:158
void setEvtNavigatorCnv(EvtNavigatorCnv *evtnavigatorcnv)
Definition: RootCnvSvc.h:169
void setRecTrackCnv(RecTrackCnv *rectrackcnv)
Definition: RootCnvSvc.h:167
void setDstCnv(DstCnv *dstcnv)
Definition: RootCnvSvc.h:162
void setEvtHeaderCnv(EvtHeaderCnv *evtheadercnv)
Definition: RootCnvSvc.h:168
void setDigiCnv(DigiCnv *reccnv)
Definition: RootCnvSvc.h:161
void setHltCnv(HltCnv *hltcnv)
Definition: RootCnvSvc.h:165
RootInterface * getRootInterface()
Definition: RootCnvSvc.h:127
DigiCnv * getDigiCnv()
Definition: RootCnvSvc.h:154
McCnv * getMcCnv()
Definition: RootCnvSvc.h:156
EventCnv * getEventCnv()
Definition: RootCnvSvc.h:176
void setTrigCnv(TrigCnv *trigcnv)
Definition: RootCnvSvc.h:164
RecTrackCnv * getRecTrackCnv()
Definition: RootCnvSvc.h:173
DstCnv * getDstCnv()
Definition: RootCnvSvc.h:155
EvtHeaderCnv * getEvtHeaderCnv()
Definition: RootCnvSvc.h:174
void setMcCnv(McCnv *mccnv)
Definition: RootCnvSvc.h:163
EvtNavigatorCnv * getEvtNavigatorCnv()
Definition: RootCnvSvc.h:175
void setEvtRecCnv(EvtRecCnv *evtreccnv)
Definition: RootCnvSvc.h:166
TrigCnv * getTrigCnv()
Definition: RootCnvSvc.h:157
EvtRecCnv * getEvtRecCnv()
Definition: RootCnvSvc.h:159
void setEventCnv(EventCnv *eventCnv)
Definition: RootCnvSvc.h:170
RootEvtSelector performs the function of controlling the ApplicationMgr loop.
Forward and external declarations.
Definition: CalibDataSvc.h:35
Concrete converter for the Rec branch.
Definition: TrigCnv.h:20