]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h
6dfe4c0d5788ff137ff0a636e4d68f432a734f57
[u/mrichter/AliRoot.git] / HLT / TPCLib / HWCFemulator / AliHLTTPCHWCFEmulator.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 #ifndef ALIHLTTPCHWCFEMULATOR_H
4 #define ALIHLTTPCHWCFEMULATOR_H
5
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 #include "AliHLTTPCHWCFExtractorUnit.h"
11 #include "AliHLTTPCHWCFPeakFinderUnit.h"
12 #include "AliHLTTPCHWCFProcessorUnit.h"
13 #include "AliHLTTPCHWCFMergerUnit.h"
14 #include "AliHLTTPCHWCFDivisionUnit.h"
15
16 class AliHLTTPCClusterMCData;
17 class AliHLTTPCClusterMCLabel;
18
19 //  @class   AliHLTTPCHWCFEmulator
20 //  @author Sergey Gorbunov <sergey.gorbunov@fias.uni-frankfurt.de>
21 //  @author Torsten Alt <talt@cern.ch> 
22 //  @brief  FPGA ClusterFinder Emulator for TPC
23 //  @note
24 //
25 class AliHLTTPCHWCFEmulator 
26 {
27  public:  
28
29   /** standard constructor */
30    AliHLTTPCHWCFEmulator();
31   
32   /** destructor */
33   virtual ~AliHLTTPCHWCFEmulator();
34    
35   /** set debug level */
36   void SetDebugLevel( int val ){ fDebug = val; }
37
38   /** initialisation 
39    */
40   void Init( const AliHLTUInt32_t *mapping, AliHLTUInt32_t configWord1, AliHLTUInt32_t configWord2 );
41   
42   /** Loops over all rows finding the clusters 
43    */
44   int FindClusters( const AliHLTUInt32_t *rawEvent,
45                     AliHLTUInt32_t rawEventSize32,
46                     AliHLTUInt32_t *output,
47                     AliHLTUInt32_t &outputSize32,
48                     const AliHLTTPCClusterMCLabel *mcLabels,
49                     AliHLTUInt32_t nMCLabels,
50                     AliHLTTPCClusterMCData *outputMC
51                     );
52
53   /* useful tools */
54
55   /** read the word written in big endian format (lowest byte first) 
56    */
57   static AliHLTUInt32_t ReadBigEndian( AliHLTUInt32_t word );
58
59   /** write a word in big endian format (least byte first) 
60    */
61   static  AliHLTUInt32_t WriteBigEndian( AliHLTUInt32_t word );
62
63   /** create configuration word 
64    **/
65   static void CreateConfiguration
66     ( bool doDeconvTime, bool doDeconvPad, bool doFlowControl,  
67       bool doSinglePadSuppression, bool bypassMerger, 
68       AliHLTUInt32_t clusterLowerLimit,AliHLTUInt32_t singleSeqLimit, 
69       AliHLTUInt32_t mergerDistance, bool useTimeBinWindow, AliHLTUInt32_t chargeFluctuation,
70       AliHLTUInt32_t &configWord1, AliHLTUInt32_t &configWord2  );
71  
72   /** create default configuration word 
73    **/
74   static void CreateDefaultConfiguration( AliHLTUInt32_t &configWord1, AliHLTUInt32_t &configWord2 ){
75     CreateConfiguration(0,0,0,1,0,0,0, 3, 1, 0, configWord1, configWord2 );
76   }
77   
78  private: 
79
80   /** copy constructor prohibited */
81   AliHLTTPCHWCFEmulator(const AliHLTTPCHWCFEmulator&);
82   /** assignment operator prohibited */
83   AliHLTTPCHWCFEmulator& operator=(const AliHLTTPCHWCFEmulator&);
84  
85   int  fDebug; // debug level
86   const AliHLTUInt32_t *fkMapping; //! mapping array
87   AliHLTTPCHWCFExtractorUnit fChannelExtractor; //! transient
88   AliHLTTPCHWCFPeakFinderUnit fPeakFinderUnit; //! transient
89   AliHLTTPCHWCFProcessorUnit fChannelProcessor; //! transient
90   AliHLTTPCHWCFMergerUnit    fChannelMerger; //! transient
91   AliHLTTPCHWCFDivisionUnit  fDivisionUnit;   //! transient
92 };
93 #endif