1 ////////////////////////////////////////////////////////////////////////////////
3 // Author: Artur Szostak
4 // Email: artur@alice.phy.uct.ac.za | artursz@iafrica.com
6 ////////////////////////////////////////////////////////////////////////////////
8 #ifndef dHLT_ALIROOT_ADC_STREAM_SOURCE_HPP
9 #define dHLT_ALIROOT_ADC_STREAM_SOURCE_HPP
14 #include "AliRoot/ADCStream.hpp"
22 class ADCStreamSource : public TObject
27 virtual ~ADCStreamSource();
29 /* Fills the internal data structures from the specified file
31 void FillFromFile(const TString& filename, Int_t eventnumber);
33 /* Fills the internal data structures from the specified directory.
34 FillFromFile is called for every file in the directory that is
35 prefixed with MUON_ and ends in .ddl
37 void FillFrom(const TString& directory, Int_t eventnumber);
39 /* Same as the methods above except the directory name is created as
40 dirprefix + eventnumber, where eventnumber is looped from firstevent
43 void FillFrom(const TString& dirprefix, UInt_t firstevent, UInt_t lastevent);
45 /* Clears all the internal arrays.
47 virtual void Clear(Option_t* option = "");
50 Int_t CurrentStream() const { return fCurrentStream; };
52 /* Returns the number of ADC streams stored.
54 Int_t NumberOfStreams() const;
56 /* Fetches the index'th ADC stream stored.
57 kTRUE is returned if the stream was found, kFALSE otherwise.
59 Bool_t GetStream(Int_t index) const;
61 /* Fetches the first ADC stream stored.
62 kTRUE is returned if the stream was found, kFALSE otherwise.
64 Bool_t FirstStream() const;
66 /* Fetches the next ADC stream stored following the currently selected one.
67 kTRUE is returned if the stream was found, kFALSE otherwise.
69 Bool_t NextStream() const;
71 /* Returns the corresponding AliRoot event number for the current stream.
72 -1 is returned if no stream is selected.
74 Int_t EventNumber() const;
76 /* Returns the current ADC stream selected.
77 kFALSE is returned if there is no stream selected.
79 Bool_t FetchStream(ADCStream& stream) const;
81 /* Returns the index'th ADC stream.
82 kTRUE is returned if the stream was found, kFALSE otherwise.
84 Bool_t FetchStream(Int_t index, ADCStream& stream) const;
86 /* Returns the current ADC stream selected.
87 A NULL pointer is returned if no ADC stream is selected.
89 const ADCStream* FetchStream() const;
93 /* Adds a new ADCStream object to the internal arrays.
95 void AddStream(ADCStream& stream, UInt_t eventnumber);
97 mutable Int_t fCurrentStream; //! The currently selected stream index.
100 public: // Unfortunately ROOT requires the following to be public.
104 virtual ~DataBlock() {};
106 Int_t fEventNumber; // Event number of the stream.
107 ADCStream fStream; // The ADC stream block.
109 ClassDef(DataBlock, 1) // Data per event.
114 std::vector<DataBlock> fList; // List of ADC streams.
116 ClassDef(ADCStreamSource, 1) // The source of ADC stream data for dHLT.
122 #endif // dHLT_ALIROOT_ADC_STREAM_SOURCE_HPP