]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/MUON/src/AliRoot/ADCStreamSource.hpp
Also dropping references to AliMUONTriggerCircuit which are depricated. This is a...
[u/mrichter/AliRoot.git] / HLT / MUON / src / AliRoot / ADCStreamSource.hpp
CommitLineData
8356cc1d 1////////////////////////////////////////////////////////////////////////////////
2//
3// Author: Artur Szostak
4// Email: artur@alice.phy.uct.ac.za | artursz@iafrica.com
5//
6////////////////////////////////////////////////////////////////////////////////
7
4175c31c 8/* AliHLTMUONADCStreamSource is used to store the raw DDL data generated
9 from an AliRoot simulation.
10 This class is used as a storage class for the input dataset for
11 AliHLTMUONMicrodHLT.
12 */
13
69d7cf2e 14#ifndef ALIHLTMUONADCSTREAMSOURCE_H
15#define ALIHLTMUONADCSTREAMSOURCE_H
8356cc1d 16
17#include "TROOT.h"
18#include "TObject.h"
4175c31c 19#include "TClonesArray.h"
8356cc1d 20#include "TString.h"
21#include "AliRoot/ADCStream.hpp"
22
8356cc1d 23
69d7cf2e 24class AliHLTMUONADCStreamSource : public TObject
8356cc1d 25{
4175c31c 26public: // Unfortunately ROOT requires the following to be public.
27
28 class AliDataBlock : public TObject
29 {
30 public:
77650318 31 AliDataBlock() : fEventNumber(0), fStream() {}
4175c31c 32 virtual ~AliDataBlock() {};
33
34 Int_t& EventNumber() { return fEventNumber; }
35 AliHLTMUONADCStream& Stream() { return fStream; }
36
37 private:
38
39 Int_t fEventNumber; // Event number of the stream.
40 AliHLTMUONADCStream fStream; // The ADC stream block.
41
42 ClassDef(AliDataBlock, 1) // Data per event.
43 };
44
8356cc1d 45public:
46
69d7cf2e 47 AliHLTMUONADCStreamSource();
48 virtual ~AliHLTMUONADCStreamSource();
8356cc1d 49
50 /* Fills the internal data structures from the specified file
51 */
e33f3609 52 void FillFromFile(const TString& filename, Int_t eventnumber);
8356cc1d 53
54 /* Fills the internal data structures from the specified directory.
55 FillFromFile is called for every file in the directory that is
56 prefixed with MUON_ and ends in .ddl
57 */
e33f3609 58 void FillFrom(const TString& directory, Int_t eventnumber);
8356cc1d 59
60 /* Same as the methods above except the directory name is created as
61 dirprefix + eventnumber, where eventnumber is looped from firstevent
62 to lastevent.
63 */
e33f3609 64 void FillFrom(const TString& dirprefix, UInt_t firstevent, UInt_t lastevent);
8356cc1d 65
66 /* Clears all the internal arrays.
67 */
12ab84fc 68 virtual void Clear(Option_t* option = "");
8356cc1d 69
70 // Get methods.
71 Int_t CurrentStream() const { return fCurrentStream; };
72
73 /* Returns the number of ADC streams stored.
74 */
75 Int_t NumberOfStreams() const;
76
77 /* Fetches the index'th ADC stream stored.
78 kTRUE is returned if the stream was found, kFALSE otherwise.
79 */
e33f3609 80 Bool_t GetStream(Int_t index) const;
8356cc1d 81
82 /* Fetches the first ADC stream stored.
83 kTRUE is returned if the stream was found, kFALSE otherwise.
84 */
85 Bool_t FirstStream() const;
86
87 /* Fetches the next ADC stream stored following the currently selected one.
88 kTRUE is returned if the stream was found, kFALSE otherwise.
89 */
90 Bool_t NextStream() const;
91
92 /* Returns the corresponding AliRoot event number for the current stream.
93 -1 is returned if no stream is selected.
94 */
95 Int_t EventNumber() const;
96
97 /* Returns the current ADC stream selected.
98 kFALSE is returned if there is no stream selected.
99 */
69d7cf2e 100 Bool_t FetchStream(AliHLTMUONADCStream& stream) const;
8356cc1d 101
102 /* Returns the index'th ADC stream.
103 kTRUE is returned if the stream was found, kFALSE otherwise.
104 */
69d7cf2e 105 Bool_t FetchStream(Int_t index, AliHLTMUONADCStream& stream) const;
8356cc1d 106
107 /* Returns the current ADC stream selected.
108 A NULL pointer is returned if no ADC stream is selected.
109 */
69d7cf2e 110 const AliHLTMUONADCStream* FetchStream() const;
8356cc1d 111
112private:
113
69d7cf2e 114 /* Adds a new AliHLTMUONADCStream object to the internal arrays.
8356cc1d 115 */
69d7cf2e 116 void AddStream(AliHLTMUONADCStream& stream, UInt_t eventnumber);
8356cc1d 117
118 mutable Int_t fCurrentStream; //! The currently selected stream index.
8356cc1d 119
4175c31c 120 TClonesArray fList; // List of ADC streams.
8356cc1d 121
69d7cf2e 122 ClassDef(AliHLTMUONADCStreamSource, 1) // The source of ADC stream data for dHLT.
8356cc1d 123};
124
125
69d7cf2e 126#endif // ALIHLTMUONADCSTREAMSOURCE_H