]>
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> | |
c4bd737c | 9 | #include <TSystem.h> |
04fa961a | 10 | #include <TString.h> |
04fa961a | 11 | #include <TObjArray.h> |
c4bd737c | 12 | |
13 | class AliRawReader; | |
14 | class AliTPCParam; | |
15 | class AliITSgeom; | |
16 | class AliRunLoader; | |
17 | class TFile; | |
18 | class TGrid; | |
19 | class TTimer; | |
20 | class TServerSocket; | |
21 | class TFolder; | |
22 | class TTree; | |
97d6eb66 | 23 | #ifdef ALI_HLT |
c4bd737c | 24 | class AliLevel3; |
c6ba6205 | 25 | class AliL3Hough; |
97d6eb66 | 26 | #endif |
04fa961a | 27 | |
28 | ||
29 | class AliMonitorProcess : public TObject { | |
30 | public: | |
31 | AliMonitorProcess(const char* alienDir, | |
32 | const char* fileNameGalice = "galice.root"); | |
c4bd737c | 33 | AliMonitorProcess(const AliMonitorProcess& process); |
34 | AliMonitorProcess& operator = (const AliMonitorProcess& process); | |
04fa961a | 35 | virtual ~AliMonitorProcess(); |
36 | ||
37 | static const char* GetRevision(); | |
38 | ||
39 | void Run(); | |
40 | void Stop(); | |
41 | void Reset(); | |
42 | ||
43 | void ProcessFile(const char* fileName); | |
44 | ||
c4bd737c | 45 | UInt_t GetRunNumber() const {return fRunNumber;}; |
46 | UInt_t GetEventPeriodNumber() const; | |
47 | UInt_t GetEventOrbitNumber() const; | |
48 | UInt_t GetEventBunchNumber() const; | |
04fa961a | 49 | |
50 | enum EStatus {kStopped, kWaiting, kReading, kRecTPC, kRecITS, kRecV0s, | |
97d6eb66 | 51 | kRecHLT, kFilling, kUpdating, kWriting, kResetting, |
04fa961a | 52 | kConnecting, kBroadcasting}; |
c4bd737c | 53 | EStatus GetStatus() const |
54 | {gSystem->ProcessEvents(); return fStatus;}; | |
55 | Bool_t WillStop() const {return fStopping;}; | |
56 | Bool_t IsStopped() const {return (fStatus == kStopped);}; | |
57 | ||
58 | Int_t GetNumberOfEvents() const {return fNEvents;}; | |
59 | Int_t GetNumberOfClients() const | |
60 | {return fSockets.GetEntriesFast();}; | |
04fa961a | 61 | TObjArray* GetListOfClients() {return &fSockets;}; |
c4bd737c | 62 | Int_t GetNEventsMin() const {return fNEventsMin;}; |
04fa961a | 63 | void SetNEventsMin(Int_t nEventsMin) {fNEventsMin = nEventsMin;}; |
64 | void SetWriteHistoList(Bool_t writeHistoList = kTRUE) | |
65 | {fWriteHistoList = writeHistoList;}; | |
04fa961a | 66 | |
c4bd737c | 67 | static Int_t GetPort() {return fgkPort;}; |
68 | ||
04fa961a | 69 | private: |
70 | Bool_t CheckForNewFile(); | |
71 | Bool_t ProcessFile(); | |
c4bd737c | 72 | Int_t GetNumberOfEvents(const char* fileName) const; |
04fa961a | 73 | Bool_t ReconstructTPC(AliRawReader* rawReader); |
74 | Bool_t ReconstructITS(AliRawReader* rawReader); | |
75 | Bool_t ReconstructV0s(); | |
97d6eb66 | 76 | #ifdef ALI_HLT |
77 | void CreateHLT(const char* fileName); | |
c6ba6205 | 78 | void CreateHLTHough(const char* fileName); |
97d6eb66 | 79 | #endif |
80 | Bool_t ReconstructHLT(Int_t iEvent); | |
c6ba6205 | 81 | Bool_t ReconstructHLTHough(Int_t iEvent); |
04fa961a | 82 | |
83 | Bool_t WriteHistos(); | |
84 | void StartNewRun(); | |
85 | ||
86 | void CheckForConnections(); | |
87 | void BroadcastHistos(); | |
c6ba6205 | 88 | void SetStatus(EStatus status); |
04fa961a | 89 | |
c4bd737c | 90 | static const Int_t fgkPort; // port number for client connections |
91 | ||
92 | TGrid* fGrid; // pointer to AliEn | |
93 | AliRunLoader* fRunLoader; // the current run loader | |
94 | AliTPCParam* fTPCParam; // TPC parameters | |
95 | AliITSgeom* fITSgeom; // ITS parameters | |
96 | TString fLogicalFileName; // logical AliEn file name | |
97 | TString fFileName; // physical file name | |
97d6eb66 | 98 | #ifdef ALI_HLT |
c4bd737c | 99 | AliLevel3* fHLT; // the HLT tracker |
c6ba6205 | 100 | AliL3Hough* fHLTHough; // the HLT hough transformer |
97d6eb66 | 101 | #endif |
04fa961a | 102 | |
c4bd737c | 103 | UInt_t fRunNumber; // current run number |
104 | UInt_t fSubRunNumber; // current part (=resets per run) | |
105 | UInt_t fEventNumber[2]; // current event number | |
106 | Int_t fNEvents; // total number of monitored events | |
107 | Int_t fNEventsMin; // threshold for writing | |
108 | Bool_t fWriteHistoList; // write event histos or not | |
04fa961a | 109 | |
c4bd737c | 110 | TFolder* fTopFolder; // folder with histos |
111 | TObjArray fMonitors; // array of monitor objects | |
112 | TFile* fFile; // file with tree | |
113 | TTree* fTree; // monitor tree | |
04fa961a | 114 | |
c4bd737c | 115 | TServerSocket* fServerSocket; // socket for client connections |
116 | TObjArray fSockets; // array of client sockets | |
117 | TSocket* fDisplaySocket; // socket for an event display | |
04fa961a | 118 | |
c4bd737c | 119 | EStatus fStatus; // current status |
120 | Bool_t fStopping; // stop of process requested or not | |
04fa961a | 121 | |
122 | ClassDef(AliMonitorProcess, 0) // class for performing the monitoring | |
123 | }; | |
124 | ||
125 | ||
126 | #endif | |
127 | ||
128 | ||
129 | ||
130 | ||
131 | ||
132 | ||
133 | ||
134 | ||
135 |