BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/BesVisAlg/BesVisAlg/BesVisAlg.h
Go to the documentation of this file.
1#ifndef BESVISALG_H_
2#define BESVISALG_H_
3
4// something needed by Gaudi
5#include "GaudiKernel/Algorithm.h"
6#include "GaudiKernel/MsgStream.h"
7#include "GaudiKernel/AlgFactory.h"
8#include "GaudiKernel/ISvcLocator.h"
9#include "GaudiKernel/SmartDataPtr.h"
10#include "GaudiKernel/IDataProviderSvc.h"
11#include "GaudiKernel/PropertyMgr.h"
12#include "GaudiKernel/Tokenizer.h"
13#include "GaudiKernel/IRegistry.h"
14#include "GaudiKernel/IAlgManager.h"
15#include "GaudiKernel/IConversionSvc.h"
16#include "GaudiKernel/IDataManagerSvc.h"
17#include "GaudiKernel/IPersistencySvc.h"
18#include "GaudiKernel/IOpaqueAddress.h"
19#include "GaudiKernel/IDataStoreAgent.h"
20#include "GaudiKernel/strcasecmp.h"
21#include "GaudiKernel/DataObject.h"
22#include "GaudiKernel/DataStoreItem.h"
23
24
25// something needed by semaphore
26#include <stdio.h>
27#include <unistd.h>
28#include <stdlib.h>
29#include <sys/types.h>
30#include <sys/ipc.h>
31#include <sys/sem.h>
32#include <wait.h>
33
34// something needed by root: standard root libraies
35#include <TObject.h>
36#include <TList.h>
37#include <TRootEmbeddedCanvas.h>
38#include <TTimer.h>
39#include <TApplication.h>
40#include <TInterpreter.h>
41#include <TBranch.h>
42#include <TFile.h>
43#include <TTree.h>
44#include <TSystem.h>
45#include <TGeoManager.h>
46#include <TGButton.h>
47#include <TGMenu.h>
48#include <TGLayout.h>
49#include <TGStatusBar.h>
50#include <TGFileDialog.h>
51#include <TGNumberEntry.h>
52#include <TGMsgBox.h>
53#include <TGProgressBar.h>
54#include <TGTab.h>
55#include <TGSplitter.h>
56#include <TGCanvas.h>
57#include <TSystem.h>
58#include <TGListTree.h>
59#include <TGLabel.h>
60#include <TGButtonGroup.h>
61#include <TGTextEntry.h>
62#include <TGTextBuffer.h>
63#include <TG3DLine.h>
64#include <TGSlider.h>
65#include <TCanvas.h>
66#include <TView.h>
67#include <TGeometry.h>
68#include <TASImage.h>
69#include <TColor.h>
70//#include <TViewerX3D.h>
71//#include <TViewerOpenGL.h>
72//#include <TGLEditor.h>
73//#include <TVirtualGL.h>
74#include <TVirtualGeoPainter.h>
75#include <TRootHelpDialog.h>
76
77//// something from BesCvs Event
78//#include "RootCnvSvc/RootInterface.h"
79#include "RootEventData/TRecTrackEvent.h"
80#include "RootEventData/TDigiEvent.h"
81#include "RootCnvSvc/commonData.h"
82#include "RootCnvSvc/RootInterface.h"
83#include "RootCnvSvc/RootCnvSvc.h"
84//
85//#include "MdcRecEvent/MdcTrack.h"
86//#include "MdcRecEvent/MdcDedx.h"
87//#include "MdcRecEvent/MdcKalTrack.h"
88//#include "TofRecEvent/BTofTrack.h"
89//#include "TofRecEvent/BTofHit.h"
90//#include "TofRecEvent/ETofTrack.h"
91//#include "TofRecEvent/ETofHit.h"
92//#include "EmcRecEventModel/EmcRecShower.h"
93//#include "EmcRecEventModel/EmcRecFraction.h"
94//#include "MucRecEvent/MucTrack.h"
95//#include "MucRecEvent/MucRecHit.h"
96//
97//#include "ExtEvent/ExtTrack.h"
98//#include "ExtEvent/ExtMucHit.h"
99//
100#include "EventModel/EventModel.h"
101#include "EventModel/Event.h"
102//
103//#include "DstEvent/DstEvent.h"
104//#include "DstEvent/DstMdcTrack.h"
105//#include "DstEvent/DstMdcKalTrack.h"
106//#include "DstEvent/DstMdcDedx.h"
107//#include "DstEvent/DstTofTrack.h"
108//#include "DstEvent/DstEmcTrack.h"
109//#include "DstEvent/DstMucTrack.h"
110//#include "DstEvent/DstExtTrack.h"
111
112#include "ReconEvent/ReconEvent.h"
113#include "MdcRecEvent/RecMdcTrack.h"
114#include "MdcRecEvent/RecMdcKalTrack.h"
115#include "MdcRecEvent/RecMdcDedx.h"
116#include "TofRecEvent/RecTofTrack.h"
117#include "EmcRecEventModel/RecEmcShower.h"
118#include "MucRecEvent/RecMucTrack.h"
119#include "RootEventData/TDisTrack.h"
120
121#include "CLHEP/Matrix/Vector.h"
122#include "CLHEP/Matrix/SymMatrix.h"
123#include "CLHEP/Vector/ThreeVector.h"
124
125// standard cpp lib
126#include <vector>
127#include <iostream>
128#include <cmath>
129#include <cstdlib>
130#include <map>
131
132using namespace std;
133using namespace Event;
134using CLHEP::Hep3Vector;
135using CLHEP::HepSymMatrix;
136
137// testing share file
138#define BUFFER "./buffer"
139
140union semun{
141 int val;
142 struct semid_ds *buf;
143 ushort *array;
144};
145
147
148///////////////////////////////////////////////////////////////////////////////
149class TList;
150class TObject;
151class TRootEmbeddedCanvas;
152class TApplication;
153class TInterpreter;
154class TFile;
155class TTimer;
156class TBranch;
157class TTree;
158class TGPopupMenu;
159class TGStatusBar;
160class TGHorizontal3DLine;
161class TGLayoutHints;
162class TGMenuBar;
163class TGNumberEntry;
164class TGNumberFormat;
165class TGLabel;
166class TGHButtonGroup;
167class TGRadioButton;
168class TGCheckButton;
169class TGTextButton;
170class TGTextBuffer;
171class TGTextEntry;
172class TGHProgressBar;
173class TGButton;
174class TGPictureButton;
175class TGFileInfo;
176class TGFileDialog;
177class TGMsgBox;
178class TGGroupFrame;
179class TGTab;
180class TGVSplitter;
181class TGCanvas;
182class TGListTree;
183class TGListTreeItem;
184class TGHSlider;
185class TGVSlider;
186class TCanvas;
187class TView;
188class TGListTreeItem;
189
190
191class BesVisAlg:public Algorithm {
192public:
193 BesVisAlg (const std::string& name, ISvcLocator* pSvcLocator);
195 StatusCode initialize();
196 StatusCode execute();
197 StatusCode finalize();
198
199private:
200 // gaudi frame's variables
201 static int counter;
202 std::vector<std::string> testVec;
203 std::string f_rootOutputFile;
204 std::string f_geoInputFile;
205 // some variables needed by semaphore
206 pid_t c_pid;
207 pid_t m_pid;
208 ushort start_val[2];
209 int sem_value_F, sem_value_O;
210 int semid;
211 struct semid_ds sem_buf;
212 union semun arg;
213 struct sembuf acquire, release;
214
215 // Boss service interface
216 IDataManagerSvc *m_pDataManager;
217 IDataProviderSvc *m_pDataProvider;
218 IConversionSvc *m_pConversionSvc;
219 IDataStoreAgent *m_pAgent;
220 DataStoreItem *m_currentItem;
221 RootInterface *m_pRootInterface;
222 RootCnvSvc *m_cnvSvc;
223
224 typedef std::vector<DataStoreItem*> Items;
225 typedef std::vector<std::string> ItemNames;
226
227 Items m_itemList;
228
229 TDisTrack *recdis;
230 TRecMdcTrack *recTrack1;
231 TRecMucTrack *muctrk;
232 TRecTofTrack *tofTrack;
233 TRecMdcHit *mdchit;
234 TRecEmcShower *emcshower;
235
236 int m_mode; //online mode:1 offline:0
237 // private methods
238 StatusCode producer(int p_sleep);
239 bool hasRead();
240 StatusCode hasWrite();
241 void addItem(Items& itms, const std::string& descriptor);
242 void clearItems(Items& items);
243 DataStoreItem* findItem(const std::string& path);
244 StatusCode collectObjects();
245 StatusCode getSvc();
246 StatusCode finishSvc();
247 StatusCode write2file();
248};
249
250
251#endif
252
struct sembuf release
Definition: BesClient.cxx:136
struct sembuf acquire
Definition: BesClient.cxx:133
double arg(const EvtComplex &c)
Definition: EvtComplex.hh:227
StatusCode finalize()
BesVisAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode execute()
StatusCode initialize()
Root Event Conversion Service which coordinates all of our converters.