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