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