Line data Source code
1 : //-*- Mode: C++ -*-
2 : // @(#) $Id$
3 :
4 : #ifndef ALIHLTTPCDIGITDUMPCOMPONENT_H
5 : #define ALIHLTTPCDIGITDUMPCOMPONENT_H
6 : //* This file is property of and copyright by the ALICE HLT Project *
7 : //* ALICE Experiment at CERN, All rights reserved. *
8 : //* See cxx source for full Copyright notice *
9 :
10 : /** @file AliHLTTPCDigitDumpComponent.h
11 : @author Matthias Richter
12 : @date
13 : @brief Special file writer converting TPC digit input to ASCII.
14 : */
15 :
16 : #include "AliHLTFileWriter.h"
17 :
18 : class AliHLTTPCDigitReader;
19 :
20 : /**
21 : * @class AliHLTTPCDigitDumpComponent
22 : * A converter for digit data of the TPC input to ASCII output.
23 : * Data blocks of type ::kAliHLTDataTypeDDLRaw and origin 'TPC ' is docoded
24 : * written in readable ASCII format to a file.
25 : *
26 : * The component supports different types of readers in order to
27 : * choose different data formats (raw/digits) and reading modes.
28 : *
29 : * Component ID: \b TPCDigitDump <br>
30 : * Library: \b libAliHLTTPC
31 : *
32 : * See AliHLTFileWriter for arguments, further specific options
33 : * Mandatory arguments: <br>
34 : * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
35 : *
36 : * Optional arguments: <br>
37 : * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
38 : * \li -digitreader <i> reader </i> <br>
39 : * type of the digit reader: <i>unpacked, packed, raw, decoder</i>
40 : * default 'decoder'
41 : * \li -rcutrailersize <i> size </i> <br>
42 : * size of the RCU trailer in 32bit words (default 2), if digitreader
43 : * 'decoder' is used, the trailer size is determined automatically
44 : * \li -unsorted <br>
45 : * unsorted mode of digit readers (default mode)
46 : * \li -sorted <br>
47 : * sorted mode of digit readers (default is unsorted)
48 : * \li -bulk <br>
49 : * bulk read mode: NextChannel/Bunch
50 : * \li -stream <br>
51 : * stream read mode: Next
52 : *
53 : * @ingroup alihlt_tpc_components
54 : */
55 : class AliHLTTPCDigitDumpComponent : public AliHLTFileWriter {
56 : public:
57 : /** default constructor */
58 : AliHLTTPCDigitDumpComponent();
59 : /** destructor */
60 : virtual ~AliHLTTPCDigitDumpComponent();
61 :
62 : // interface functions: property getters
63 : virtual const char* GetComponentID();
64 : virtual void GetInputDataTypes(AliHLTComponentDataTypeList& list);
65 : virtual AliHLTComponent* Spawn();
66 :
67 : protected:
68 : // interface functions: processing
69 : int InitWriter();
70 : int CloseWriter();
71 : int DumpEvent( const AliHLTComponentEventData& evtData,
72 : const AliHLTComponentBlockData* blocks,
73 : AliHLTComponentTriggerData& trigData );
74 : using AliHLTDataSink::DumpEvent;
75 :
76 : int ScanArgument(int argc, const char** argv);
77 :
78 : private:
79 : /** copy constructor prohibited */
80 : AliHLTTPCDigitDumpComponent(const AliHLTTPCDigitDumpComponent&);
81 : /** assignment operator prohibited */
82 : AliHLTTPCDigitDumpComponent& operator=(const AliHLTTPCDigitDumpComponent&);
83 :
84 : /**
85 : * Print slice/partition/row/pad header if changed.
86 : */
87 : int PrintHeaders(int slice, int &iPrintedSlice,
88 : int part, int &iPrintedPart,
89 : AliHLTTPCDigitReader* pReader,
90 : int &iPrintedRow, int &iPrintedPad,
91 : ofstream &dump) const;
92 :
93 : enum {
94 : kDigitReaderInvalid,
95 : kDigitReaderUnpacked,
96 : kDigitReader32Bit
97 : };
98 :
99 : /** the digit reader to use */
100 : short fDigitReaderType; //!transient
101 :
102 : /** size of the RCU trailer in 32bit words */
103 : short fRcuTrailerSize; //! transient
104 :
105 : /** unsorted/sorted mode of digit readers */
106 : bool fUnsorted; //!transient
107 :
108 : /** bulk read mode */
109 : bool fbBulkMode; //!transient
110 :
111 : /** the digit reader */
112 : AliHLTTPCDigitReader* fpReader; //!transient
113 :
114 : /** flag if 32 bit format is used */
115 : Bool_t f32BitFormat;
116 :
117 6 : ClassDef(AliHLTTPCDigitDumpComponent, 0);
118 : };
119 :
120 : #endif
|