]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - FMD/AliFMDRawWriter.h
Fix for null fMCevent pointer
[u/mrichter/AliRoot.git] / FMD / AliFMDRawWriter.h
... / ...
CommitLineData
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$ */
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*/
16//____________________________________________________________________
17//
18// Class to writer ADC values to a Raw File
19// Uses general ALTRO class - which is wrong
20// Should make it right!
21//
22#ifndef ROOT_TTask
23# include <TTask.h>
24#endif
25
26//____________________________________________________________________
27class AliFMD;
28class AliAltroBuffer;
29class AliAltroBufferV3;
30class TArrayI;
31class TArrayF;
32class TClonesArray;
33
34//____________________________________________________________________
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*/
45class AliFMDRawWriter : public TTask
46{
47public:
48 /** Constructor
49 @param fmd Pointer to detector object. */
50 AliFMDRawWriter(AliFMD* fmd);
51 /** Destructor */
52 virtual ~AliFMDRawWriter() {}
53
54 /** Write the output from AliFMD object.
55 @param option Not used */
56 virtual void Exec(Option_t* option="");
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. */
60 virtual Long_t WriteDigits(TClonesArray* digits);
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;
70protected:
71 AliFMDRawWriter(const AliFMDRawWriter& o)
72 : TTask(o),
73 fFMD(o.fFMD),
74 fSampleRate(o.fSampleRate),
75 fChannelsPerAltro(o.fChannelsPerAltro),
76 fThreshold(o.fThreshold)
77 {}
78 AliFMDRawWriter& operator=(const AliFMDRawWriter&) { return *this; }
79 void WriteRCUTrailer(AliAltroBufferV3* altro,
80 UInt_t ddl,
81 Bool_t zs,
82 UShort_t factor,
83 UShort_t rate) const;
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
88
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//