]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.h
CMake: Retrieve Git information
[u/mrichter/AliRoot.git] / HLT / TPCLib / HWCFemulator / AliHLTTPCHWClusterMergerV1.h
CommitLineData
0e3c57d2 1//-*- Mode: C++ -*-
2// $Id: AliHLTTPCHWClusterMergerV1.h 53447 2011-12-06 21:52:47Z richterm $
3
4#ifndef ALIHLTTPCHWCLUSTERMERGERV1_H
5#define ALIHLTTPCHWCLUSTERMERGERV1_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 AliHLTTPCHWClusterMergerV1.h
11// @author Matthias Richter, Sergey Gorbunov
12// @date 2011-11-25
13// @brief Merger class for HLT TPC Hardware clusters
14// Handles merging of branch border clusters
15
16#include "AliHLTTPCClusterMCData.h"
17#include "AliHLTLogging.h"
18#include <vector>
19#include "TObject.h"
20
21class AliHLTTPCRawCluster;
22
23/**
24 * @class AliHLTTPCHWClusterMergerV1
25 *
26 * @ingroup alihlt_base
27 */
28class AliHLTTPCHWClusterMergerV1 : public AliHLTLogging
29{
30 public:
31 /// standard constructor
32 AliHLTTPCHWClusterMergerV1();
33 /// destructor
34 ~AliHLTTPCHWClusterMergerV1();
35
36 Int_t Init();
37
e43f6920 38 void SetDataPointer( AliHLTUInt8_t *data ){ fpData=data; }
39
0e3c57d2 40 Int_t SetDataBlock( AliHLTComponentBlockData *block);
41
42 /// merge clusters
43 int Merge();
44
45 /// cleanup
46 void Clear();
47
48 private:
49 /// copy constructor
50 AliHLTTPCHWClusterMergerV1(const AliHLTTPCHWClusterMergerV1&);
51 /// assignment operator
52 AliHLTTPCHWClusterMergerV1& operator=(const AliHLTTPCHWClusterMergerV1&);
53
54 //////////////////////////////////////////////////////////////////////////////////////////////////////////
55
56 /// helper class to store relevant data for branch border
57
58 struct AliBorderParam {
59 AliBorderParam(float a, int b): fPadPosition(a), fPatch(b){}
60 Float_t fPadPosition;
61 Int_t fPatch;
62 };
63
64 /// helper class to store relevant data for a cluster at border
65 struct AliBorderRecord {
66 AliBorderRecord( AliHLTTPCRawCluster *a, AliHLTTPCClusterMCLabel *b, AliHLTUInt32_t c ):fCluster(a), fMC(b), fTimeBin(c){}
67 AliHLTTPCRawCluster *fCluster;
68 AliHLTTPCClusterMCLabel *fMC;
69 AliHLTUInt32_t fTimeBin;
70 };
71
72 //////////////////////////////////////////////////////////////////////////////////////////////////////////
73
74 static bool CompareTime( const AliBorderRecord &b1, const AliBorderRecord &b2){
75 return b1.fTimeBin > b2.fTimeBin;
76 }
77
78 static bool CompareMCWeights(const AliHLTTPCClusterMCWeight &a, const AliHLTTPCClusterMCWeight &b){
79 return a.fWeight > b.fWeight;
80 }
81 static bool CompareMCLabels(const AliHLTTPCClusterMCWeight &a, const AliHLTTPCClusterMCWeight &b){
82 return a.fMCID < b.fMCID;
83 }
84
85 static const int fkMergeWidth = 3;
86 static const int fkNSlices = 36;
87 static const int fkNPatches = 6;
88 static const int fkMergeTimeWindow = 3;
89
90 int fNRows;//!
91 int fNRowPads;//!
92 int fNBorders;//!
93
94 AliHLTInt16_t *fMapping;//!
95 std::vector<AliBorderParam> fBorders; //!
e43f6920 96 AliHLTUInt8_t *fpData;
0e3c57d2 97 AliHLTComponentBlockData **fRawClusterBlocks; //!
98 AliHLTComponentBlockData **fMCBlocks; //!
99};
100
101#endif //ALIHLTTPCHWCLUSTERMERGERV1_H