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