TOF QA Task (F. Bellini)
[u/mrichter/AliRoot.git] / RAW / AliAltroRawStreamFast.h
CommitLineData
31a920d3 1#ifndef ALIALTRORAWSTREAMFAST_H
2#define ALIALTRORAWSTREAMFAST_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 base class for reading raw data in Altro format.
9/// It makes use of the fast altro decoder written by Per Thomas.
10/// More information can be found in AliAltroDecoder class.
11///
12///////////////////////////////////////////////////////////////////////////////
13
14#include <TObject.h>
15#include <Riostream.h>
16
17#include "AliRawReader.h"
18#include "AliAltroDecoder.h"
19#include "AliAltroData.h"
20#include "AliAltroBunch.h"
21
22class AliAltroRawStreamFast: public TObject {
23 public :
24 AliAltroRawStreamFast(AliRawReader* rawReader);
25 virtual ~AliAltroRawStreamFast();
26
27 void SelectRawData(Int_t detId); // Select raw data for specific detector id
28 void SelectRawData(const char *detName); // Select raw data for specific detector name
29
53d3458c 30 virtual void Reset();
31a920d3 31 virtual Bool_t NextDDL();
32 virtual Bool_t NextChannel();
33 virtual Bool_t NextBunch();
34
53d3458c 35 Int_t GetDDLNumberOld() const { return fRawReader->GetDDLID(); } // Provide current DDL number
36 Int_t GetDDLNumber() const { return fDDLNumber; } // Provide current DDL number
37 Int_t GetPrevDDLNumber() const { return fPrevDDLNumber; } // Provide previous DDL number
38 Bool_t IsNewDDLNumber() const { return (fDDLNumber != fPrevDDLNumber); }
39
40 Int_t GetHWAddress() const { return fData.GetHadd(); } // Provide current hardware address
41 Int_t GetPrevHWAddress() const { return fData.GetPrevHadd(); } // Provide previous hardware address
42 Bool_t IsNewHWAddress() const { return fData.IsNewHadd() || IsNewDDLNumber(); }
43
44 UInt_t GetStartTimeBin() const { return fBunch.GetStartTimeBin(); } // Provide the index if the first time-bin in current bunch
45 UInt_t GetEndTimeBin() const { return fBunch.GetEndTimeBin(); } // Provide the index if the last time-bin in current bunch
46 const UInt_t* GetSignals() const { return fBunch.GetData(); } // Provide access to altro data itself
31a920d3 47
31a920d3 48
53d3458c 49 private :
31a920d3 50 AliAltroRawStreamFast& operator = (const AliAltroRawStreamFast& stream);
51 AliAltroRawStreamFast(const AliAltroRawStreamFast& stream);
52
53d3458c 53
54 Int_t fDDLNumber; // index of current DDL number
55 Int_t fPrevDDLNumber;// index of previous DDL number
56
31a920d3 57 AliAltroDecoder fDecoder; // decoder for altro payload
58 AliAltroData fData; // container for altro payload
59 AliAltroBunch fBunch; // container for altro bunches
60
61 AliRawReader* fRawReader; // object for reading the raw data
62
63 ClassDef(AliAltroRawStreamFast, 0) // base class for fast reading of Altro raw data
64};
65
66#endif