AliRoot Core  edcc906 (edcc906)
AliFMDRawReader.h
Go to the documentation of this file.
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$ */
23 #include <TTask.h>
24 #include <TClonesArray.h>
25 #include "AliFMDUShortMap.h"
26 
27 //____________________________________________________________________
28 class AliRawReader;
29 class AliAltroRawStreamV3;
30 class TTree;
31 class TClonesArray;
32 class TArrayS;
35 class AliFMDUShortMap;
36 
37 //____________________________________________________________________
48 class AliFMDRawReader : public TTask
49 {
50 public:
52  enum {
53  kNDDL = 3
54  };
55  enum {
56  kBadSignal = 0x7FFF // Largest signed 16bit short integer
57  };
64  AliFMDRawReader(AliRawReader* reader, TTree* array);
68  virtual ~AliFMDRawReader() {}
69  void SetVerbose(Bool_t verb=kTRUE) { fVerbose = verb; }
75  virtual void Exec(Option_t* option="");
83  virtual Bool_t ReadAdcs(TClonesArray* array);
91  virtual Bool_t ReadAdcs(AliFMDUShortMap& map);
102  virtual Bool_t ReadSODevent(AliFMDCalibSampleRate* samplerate,
103  AliFMDCalibStripRange* striprange,
104  TArrayS &pulseSize,
105  TArrayS &pulseLength,
106  Bool_t* detectors=0);
114  Bool_t IsZeroSuppressed(UShort_t ddl) const { return fZeroSuppress[ddl]; }
123  UShort_t NoiseFactor(UShort_t ddl) const { return fNoiseFactor[ddl]; }
124 
146  Int_t NextSample(UShort_t& det, Char_t& rng, UShort_t& sec, UShort_t& str,
147  UShort_t& sam, UShort_t& rat, Short_t& adc,
148  Bool_t& zs, UShort_t& fac);
168  Int_t NextSignal(UShort_t& det, Char_t& rng,
169  UShort_t& sec, UShort_t& str,
170  Short_t& adc, Bool_t& zs,
171  UShort_t& fac);
180  UShort_t GetNErrors(UShort_t ddl) const {return (ddl >= kNDDL ? 0 : fNErrors[ddl]);}
188  UShort_t GetL1Phase(UShort_t ddl) const {return (ddl >= kNDDL ? -1 : fL1Phase[ddl]);}
197  static Bool_t SelectSample(UShort_t samp, UShort_t rate);
198 protected:
205  : TTask(o),
206  fTree(0),
207  fReader(0),
208  fData(0),
209  fNbytes(0),
210  fMinStrip(0),
211  fMaxStrip(127),
212  fPreSamp(14+5),
213  fSeen(0),
214  fVerbose(o.fVerbose),
215  fErrors(o.fErrors),
218  {}
224  AliFMDRawReader& operator=(const AliFMDRawReader&) { return *this; }
234  Int_t NewDDL(AliAltroRawStreamV3& input, UShort_t& det);
247  Int_t NewChannel(const AliAltroRawStreamV3& input,
248  UShort_t det, Char_t& ring,
249  UShort_t& sec, Short_t& strbase);
259  Bool_t NewBunch(const AliAltroRawStreamV3& input,
260  UShort_t& start, UShort_t& length);
274  Int_t NewSample(const AliAltroRawStreamV3& input,
275  Int_t i, UShort_t t, UShort_t sec,
276  UShort_t strbase, Short_t& str, UShort_t& samp);
277 
284  ULong_t GetNwords() const {return fNbytes / 4;}
292  UInt_t Get32bitWord(Int_t idx);
302  Int_t GetHalfringIndex(UShort_t det, Char_t ring, UShort_t board) const;
303  void AddError(Int_t ddl, Int_t hwaddr);
304  void ReadbackError(const AliAltroRawStreamV3& input, const char* format, ...);
305 
306  TTree* fTree;
307  AliRawReader* fReader;
308  UShort_t fSampleRate[kNDDL];// The sample rate (if 0,infer from data)
309  UChar_t* fData; // Data pointer
310  ULong_t fNbytes; // Number of bytes
311  Bool_t fZeroSuppress[kNDDL]; // Zero suppression flag
312  UShort_t fNoiseFactor[kNDDL]; // Noise factor
313  UShort_t fMinStrip; // Current minimum strip number (0)
314  UShort_t fMaxStrip; // Current maximum strip number (127)
315  UShort_t fPreSamp; // Current number of pre-samples (14+5)
316  AliFMDUShortMap fSeen; // Seen strips
317  UShort_t fNErrors[kNDDL]; // Number of errors per DDL
318  UShort_t fL1Phase[kNDDL]; // Number of errors per DDL
319  Bool_t fVerbose; // Whether to be verbose
320  TClonesArray fErrors; // Clones array of channels with errors
321  UShort_t fNErrChanLen; // Number of channel length errors
322  UShort_t fNErrAddress; // Number of address errors
323 
324  ClassDef(AliFMDRawReader, 0) // Read FMD raw data into a cache
325 };
326 
327 #endif
328 //____________________________________________________________________
329 //
330 // Local Variables:
331 // mode: C++
332 // End:
333 //
334 // EOF
335 //
336 
Int_t NextSample(UShort_t &det, Char_t &rng, UShort_t &sec, UShort_t &str, UShort_t &sam, UShort_t &rat, Short_t &adc, Bool_t &zs, UShort_t &fac)
void ReadbackError(const AliAltroRawStreamV3 &input, const char *format,...)
Int_t GetHalfringIndex(UShort_t det, Char_t ring, UShort_t board) const
Map of an integer per strip.
virtual void Exec(Option_t *option="")
UShort_t fNErrors[kNDDL]
TClonesArray fErrors
UShort_t NoiseFactor(UShort_t ddl) const
Bool_t NewBunch(const AliAltroRawStreamV3 &input, UShort_t &start, UShort_t &length)
UShort_t fL1Phase[kNDDL]
void AddError(Int_t ddl, Int_t hwaddr)
void SetVerbose(Bool_t verb=kTRUE)
AliFMDRawReader(const AliFMDRawReader &o)
Class to read ALTRO formated raw data from an AliRawReader object.
AliFMDUShortMap fSeen
UShort_t GetNErrors(UShort_t ddl) const
Bool_t fZeroSuppress[kNDDL]
Per strip of unisgned shorts (16 bit) data.
Per digitizer card pulser calibration.
AliFMDRawReader(AliRawReader *reader, TTree *array)
Bool_t IsZeroSuppressed(UShort_t ddl) const
TObjArray * array
Definition: AnalyzeLaser.C:12
Int_t NextSignal(UShort_t &det, Char_t &rng, UShort_t &sec, UShort_t &str, Short_t &adc, Bool_t &zs, UShort_t &fac)
virtual ~AliFMDRawReader()
UShort_t fNoiseFactor[kNDDL]
static Bool_t SelectSample(UShort_t samp, UShort_t rate)
UInt_t Get32bitWord(Int_t idx)
UShort_t fSampleRate[kNDDL]
Pointer to raw reader.
AliRawReader * fReader
Pointer to tree to read into.
virtual Bool_t ReadAdcs(TClonesArray *array)
UShort_t GetL1Phase(UShort_t ddl) const
ULong_t GetNwords() const
virtual Bool_t ReadSODevent(AliFMDCalibSampleRate *samplerate, AliFMDCalibStripRange *striprange, TArrayS &pulseSize, TArrayS &pulseLength, Bool_t *detectors=0)
Per digitizer card pulser calibration.
Int_t NewChannel(const AliAltroRawStreamV3 &input, UShort_t det, Char_t &ring, UShort_t &sec, Short_t &strbase)
AliFMDRawReader & operator=(const AliFMDRawReader &)
Int_t NewDDL(AliAltroRawStreamV3 &input, UShort_t &det)
Int_t NewSample(const AliAltroRawStreamV3 &input, Int_t i, UShort_t t, UShort_t sec, UShort_t strbase, Short_t &str, UShort_t &samp)