]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSRawDecoder.h
New class to generate fake gain runs (Laurent)
[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 "AliRawReader.h"
13 #include "AliCaloRawStream.h"
14
15 class TArrayI;
16 class AliPHOSPulseGenerator;
17
18 class AliPHOSRawDecoder {
19
20 public:
21
22   AliPHOSRawDecoder();
23   AliPHOSRawDecoder(AliRawReader* rawReader);
24   AliPHOSRawDecoder(const AliPHOSRawDecoder& rawDecoder);
25   AliPHOSRawDecoder& operator = (const AliPHOSRawDecoder& rawDecoder);
26   virtual ~AliPHOSRawDecoder();
27
28   virtual Bool_t NextDigit();
29
30   void SetOldRCUFormat(Bool_t isOldRCU) {fCaloStream->SetOldRCUFormat(isOldRCU);}
31   void SubtractPedestals(Bool_t subtract) {fPedSubtract=subtract;}
32
33   Double_t GetEnergy() { return fEnergy; }
34   Double_t GetTime() { return fTime; }
35   Int_t GetModule() { return fModule; }
36   Int_t GetColumn() { return fColumn; }
37   Int_t GetRow() { return fRow; }
38   Bool_t IsLowGain() { return fCaloStream->IsLowGain(); }
39
40 protected:   
41   
42   AliRawReader* fRawReader;      // raw data reader
43   AliCaloRawStream* fCaloStream; // PHOS/EMCAL raw data stream
44   Bool_t fPedSubtract;           // pedestals subtraction (kTRUE="yes")
45
46 private:
47
48   Double_t fEnergy; // "digit" energy
49   Double_t fTime;   // "digit" time
50   Int_t fModule;    // PHOS module number (1-5)
51   Int_t fColumn;    // column in the module
52   Int_t fRow;       // row
53   TArrayI* fSamples;// array of samples
54   AliPHOSPulseGenerator* fPulseGenerator; // ALTRO pulse simulator
55   
56   ClassDef(AliPHOSRawDecoder,1)
57 };
58
59 #endif