]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDRawReader.h
Simple scripts to run various steps.
[u/mrichter/AliRoot.git] / FMD / AliFMDRawReader.h
1 #ifndef ALIFMDRAWREADER_H
2 #define ALIFMDRAWREADER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved. 
5  *
6  * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
7  *
8  * See cxx source for full Copyright notice                               
9  */
10 //____________________________________________________________________
11 // 
12 // Class to read ADC values from a AliRawReader object. 
13 // Note, that it uses an ALTRO reader, which is wrong. 
14 // Perhaps we need to implement it our selves
15 // 
16 /* $Id$ */
17 /** @file    AliFMDRawReader.h
18     @author  Christian Holm Christensen <cholm@nbi.dk>
19     @date    Mon Mar 27 12:45:23 2006
20     @brief   Class to read raw data 
21     @ingroup FMD_rec
22 */
23 #ifndef ROOT_TTask
24 # include <TTask.h>
25 #endif
26
27 //____________________________________________________________________
28 class AliRawReader;
29 class TTree;
30 class TClonesArray;
31 class TArrayS;
32 class AliFMDCalibSampleRate;
33 class AliFMDCalibStripRange;
34
35 //____________________________________________________________________
36 /** @brief Class to read ALTRO formated raw data from an AliRawReader
37     object. 
38     @code 
39     AliRawReader*    reader    = new AliRawReaderFile(0);
40     AliFMDRawReader* fmdReader = new AliFMDRawReader(reader);
41     TClonesArray*    array     = new TClonesArray("AliFMDDigit");
42     fmdReader->ReadAdcs(array);
43     @endcode 
44     @ingroup FMD_rec
45 */
46 class AliFMDRawReader : public TTask 
47 {
48 public:
49   /** CTOR 
50       @param reader Raw reader
51       @param array  Output tree */
52   AliFMDRawReader(AliRawReader* reader, TTree* array);
53   /** DTOR */
54   virtual ~AliFMDRawReader() {}
55   /** Read in, and store in output tree 
56       @param option Not used */
57   virtual void   Exec(Option_t* option="");
58   /** Read ADC's into a TClonesArray of AliFMDDigit objects. 
59       @param array Array to read into 
60       @return @c true on success */
61   virtual Bool_t ReadAdcs(TClonesArray* array);
62   /** Read SOD event into a container. 
63       @param array Array to read into 
64       @return @c true on success */
65   virtual Bool_t ReadSODevent(AliFMDCalibSampleRate* samplerate, 
66                               AliFMDCalibStripRange* striprange, 
67                               TArrayS &pulseSize, 
68                               TArrayS &pulseLength);
69 protected:
70   AliFMDRawReader(const AliFMDRawReader& o) 
71     : TTask(o), 
72       fTree(0), 
73       fReader(0), 
74       fSampleRate(0),
75       fData(0),
76       fNbytes(0)
77   {}
78   AliFMDRawReader& operator=(const AliFMDRawReader&) { return *this; }
79   ULong_t GetNwords() const {return fNbytes / 4;}
80   UInt_t Get32bitWord(Int_t idx);
81   Int_t GetHalfringIndex(UShort_t det, Char_t ring, UShort_t board);
82   TTree*        fTree;       //! Pointer to tree to read into 
83   AliRawReader* fReader;     //! Pointer to raw reader 
84   UShort_t      fSampleRate; // The sample rate (if 0, inferred from data)
85   UChar_t* fData; 
86   ULong_t  fNbytes; 
87   
88   ClassDef(AliFMDRawReader, 0) // Read FMD raw data into a cache 
89 };
90
91 #endif
92 //____________________________________________________________________
93 //
94 // Local Variables:
95 //   mode: C++
96 // End:
97 //
98 // EOF
99 //