]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/FMDsim/AliFMDRawWriter.h
Filling BB flags in digit with trigger simulator
[u/mrichter/AliRoot.git] / FMD / FMDsim / AliFMDRawWriter.h
CommitLineData
e802be3e 1#ifndef ALIFMDRAWWRITER_H
2#define ALIFMDRAWWRITER_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/* $Id$ */
c2fc1258 11/** @file AliFMDRawWriter.h
12 @author Christian Holm Christensen <cholm@nbi.dk>
13 @date Mon Mar 27 12:45:56 2006
14 @brief Class to write raw data
15*/
e802be3e 16//____________________________________________________________________
17//
18// Class to writer ADC values to a Raw File
088f8e79 19// Uses general ALTRO class - which is wrong
20// Should make it right!
e802be3e 21//
22#ifndef ROOT_TTask
23# include <TTask.h>
24#endif
25
26//____________________________________________________________________
27class AliFMD;
7684b53c 28class AliAltroBuffer;
838120cd 29class AliAltroBufferV3;
7684b53c 30class TArrayI;
cce354f6 31class TArrayF;
1e8f773e 32class TClonesArray;
e802be3e 33
34//____________________________________________________________________
9f662337 35/** @class AliFMDRawWriter
36 @brief Class to write ALTRO formated raw data from an array of
37 AliFMDDigit objects.
38 @code
39 AliFMDRawWriter* fmdWriter = new AliFMDRawWriter(0);
40 TClonesArray* array = fmd->DigitArray();
41 fmdWriter->WriteDigits(array);
42 @endcode
43 @ingroup FMD_sim
44*/
e802be3e 45class AliFMDRawWriter : public TTask
46{
47public:
9f662337 48 /** Constructor
49 @param fmd Pointer to detector object. */
e802be3e 50 AliFMDRawWriter(AliFMD* fmd);
9f662337 51 /** Destructor */
088f8e79 52 virtual ~AliFMDRawWriter() {}
e802be3e 53
9f662337 54 /** Write the output from AliFMD object.
55 @param option Not used */
e802be3e 56 virtual void Exec(Option_t* option="");
9f662337 57 /** Write an array of AliFMDDigit objects as raw ALTRO data.
58 @param digits Array of AliFMDDigit objects to convert to raw
59 ALTRO data. */
3afd9281 60 virtual Long_t WriteDigits(TClonesArray* digits);
cce354f6 61 /** Do zero-suppression of channel data.
62 @param data Contain @a nWords of valid data. On input, it
63 contains the full channel data. On output it
64 will contain the zero-suppresed data.
65 @param peds Contain @a nWords pedestals
66 @param noise Contain @a nWords pedestal widths
67 @param threshold Zero suppression threshold. */
68 void ZeroSuppress(Int_t*& data, Int_t nWords, const Float_t* peds,
69 const Float_t* noise, UShort_t threshold) const;
9f662337 70protected:
b5ee4425 71 AliFMDRawWriter(const AliFMDRawWriter& o)
72 : TTask(o),
cce354f6 73 fFMD(o.fFMD),
74 fSampleRate(o.fSampleRate),
75 fChannelsPerAltro(o.fChannelsPerAltro),
76 fThreshold(o.fThreshold)
b5ee4425 77 {}
02a27b50 78 AliFMDRawWriter& operator=(const AliFMDRawWriter&) { return *this; }
838120cd 79 void WriteRCUTrailer(AliAltroBufferV3* altro,
80 UInt_t ddl,
81 Bool_t zs,
82 UShort_t factor,
83 UShort_t rate) const;
7684b53c 84 AliFMD* fFMD; //! Pointer to detector description
85 UShort_t fSampleRate; // The sample rate (0 -> inferred from data)
86 UShort_t fChannelsPerAltro; // Number of pre-amp. channels/adc channel
87 UShort_t fThreshold; // Threshold for zero-suppression
cce354f6 88
e802be3e 89 ClassDef(AliFMDRawWriter, 0) // Write FMD raw data to a DDL file
90};
91
92#endif
93//____________________________________________________________________
94//
95// Local Variables:
96// mode: C++
97// End:
98//
99// EOF
100//