]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIRAWREADERDATEONLINE_H | |
2 | #define ALIRAWREADERDATEONLINE_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /////////////////////////////////////////////////////////////////////////////// | |
7 | /// | |
8 | /// This is a class for reading raw data from a date monitoring libraries. | |
9 | /// It supports two modes - event taken from shared memory via DATE monitoring | |
10 | /// libs, or an emulation mode when the events are taken from a DATE file using | |
11 | /// the same monitoring libs. | |
12 | /// The constructor requires an argument: | |
13 | /// | |
14 | /// : - events are taken from shared memory | |
15 | /// or | |
16 | /// <DATE_filename> - events are taken from date file | |
17 | /// | |
18 | /// Cvetan Cheshkov 1/04/2008 | |
19 | /////////////////////////////////////////////////////////////////////////////// | |
20 | ||
21 | #include <TSysEvtHandler.h> | |
22 | ||
23 | #include "AliRawReaderDate.h" | |
24 | ||
25 | class AliRawReaderDateOnline: public AliRawReaderDate { | |
26 | public : | |
27 | AliRawReaderDateOnline(const char* fileName, const Char_t** customTable = NULL); | |
28 | virtual ~AliRawReaderDateOnline(); | |
29 | ||
30 | virtual Bool_t NextEvent(); | |
31 | // virtual Bool_t RewindEvents(); | |
32 | ||
33 | // Method which can be used in order to force the auto-save on | |
34 | // ESD tree inside AliReconstruction. For the moment it will be | |
35 | // activated only for AliRawReaderDateOnline. | |
36 | virtual Bool_t UseAutoSaveESD() const { return kTRUE; } | |
37 | ||
38 | // Method triggered by signal hanlder | |
39 | // Set fStop to false in which case | |
40 | // NextEvent() returns fFALSE and the | |
41 | // processing of raw data stops | |
42 | virtual void Stop(); | |
43 | static Bool_t GetNoSleep() {return fgNoSleep;} | |
44 | static void SetNoSleep(Bool_t v=kTRUE) {fgNoSleep = v;} | |
45 | // | |
46 | protected: | |
47 | class AliRawReaderDateIntHandler : public TSignalHandler { | |
48 | public: | |
49 | AliRawReaderDateIntHandler(AliRawReaderDateOnline *rawReader): | |
50 | TSignalHandler(kSigUser1, kFALSE), fRawReader(rawReader) { } | |
51 | Bool_t Notify() { | |
52 | Info("Notify", "received a SIGUSR1 signal"); | |
53 | fRawReader->Stop(); | |
54 | return kTRUE; | |
55 | } | |
56 | private: | |
57 | AliRawReaderDateOnline *fRawReader; // raw-reader to signal | |
58 | ||
59 | AliRawReaderDateIntHandler(const AliRawReaderDateIntHandler& handler); // Not implemented | |
60 | AliRawReaderDateIntHandler& operator=(const AliRawReaderDateIntHandler& handler); // Not implemented | |
61 | }; | |
62 | ||
63 | virtual void SelectEvents(Int_t type, ULong64_t triggerMask = 0, const char *triggerExpr = NULL); | |
64 | private: | |
65 | AliRawReaderDateOnline(const AliRawReaderDateOnline& rawReader); | |
66 | AliRawReaderDateOnline& operator = (const AliRawReaderDateOnline& rawReader); | |
67 | ||
68 | const Char_t** fTable;// custom monitoring table | |
69 | Bool_t fStop; // raw-reader signaled to stop | |
70 | static Bool_t fgNoSleep; // do we freez the system while looping in event waiting? | |
71 | ClassDef(AliRawReaderDateOnline, 0) // class for reading DATE raw data from shared memory | |
72 | }; | |
73 | ||
74 | #endif |