]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliCaloRawStream.h
Possibility to specify event selection criteria within the raw-data input URI. The...
[u/mrichter/AliRoot.git] / RAW / AliCaloRawStream.h
1 #ifndef ALICALORAWSTREAM_H
2 #define ALICALORAWSTREAM_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 access to Calo digits in raw data.
11 ///
12 ///Modification: Class exported from PHOS to be used by EMCAL and PHOS
13 ///November 2006 Gustavo Conesa Balbastre 
14 ///////////////////////////////////////////////////////////////////////////////
15
16 // --- ROOT system ---
17
18 // --- AliRoot header files ---
19 #include "AliAltroRawStream.h"
20 class AliRawReader;
21 class AliAltroMapping;
22
23 class AliCaloRawStream: public AliAltroRawStream {
24
25 public :
26   AliCaloRawStream(AliRawReader* rawReader,  TString calo, AliAltroMapping **mapping = NULL);
27   virtual ~AliCaloRawStream();
28  
29   virtual void             Reset();
30   virtual Bool_t           Next();
31   
32   Int_t            GetModule()     const {return fModule;}
33   Int_t            GetRow()        const {return fRow;}
34   Int_t            GetColumn()     const {return fColumn;}
35   Int_t            GetPrevModule() const {return fPrevModule;}
36   Int_t            GetPrevRow()    const {return fPrevRow;}
37   Int_t            GetPrevColumn() const {return fPrevColumn;}
38   Bool_t           IsNewModule()   const {return GetModule() != GetPrevModule();}
39   Bool_t           IsNewRow()      const {return (GetRow() != GetPrevRow()) || IsNewModule();}
40   Bool_t           IsNewColumn()   const {return (GetColumn() != GetPrevColumn()) || IsNewRow();}
41   Int_t            GetNRCU() const {return fNRCU;}
42
43   enum EAliCaloFlag { kLowGain=0, kHighGain=1, kTRUData=2, kLEDMonData=3 };
44   Bool_t           IsLowGain()     const {return (fCaloFlag == kLowGain);}
45   Bool_t           IsHighGain()    const {return (fCaloFlag == kHighGain);}
46   Bool_t           IsTRUData()     const {return (fCaloFlag == kTRUData);}
47   Bool_t           IsLEDMonData()  const {return (fCaloFlag == kLEDMonData);} 
48
49   Int_t GetCaloFlag() const { return fCaloFlag; } 
50   Int_t GetFilter() const { return fFilter; } 
51
52   void SkipData(EAliCaloFlag caloFlag=kLEDMonData) 
53     { fFilter |= (1<<caloFlag); }
54
55 protected:
56
57   AliCaloRawStream(const AliCaloRawStream& stream);
58   AliCaloRawStream& operator = (const AliCaloRawStream& stream);
59
60   virtual void ApplyAltroMapping();
61
62   Int_t            fModule;       // index of current module
63   Int_t            fPrevModule;   // index of previous module
64   Int_t            fRow;          // index of current row
65   Int_t            fPrevRow;      // index of previous row
66   Int_t            fColumn;       // index of current column
67   Int_t            fPrevColumn;   // index of previous column
68   Int_t            fCaloFlag;     // low (0) or (1) high gain; see enum EAliCaloFlag above
69   Int_t            fFilter; // default 0 = let everything through
70   Int_t            fNRCU;   // number of RCU per (super)module
71   Bool_t           fExternalMapping;   // use external mapping or create a default one
72   AliAltroMapping *fMapping[4];   // pointers to ALTRO mapping
73
74   ClassDef(AliCaloRawStream, 0)   // class for reading PHOS/EMCAL raw digits
75
76 };
77
78 #endif
79