1 #ifndef ALIFMDRAWREADER_H
2 #define ALIFMDRAWREADER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
6 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
8 * See cxx source for full Copyright notice
10 //____________________________________________________________________
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
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
26 #include "AliFMDUShortMap.h"
28 //____________________________________________________________________
33 class AliFMDCalibSampleRate;
34 class AliFMDCalibStripRange;
36 //____________________________________________________________________
37 /** @brief Class to read ALTRO formated raw data from an AliRawReader
40 AliRawReader* reader = new AliRawReaderFile(0);
41 AliFMDRawReader* fmdReader = new AliFMDRawReader(reader);
42 TClonesArray* array = new TClonesArray("AliFMDDigit");
43 fmdReader->ReadAdcs(array);
47 class AliFMDRawReader : public TTask
51 @param reader Raw reader
52 @param array Output tree */
53 AliFMDRawReader(AliRawReader* reader, TTree* array);
55 virtual ~AliFMDRawReader() {}
56 /** Read in, and store in output tree
57 @param option Not used */
58 virtual void Exec(Option_t* option="");
59 /** Read ADC's into a TClonesArray of AliFMDDigit objects.
60 @param array Array to read into
61 @return @c true on success */
62 virtual Bool_t ReadAdcs(TClonesArray* array);
64 * Read SOD event into passed objects.
66 * @param samplerate The sample rate object to fill
67 * @param striprange The strip range object to fill
68 * @param pulseSize The pulse size object to fill
69 * @param pulseLength The pulse length (in events) object to fill
71 * @return @c true on success
73 virtual Bool_t ReadSODevent(AliFMDCalibSampleRate* samplerate,
74 AliFMDCalibStripRange* striprange,
76 TArrayS &pulseLength);
78 * Check of the data from DDL @a ddl is zero-suppressed
80 * @param ddl DDL number (0-2)
82 * @return @c true if the data from this DDL is zero-suppressed.
84 Bool_t IsZeroSuppressed(UShort_t ddl) const { return fZeroSuppress[ddl]; }
86 * The factor used to multiply the noise when making on-line
87 * pedestal subtraction.
89 * @param ddl DDL number (0-2)
91 * @return The factor used.
93 UShort_t NoiseFactor(UShort_t ddl) const { return fNoiseFactor[ddl]; }
95 Bool_t NextSignal(UShort_t& det, Char_t& rng,
96 UShort_t& sec, UShort_t& str,
97 Short_t& adc, Bool_t& zs,
100 AliFMDRawReader(const AliFMDRawReader& o)
109 AliFMDRawReader& operator=(const AliFMDRawReader&) { return *this; }
110 ULong_t GetNwords() const {return fNbytes / 4;}
111 UInt_t Get32bitWord(Int_t idx);
112 Int_t GetHalfringIndex(UShort_t det, Char_t ring, UShort_t board);
113 TTree* fTree; //! Pointer to tree to read into
114 AliRawReader* fReader; //! Pointer to raw reader
115 UShort_t fSampleRate; // The sample rate (if 0, inferred from data)
118 Bool_t fZeroSuppress[3];
119 UShort_t fNoiseFactor[3];
120 AliFMDUShortMap fSeen;
122 ClassDef(AliFMDRawReader, 0) // Read FMD raw data into a cache
126 //____________________________________________________________________