]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MONITOR/AliMonitorProcess.h
HLT hough transformation updated
[u/mrichter/AliRoot.git] / MONITOR / AliMonitorProcess.h
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 <TSystem.h>
10 #include <TString.h>
11 #include <TObjArray.h>
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;
23 #ifdef ALI_HLT
24 class AliLevel3;
25 class AliL3Hough;
26 #endif
27
28
29 class AliMonitorProcess : public TObject {
30 public:
31   AliMonitorProcess(const char* alienDir,
32                     const char* fileNameGalice = "galice.root");
33   AliMonitorProcess(const AliMonitorProcess& process);
34   AliMonitorProcess& operator = (const AliMonitorProcess& process);
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
45   UInt_t           GetRunNumber() const {return fRunNumber;};
46   UInt_t           GetEventPeriodNumber() const;
47   UInt_t           GetEventOrbitNumber() const;
48   UInt_t           GetEventBunchNumber() const;
49
50   enum EStatus     {kStopped, kWaiting, kReading, kRecTPC, kRecITS, kRecV0s,
51                     kRecHLT, kFilling, kUpdating, kWriting, kResetting, 
52                     kConnecting, kBroadcasting};
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();};
61   TObjArray*       GetListOfClients() {return &fSockets;};
62   Int_t            GetNEventsMin() const {return fNEventsMin;};
63   void             SetNEventsMin(Int_t nEventsMin) {fNEventsMin = nEventsMin;};
64   void             SetWriteHistoList(Bool_t writeHistoList = kTRUE) 
65                                          {fWriteHistoList = writeHistoList;};
66
67   static Int_t     GetPort() {return fgkPort;};
68   
69 private:
70   Bool_t           CheckForNewFile();
71   Bool_t           ProcessFile();
72   Int_t            GetNumberOfEvents(const char* fileName) const;
73   Bool_t           ReconstructTPC(AliRawReader* rawReader);
74   Bool_t           ReconstructITS(AliRawReader* rawReader);
75   Bool_t           ReconstructV0s();
76 #ifdef ALI_HLT
77   void             CreateHLT(const char* fileName);
78   void             CreateHLTHough(const char* fileName);
79 #endif
80   Bool_t           ReconstructHLT(Int_t iEvent);
81   Bool_t           ReconstructHLTHough(Int_t iEvent);
82
83   Bool_t           WriteHistos();
84   void             StartNewRun();
85
86   void             CheckForConnections();
87   void             BroadcastHistos();
88   void             SetStatus(EStatus status);
89
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
98 #ifdef ALI_HLT
99   AliLevel3*       fHLT;                // the HLT tracker
100   AliL3Hough*      fHLTHough;           // the HLT hough transformer
101 #endif
102
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
109
110   TFolder*         fTopFolder;          // folder with histos
111   TObjArray        fMonitors;           // array of monitor objects
112   TFile*           fFile;               // file with tree
113   TTree*           fTree;               // monitor tree
114
115   TServerSocket*   fServerSocket;       // socket for client connections
116   TObjArray        fSockets;            // array of client sockets
117   TSocket*         fDisplaySocket;      // socket for an event display
118
119   EStatus          fStatus;             // current status
120   Bool_t           fStopping;           // stop of process requested or not
121
122   ClassDef(AliMonitorProcess, 0)   // class for performing the monitoring
123 };
124  
125
126 #endif
127
128
129
130
131
132
133
134
135