]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFRawStream.h
New storage class and its iterator (Laurent)
[u/mrichter/AliRoot.git] / TOF / AliTOFRawStream.h
1 #ifndef ALITOFRAWSTREAM_H
2 #define ALITOFRAWSTREAM_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 class provides the key-reading for TOF raw data.   //
11 //                                                           //
12 ///////////////////////////////////////////////////////////////
13
14 #include "TObject.h"
15
16 class TClonesArray;
17
18 class AliRawReader;
19 class AliTOFGeometry;
20 class AliTOFrawData;
21
22 class AliTOFRawStream: public TObject {
23  public:
24
25   AliTOFRawStream(); // default ctr
26   AliTOFRawStream(AliRawReader* rawReader); // ctr
27   virtual ~AliTOFRawStream(); // default dtr
28
29   virtual Bool_t Next();
30   
31   virtual void   LoadRawData(Int_t indexDDL);
32
33   Int_t GetDDL()        const {return fDDL;};
34   Int_t GetTRM()        const {return fTRM;};
35   Int_t GetTDC()        const {return fTDC;};
36   Int_t GetTRMchain()   const {return fTRMchain;};
37   Int_t GetTDCchannel() const {return fTDCchannel;};
38   
39   Int_t GetSector() const {return fSector;};
40   Int_t GetPlate()  const {return fPlate;};
41   Int_t GetStrip()  const {return fStrip;};
42   Int_t GetPadZ()   const {return fPadZ;};
43   Int_t GetPadX()   const {return fPadX;};
44   Int_t GetIndex(Int_t *detId); // Get channel index for Online Calibration 
45   
46   Float_t GetTofBin() const {return fTime;};
47   Float_t GetToTbin() const {return fToT;};
48   Float_t GetLeadingEdge() const {return fLeadingEdge;};
49   Float_t GetTrailingEdge() const {return fTrailingEdge;};
50
51   Int_t GetPSbit()  const {return fPSbit;};
52   Int_t GetACQ()    const {return fACQ;};
53     
54   Int_t GetErrorFlag()  const {return fErrorFlag;};
55
56   void SetDDL(Int_t nDDL)            {fDDL = nDDL;};
57   void SetTRM(Int_t nTRM)            {fTRM = nTRM;};
58   void SetTDC(Int_t nTDC)            {fTDC = nTDC;};
59   void SetTRMchain(Int_t nChain)     {fTRMchain = nChain;};
60   void SetTDCchannel(Int_t nChannel) {fTDCchannel = nChannel;};
61
62   TClonesArray *GetRawData() const {return fTOFrawData;};
63
64   void SetSector();
65   void SetPlate();
66   void SetStrip();
67   void SetPadZ();
68   void SetPadX();
69   
70   void  EquipmentId2VolumeId(Int_t nDDL, Int_t nTRM, Int_t iChain,
71                              Int_t iTDC, Int_t iCH, Int_t *volume) const;
72   Int_t Equip2VolNplate(Int_t iDDL, Int_t nTRM, Int_t nTDC) const ;
73   Int_t Equip2VolNstrip(Int_t iDDL, Int_t nTRM, Int_t nTDC) const ;
74   Int_t Equip2VolNpad(Int_t iDDL, Int_t iChain, Int_t nTDC, Int_t iCH) const ;
75   Int_t GetDDLnumberPerSector(Int_t nDDL) const;
76   Int_t GetSectorNumber(Int_t nDDL) const;
77
78  private:
79
80   Int_t GetField(UInt_t word, Int_t fieldMask, Int_t fieldPosition) const;
81
82   AliTOFRawStream(const AliTOFRawStream& stream); // copy ctr
83   AliTOFRawStream& operator = (const AliTOFRawStream& stream); // ass. op.
84
85   AliRawReader*  fRawReader; // object for reading the raw data
86
87   TClonesArray *fTOFrawData; // pointer to AliTOFrawData TClonesArray
88
89   Int_t         fDDL;          // DDL file number [0;71]
90   Int_t         fTRM;          // TRM number [1;12]
91   Int_t         fTRMchain;     // TRM chain number [0;1]
92   Int_t         fTDC;          // TDC number [0;14]
93   Int_t         fTDCchannel;   // TDC channel number [0;7]
94   Float_t       fTime;         // time-of-flight measurement [0;8191]
95   Float_t       fToT;          // time-over-threshould measurement [0;255]
96   Float_t       fLeadingEdge;  // leading edge measurement
97   Float_t       fTrailingEdge; // trailing edge measurement
98   Int_t         fErrorFlag;    // error flag
99   
100   Int_t         fSector;     // sector number [0;17]
101   Int_t         fPlate;      // plate number [0;4]
102   Int_t         fStrip;      // strip number [0;14/18]
103   Int_t         fPadX;       // pad number along the strip [0;47]
104   Int_t         fPadZ;       // pad-row number [0;1]
105
106   AliTOFGeometry *fTOFGeometry; // pointer to the TOF geometry
107
108   Int_t fPackedDigits;       // counter for packed digits
109
110   Int_t fWordType;           // word type
111   Int_t fSlotID;             // crate slot ID number
112   Int_t fACQ;                // flag to identify the aquisition kind
113   Int_t fPSbit;              // flag for packing 
114   Int_t fTDCerrorFlag;       // TDC error flag
115   Bool_t fInsideDRM;         // inside/outside DRM
116   Bool_t fInsideTRM;         // inside/outside TRM
117   Bool_t fInsideLTM;         // inside/outside LTM
118   Bool_t fInsideTRMchain0;   // inside/outside chain 0
119   Bool_t fInsideTRMchain1;   // inside/outside chain 1
120
121   ClassDef(AliTOFRawStream, 1)  // class for reading TOF raw digits
122 };
123
124 #endif