]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSRawDecoder.h
Revert changes made in revision 32751
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRawDecoder.h
1 #ifndef ALIPHOSRAWDECODER_H
2 #define ALIPHOSRAWDECODER_H
3 /* Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                          */
5
6 /* $Id$ */
7
8 // This class extracts the PHOS "digits" of current event
9 // (amplitude,time, position,gain) from the raw stream 
10 // provided by AliRawReader. See cxx source for use case.
11
12 #include "AliCaloRawStream.h"
13
14 class TArrayI;
15 class AliRawReader;
16 class AliPHOSCalibData ;
17
18 class AliPHOSRawDecoder : public TObject 
19 {
20
21 public:
22
23   AliPHOSRawDecoder();
24   AliPHOSRawDecoder(AliRawReader* rawReader, AliAltroMapping **mapping = NULL);
25   AliPHOSRawDecoder(const AliPHOSRawDecoder& rawDecoder);
26   AliPHOSRawDecoder& operator = (const AliPHOSRawDecoder& rawDecoder);
27   virtual ~AliPHOSRawDecoder();
28
29   virtual Bool_t NextDigit();
30
31   void SubtractPedestals(Bool_t subtract) {fPedSubtract=subtract;}
32   void SetAmpOffset(Int_t extPed=5){fAmpOffset=extPed ;}
33   void SetAmpThreshold(Int_t thr=5){fAmpThreshold=thr ;}
34
35   Double_t GetEnergy() const { return fEnergy; }
36   Double_t GetTime() const { return fTime; }
37   Double_t GetSampleQuality() const {return fQuality ;}
38   Double_t GetPedestalRMS() const {return fPedestalRMS ;}
39   Int_t GetModule() const { return fModule; }
40   Int_t GetColumn() const { return fColumn; }
41   Int_t GetRow() const { return fRow; }
42   Bool_t IsLowGain() const { return fLowGainFlag; }
43   Bool_t IsOverflow() const { return fOverflow ;}
44
45   const AliRawReader* GetRawReader() const { return fRawReader; }
46   void SetCalibData(AliPHOSCalibData * cdata){ fCalibData=cdata ;}
47
48 protected:   
49   
50   AliRawReader* fRawReader;      // raw data reader
51   AliCaloRawStream* fCaloStream; // PHOS/EMCAL raw data stream
52   Bool_t fPedSubtract;           // pedestals subtraction (kTRUE="yes")
53
54
55   Double_t fEnergy; // "digit" energy
56   Double_t fTime;   // "digit" time
57   Double_t fQuality ; //Sample quality
58   Double_t fPedestalRMS; //calciulated RMS of pedestal (non-ZS runs)
59   Int_t fAmpOffset ; //Pedestal offset from ALTRO chips
60   Int_t fAmpThreshold ; //Zero Suppression threshold from ALTRO chips
61   Int_t fModule;    // PHOS module number (1-5)
62   Int_t fColumn;    // column in the module
63   Int_t fRow;       // row
64   Int_t fNewModule;    // PHOS module number (1-5) of keeped sample
65   Int_t fNewColumn;    // column in the module  of keeped sample
66   Int_t fNewRow;       // row  of keeped sample
67   Int_t fNewAmp ;      //Keeped amp
68   Int_t fNewTime ;     //Time of keeped sample
69   Bool_t fLowGainFlag; //True if sample read from Low Gain
70   Bool_t fNewLowGainFlag; // fLowGainFlag of keeped sample
71   Bool_t fOverflow ;   //Wether there was overflow
72   TArrayI* fSamples;   // array of samples
73   TArrayI* fTimes ;    // array of times corresponding to samples
74   AliPHOSCalibData * fCalibData ;   //! Calibration database if avalable
75
76
77   ClassDef(AliPHOSRawDecoder,4)
78 };
79
80 #endif