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