]>
Commit | Line | Data |
---|---|---|
04fa961a | 1 | #ifndef ALIMONITORPROCESS_H |
2 | #define ALIMONITORPROCESS_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | #include <TObject.h> | |
9 | #include <TString.h> | |
10 | #include <TFolder.h> | |
11 | #include <TFile.h> | |
12 | #include <TTree.h> | |
13 | #include <TObjArray.h> | |
14 | #include <TServerSocket.h> | |
15 | #include <TTimer.h> | |
16 | #include <TGrid.h> | |
1899848d | 17 | #include <TSystem.h> |
04fa961a | 18 | #include "AliRunLoader.h" |
19 | #include "AliRawReader.h" | |
20 | #include "AliTPCParam.h" | |
21 | #include "AliITSgeom.h" | |
97d6eb66 | 22 | #ifdef ALI_HLT |
23 | #include "AliLevel3.h" | |
24 | #endif | |
04fa961a | 25 | |
26 | ||
27 | class AliMonitorProcess : public TObject { | |
28 | public: | |
29 | AliMonitorProcess(const char* alienDir, | |
30 | const char* fileNameGalice = "galice.root"); | |
31 | virtual ~AliMonitorProcess(); | |
32 | ||
33 | static const char* GetRevision(); | |
34 | ||
35 | void Run(); | |
36 | void Stop(); | |
37 | void Reset(); | |
38 | ||
39 | void ProcessFile(const char* fileName); | |
40 | ||
41 | UInt_t GetRunNumber() {return fRunNumber;}; | |
42 | UInt_t GetEventPeriodNumber(); | |
43 | UInt_t GetEventOrbitNumber(); | |
44 | UInt_t GetEventBunchNumber(); | |
45 | ||
46 | enum EStatus {kStopped, kWaiting, kReading, kRecTPC, kRecITS, kRecV0s, | |
97d6eb66 | 47 | kRecHLT, kFilling, kUpdating, kWriting, kResetting, |
04fa961a | 48 | kConnecting, kBroadcasting}; |
1899848d | 49 | EStatus GetStatus() {gSystem->ProcessEvents();return fStatus;}; |
04fa961a | 50 | Bool_t WillStop() {return fStopping;}; |
51 | Bool_t IsStopped() {return (fStatus == kStopped);}; | |
52 | ||
53 | Int_t GetNumberOfEvents() {return fNEvents;}; | |
54 | Int_t GetNumberOfClients() {return fSockets.GetEntriesFast();}; | |
55 | TObjArray* GetListOfClients() {return &fSockets;}; | |
56 | Int_t GetNEventsMin() {return fNEventsMin;}; | |
57 | void SetNEventsMin(Int_t nEventsMin) {fNEventsMin = nEventsMin;}; | |
58 | void SetWriteHistoList(Bool_t writeHistoList = kTRUE) | |
59 | {fWriteHistoList = writeHistoList;}; | |
60 | ||
61 | static const Int_t kgPort; | |
62 | ||
63 | private: | |
64 | Bool_t CheckForNewFile(); | |
65 | Bool_t ProcessFile(); | |
66 | Int_t GetNumberOfEvents(const char* fileName); | |
67 | Bool_t ReconstructTPC(AliRawReader* rawReader); | |
68 | Bool_t ReconstructITS(AliRawReader* rawReader); | |
69 | Bool_t ReconstructV0s(); | |
97d6eb66 | 70 | #ifdef ALI_HLT |
71 | void CreateHLT(const char* fileName); | |
72 | #endif | |
73 | Bool_t ReconstructHLT(Int_t iEvent); | |
04fa961a | 74 | |
75 | Bool_t WriteHistos(); | |
76 | void StartNewRun(); | |
77 | ||
78 | void CheckForConnections(); | |
79 | void BroadcastHistos(); | |
1899848d | 80 | void SetStatus(EStatus); |
04fa961a | 81 | |
82 | TGrid* fGrid; | |
83 | AliRunLoader* fRunLoader; | |
84 | AliTPCParam* fTPCParam; | |
85 | AliITSgeom* fITSgeom; | |
86 | TString fLogicalFileName; | |
87 | TString fFileName; | |
97d6eb66 | 88 | #ifdef ALI_HLT |
89 | AliLevel3* fHLT; | |
90 | #endif | |
04fa961a | 91 | |
92 | UInt_t fRunNumber; | |
93 | UInt_t fSubRunNumber; | |
94 | UInt_t fEventNumber[2]; | |
95 | Int_t fNEvents; | |
96 | Int_t fNEventsMin; | |
97 | Bool_t fWriteHistoList; | |
98 | ||
99 | TFolder* fTopFolder; | |
100 | TObjArray fMonitors; | |
101 | TFile* fFile; | |
102 | TTree* fTree; | |
103 | ||
104 | TServerSocket* fServerSocket; | |
105 | TObjArray fSockets; | |
106 | TSocket* fDisplaySocket; | |
107 | ||
108 | EStatus fStatus; | |
109 | Bool_t fStopping; | |
110 | ||
111 | ClassDef(AliMonitorProcess, 0) // class for performing the monitoring | |
112 | }; | |
113 | ||
114 | ||
115 | #endif | |
116 | ||
117 | ||
118 | ||
119 | ||
120 | ||
121 | ||
122 | ||
123 | ||
124 |