3 #ifndef ALIHLTTPCHWCFEXTRACTORUNIT_H
4 #define ALIHLTTPCHWCFEXTRACTORUNIT_H
5 //* This file is property of and copyright by the ALICE HLT Project *
6 //* ALICE Experiment at CERN, All rights reserved. *
7 //* See cxx source for full Copyright notice *
9 // @file AliHLTTPCHWCFExtractorUnit.h
10 // @author Sergey Gorbunov <sergey.gorbunov@fias.uni-frankfurt.de>
11 // @author Torsten Alt <talt@cern.ch>
12 // @brief Channel Extractor unit of FPGA ClusterFinder Emulator for TPC
13 // @brief ( see AliHLTTPCHWCFEmulator class )
16 #include "AliHLTDataTypes.h"
17 #include "AliHLTTPCHWCFDataTypes.h"
19 class AliHLTTPCHWCFExtractorUnit
23 /** standard constructor */
24 AliHLTTPCHWCFExtractorUnit();
27 ~AliHLTTPCHWCFExtractorUnit();
29 /** initialisation **/
30 int Init( const AliHLTUInt32_t *mapping, const AliHLTTPCClusterMCLabel *mcLabels, AliHLTUInt32_t nMCLabels );
32 /** input stream of data **/
33 int InputStream( AliHLTUInt32_t word );
35 /** input "end of data" signal **/
38 /** output stream of data **/
39 const AliHLTTPCHWCFBunch *OutputStream();
43 enum AliHLTTPCHWCFExtractorStatus{ kReadingData, kReadingRCU, kFinishing, kStop };
44 enum AliHLTTPCHWCFExtractorInputStatus{ kEmpty, kData, kEndOfData };
46 /** copy constructor prohibited */
47 AliHLTTPCHWCFExtractorUnit(const AliHLTTPCHWCFExtractorUnit&);
48 /** assignment operator prohibited */
49 AliHLTTPCHWCFExtractorUnit& operator=(const AliHLTTPCHWCFExtractorUnit&);
51 AliHLTTPCHWCFExtractorStatus fStatus; // status of the unit
52 AliHLTUInt32_t fInput; // current input
53 AliHLTTPCHWCFExtractorInputStatus fInputStatus; // input status
55 const AliHLTUInt32_t *fkMapping; // mapping array
56 AliHLTTPCHWCFBunch fMemory[2]; // memory for current bunch and pending output
57 AliHLTTPCHWCFBunch *fBunch; // current bunch
58 bool fPendingOutput; // is there something in the output buffer
60 AliHLTInt32_t fChannelNumWordsLeft; // n 10-bit words left in the channel
61 AliHLTInt32_t fBunchNumWordsLeft;// n 10-bit words left in the bunch
62 AliHLTInt32_t fBunchCurrentTime; // timebin of the curent signal
64 const AliHLTTPCClusterMCLabel *fkMCLabels; // pointer to mc labels
65 AliHLTUInt32_t fNMCLabels; // N mc labels
66 AliHLTUInt32_t fCurrentMCLabel; // mc label to read next