]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCHWClusterTransformComponent.h
Bug fixes in HLT cluster transformation:
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCHWClusterTransformComponent.h
CommitLineData
6af4f584 1// -*- Mode: C++ -*-
2// $Id$
3
4#ifndef ALIHLTTPCHWCLUSTERTRANSFORMCOMPONENT_H
5#define ALIHLTTPCHWCLUSTERTRANSFORMCOMPONENT_H
6
7//* This file is property of and copyright by the ALICE HLT Project *
8 //* ALICE Experiment at CERN, All rights reserved. *
9 //* See cxx source for full Copyright notice *
10
11 /** @file AliHLTTPCHWClusterTransformComponent.h
12 @author Kalliopi Kanaki
13 @date
14 @brief
15 */
16
17// see below for class documentation
18// or
19// refer to README to build package
20// or
21// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
22
23#include "AliHLTProcessor.h"
dccee396 24#include "AliHLTTPCClusterTransformation.h"
a5dc9013 25#include "AliHLTComponentBenchmark.h"
6af4f584 26
a9d14303 27class AliTPCTransform;
fd086f6c 28class AliHLTTPCHWCFData;
a9d14303 29
6af4f584 30/**
31 * @class AliHLTTPCHWClusterTransformComponent
32 *
33 * The format of the incoming HW clusters is as follows:
34 *
35 * WORD 0 : CDH0
36 * WORD 1 : CDH1
37 * WORD 2 : CDH2
38 * WORD 3 : CDH3
39 * WORD 4 : CDH4 8 32-bit words for the common data header
40 * WORD 5 : CDH5
41 * WORD 6 : CDH6
42 * WORD 7 : CDH7
43 *
44 * WORD 8 : contains cluster identification (bits 30-31), Row (6 bits (bit 24-29)) and Charge (24 bits (bit 0-23))
45 * WORD 9 : contain the pad (32 bits)
46 * WORD 10 : contain the time (32 bits)
47 * WORD 11 : contain the pad error (32 bits)
48 * WORD 12 : contain the time error (32 bits)
49 *
50 * WORD 13 : contains cluster identification (bits 30-31), Row (6 bits (bit 24-29)) and Charge (24 bits (bit 0-23))
51 * WORD 14 : contains the pad (32 bits)
52 * WORD 15 : contains the time (32 bits)
53 * WORD 16 : contains the pad error (32 bits)
54 * WORD 17 : contains the time error (32 bits)
55
56 * WORD 18 : RCU TRAILER WORD 0
57 * WORD 19 : RCU TRAILER WORD 1
58 * ...
59 * WORD 18+N : RCU TRAILER WORD N
60 *
61 * The cluster is signified with bits 30 and 31 being 11 (0x3).
62 * The RCU trailer is signified with bits 30 and 31 being 10 (0x2).
63 *
64 * A buffer reads the incoming data block. We skip the first 8 words of the CDH.
65 * Then we shift 30 bits to the right to get the last 2 bits of the next word, 30 and 31.
66 *
67 * If bit3031 = 0x3 (11), we are in the beginning of a cluster.
68 * We apply a 24-bit mask to get the first 24 bits that represent the charge of the cluster.
69 * We cast the word buffer to an 8-bit pointer that will point at bit 0 (for little endian),
70 * then increment it by 3 bytes, which takes us to bit 24. The last byte of the word
71 * contains row info and the cluster tag (11).
72 *
73 * With a & bit operation the row info is retrieved (6 bits).
74 * The rest of the cluster information is contained in the following 4 words.
75 *
76 * If bit3031 = 0x2 (10), we have reached the RCU trailer.
77 *
78 * -------------------------------------------------------
79 *
80 * Short note about little endian:
81 *
82 * DE AD BE EF (a 4 byte word)
83 *
84 * The byte order in memory to represent this word will be:
85 *
86 * EF
87 * BE
88 * AD
89 * DE
90 *
91 * The least significant byte value is stored at the lowest address.
92 * http://en.wikipedia.org/wiki/Endianness#Little-endian
93 *
94 * @ingroup alihlt_tpc_components
95 */
96
97class AliHLTTPCHWClusterTransformComponent : public AliHLTProcessor {
98
99public:
100
101 /** standard constructor */
102 AliHLTTPCHWClusterTransformComponent();
103 /** destructor */
104 virtual ~AliHLTTPCHWClusterTransformComponent();
105
106 // Public functions to implement AliHLTComponent's interface.
107 // These functions are required for the registration process
108
109 /** interface function, see AliHLTComponent for description */
110 const char* GetComponentID();
111 /** interface function, see AliHLTComponent for description */
112 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
113 /** interface function, see AliHLTComponent for description */
114 AliHLTComponentDataType GetOutputDataType();
115 /** interface function, see AliHLTComponent for description */
116 int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
117 /** interface function, see AliHLTComponent for description */
118 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
119 /** interface function, see AliHLTComponent for description */
120 AliHLTComponent* Spawn();
1c29fee7 121 /** interface function, see @ref AliHLTComponent for description */
122 void GetOCDBObjectDescription( TMap* const targetMap);
6af4f584 123
124 void PrintDebug(AliHLTUInt32_t * buffer, Int_t size);
bd1ecd64 125
6af4f584 126protected:
127
128 // Protected functions to implement AliHLTComponent's interface.
129 // These functions provide initialization as well as the actual processing capabilities of the component.
130
131 int DoInit( int argc, const char** argv );
132 int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
133 AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
134 AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
135 int DoDeinit();
136
4cbe4128 137 int Reconfigure(const char* cdbEntry, const char* chainId);
6af4f584 138
139 using AliHLTProcessor::DoEvent;
4cbe4128 140
6af4f584 141private:
142
84e36c27 143 int ScanConfigurationArgument(int argc, const char** argv);
6af4f584 144
145 /** copy constructor prohibited */
146 AliHLTTPCHWClusterTransformComponent(const AliHLTTPCHWClusterTransformComponent&);
147
148 /** assignment operator prohibited */
149 AliHLTTPCHWClusterTransformComponent& operator=(const AliHLTTPCHWClusterTransformComponent&);
84e36c27 150
58df4cfa 151 static const char* fgkOCDBEntryHWTransform; //!transient
152
4cbe4128 153 Bool_t fDataId;
4cbe4128 154 AliHLTTPCClusterTransformation fTransform;
e9530747 155 Bool_t fPublishRawClusters; // publish raw clusters in addition
fd086f6c 156 AliHLTTPCHWCFData* fpDecoder; // decoder
e9530747 157
4cbe4128 158 AliHLTComponentBenchmark fBenchmark; // benchmarks
159
22240104 160 ClassDef(AliHLTTPCHWClusterTransformComponent, 0)
6af4f584 161};
162
163#endif