]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RAW/AliAltroRawStream.h
changed calculation of n_sigma to vertex (again...).
[u/mrichter/AliRoot.git] / RAW / AliAltroRawStream.h
CommitLineData
3ea47630 1#ifndef ALIALTRORAWSTREAM_H
2#define ALIALTRORAWSTREAM_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
8///////////////////////////////////////////////////////////////////////////////
9///
10/// This is a base class for reading raw data digits in Altro format
7e18047e 11/// The class is able to read both old and new RCU trailer formats
12/// One can switch between formats using fIsOldRCUFormat flag
3ea47630 13///
14///////////////////////////////////////////////////////////////////////////////
15
16#include <TObject.h>
17
18class AliRawReader;
19
3ea47630 20class AliAltroRawStream: public TObject {
21 public :
22 AliAltroRawStream(AliRawReader* rawReader);
23 virtual ~AliAltroRawStream();
24
3a291af4 25 virtual void Reset();
26 virtual Bool_t Next();
3ea47630 27
cf4af8c7 28 Int_t GetDDLNumber() const { return fDDLNumber; } // Provide current DDL number
29 Int_t GetPrevDDLNumber() const { return fPrevDDLNumber; }// Provide previous DDL number
30 Bool_t IsNewDDLNumber() const {return (fDDLNumber != fPrevDDLNumber);};
31 Int_t GetRCUId() const { return fRCUId; } // Provide current RCU identifier
32 Int_t GetPrevRCUId() const { return fPrevRCUId; } // Provide previous RCU identifier
33 Bool_t IsNewRCUId() const {return (fRCUId != fPrevRCUId);};
34 Int_t GetHWAddress() const { return fHWAddress; } // Provide current hardware address
35 Int_t GetPrevHWAddress() const { return fPrevHWAddress; } // Provide previous hardware address
36 Bool_t IsNewHWAddress() const {return (fHWAddress != fPrevHWAddress) || IsNewDDLNumber();};
37 Int_t GetTime() const { return fTime; } // Provide index of current time bin
38 Int_t GetPrevTime() const { return fPrevTime; } // Provide index of previous time bin
39 Bool_t IsNewTime() const {return (fTime != fPrevTime) || IsNewHWAddress();};
40 Int_t GetSignal() const { return fSignal; } // Provide signal in ADC counts
41 Int_t GetTimeLength() const { return fTimeBunch; } // Provide total length of current time bunch
42
43 Bool_t GetRCUTrailerData(UChar_t*& data) const; // Provide a pointer to RCU trailer
44 Int_t GetRCUTrailerSize() const { return fRCUTrailerSize; } // Provide size of RCU trailer
5e6235b5 45
e7fd2555 46 void SelectRawData(Int_t detId); // Select raw data for specific detector id
47
7e18047e 48 void SetNoAltroMapping(Bool_t flag) { fNoAltroMapping = flag; } // Specify whenever to use or not the altro mapping
49 void SetOldRCUFormat(Bool_t flag) { fIsOldRCUFormat = flag; } // Specify whenever to use or not the old RCU trailer format
50
3ea47630 51 protected:
3a291af4 52 AliAltroRawStream(const AliAltroRawStream& stream);
53 AliAltroRawStream& operator = (const AliAltroRawStream& stream);
54
e7fd2555 55 Bool_t fNoAltroMapping; // temporary flag in case of no altro mapping is provided
56 Short_t fSegmentation[3]; // temporary container for the dummy trailer, to be removed
57
7e18047e 58 Bool_t fIsOldRCUFormat; // flag used to select between old and new RCU trailer format
59
e7fd2555 60 private :
3a291af4 61
e7fd2555 62 UShort_t GetNextWord();
63 Bool_t ReadTrailer();
64 Bool_t ReadDummyTrailer();
65 void ReadBunch();
66 void ReadAmplitude();
67 Int_t GetPosition();
5e6235b5 68 UInt_t Get32bitWord(Int_t &index);
e7fd2555 69
70 Int_t fDDLNumber; // index of current DDL number
5e6235b5 71 Int_t fPrevDDLNumber;// index of previous DDL number
72 Int_t fRCUId; // current RCU identifier
73 Int_t fPrevRCUId; // previous RCU identifier
3a291af4 74 Short_t fHWAddress; // current hardware address
75 Short_t fPrevHWAddress;// previous hardware address
3ea47630 76 Int_t fTime; // index of current time bin
e7fd2555 77 Int_t fPrevTime; // index of previous time bin
3ea47630 78 Int_t fSignal; // signal in ADC counts
634692a1 79 Int_t fTimeBunch; // total length of the current time bunch
3ea47630 80
81 AliRawReader* fRawReader; // object for reading the raw data
82
3a291af4 83
e7fd2555 84 UChar_t* fData; // raw data
3ea47630 85
3ea47630 86 Int_t fPosition; // current (10 bit) position in fData
87 Int_t fCount; // counter of words to be read for current trailer
88 Int_t fBunchLength; // remaining number of signal bins in the current bunch
89
5e6235b5 90 UChar_t* fRCUTrailerData; // pointer to RCU trailer data
91 Int_t fRCUTrailerSize; // size of RCU trailer data in bytes
92
3ea47630 93 ClassDef(AliAltroRawStream, 0) // base class for reading Altro raw digits
94};
95
96#endif