2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * All rights reserved. *
6 * Primary Authors: Per Thomas Hille, Oystein Djuvsland *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
18 #ifndef ALIHLTCALORAWANALYZERCOMPONENTV3_H
19 #define ALIHLTCALORAWANALYZERCOMPONENTV3_H
23 * Raw data analyzer component base class for PHOS HLT
25 * @file AliHLTCaloRawAnalyzerComponentv3.h
26 * @author Oystein Djuvsland
28 * @brief Extraction of Amplitude and Peak position for PHOS/EMCAL HLT
31 // see below for class documentation
33 // refer to README to build package
35 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
38 class AliCaloRawAnalyzer;
39 class AliHLTCaloRcuCellEnergyDataStruct;
40 class AliHLTCaloMapper;
41 class AliHLTCaloSanityInspector;
42 class AliHLTCaloDigitMaker;
43 class AliHLTCaloDigitContainerDataStruct;
44 class AliRawReaderMemory;
45 class AliAltroRawStreamV3;
49 * @class AliHLTCaloRawAnalyzerComponentv3
50 * This the new and fast version of the component taking care of the decoding and energy and timing
51 * extraction of the raw data from PHOS.
53 * <h2>General properties:</h2>
55 * Component ID: \b PhosRawAnalyzerv3 <br>
56 * Library: \b libAliHLTCalo.so <br>
57 * Input Data Types: @ref <br>
58 * Output Data Types: @ref AliHLTCaloDefinitions::fgkChannelDataType<br>
60 * <h2>Mandatory arguments:</h2>
61 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
62 * \li No mandatory arguments for component <br>
64 * <h2>Optional arguments:</h2>
65 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
66 * \li -offset <i> value </i> <br>
67 * gives the offset added to the data during zero suppression (default value: 0)
68 * \li -bunchsizecut <i> value </i> <br>
69 * minimum number of samples a bunch must contain to be considered (default value: 0)
70 * \li -minpeakposition <i> value </i> <br>
71 * cut on minimum postion of the peak in the bunch (defaul value: 0)
72 * \li -maxpeakposition <i> value </i> <br>
73 * cut on maximum postion of the peak in the bunch (defaul value: 100)
75 * <h2>Configuration:</h2>
76 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
77 * \li No configuration arguments
79 * <h2>Default CDB entries:</h2>
80 * \li No CDB entry yet, will come.
82 * <h2>Performance:</h2>
83 * Pretty good (~ 3 kHz), depends on amount of data...
85 * <h2>Memory consumption:</h2>
86 * Depends on the amount of data, but pretty godd
88 * <h2>Output size:</h2>
89 * Depends on the amount of data...
91 * More detailed description. (Soon)
93 * @ingroup alihlt_phos
97 // #include "AliHLTProcessor.h"
98 // #include "AliHLTCaloDefinitions.h"
100 #include "AliHLTCaloConstantsHandler.h"
101 #include "AliHLTCaloProcessor.h"
102 #include "AliCaloRawAnalyzer.h"
105 #include "AliCaloConstants.h"
106 using namespace Algo;
108 class AliHLTCaloMapper;
111 class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloProcessor, protected AliHLTCaloConstantsHandler
115 /** Constructor must be initialized to specific calorimeter */
116 AliHLTCaloRawAnalyzerComponentv3(TString det, fitAlgorithm algo );
117 virtual ~AliHLTCaloRawAnalyzerComponentv3();
118 virtual int DoInit(int argc =0, const char** argv = 0) ;
119 virtual int DoDeinit();
120 virtual const char* GetComponentID() = 0;
121 virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list) = 0;
122 virtual AliHLTComponentDataType GetOutputDataType() = 0;
123 virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
124 virtual AliHLTComponent* Spawn() = 0;
127 bool CheckInputDataType(const AliHLTComponentDataType &datatype);
128 virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
129 AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
130 AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
134 * Do the real processing in the component
135 * @param iter is the pointer to the data blocks
136 * @param outputPtr is the pointer to the output buffer
137 * @param size is the available size for output
138 * @param totSize is the total size used for output
139 * @return the size output size used
141 virtual Int_t DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr,
142 const AliHLTUInt32_t size, UInt_t& totSize);
146 virtual void InitMapping(const int specification ) = 0;
147 void PrintDebugInfo();
148 AliCaloRawAnalyzer *fAnalyzerPtr; //COMMENT
149 AliHLTCaloMapper *fMapperPtr; //COMMENT
150 AliHLTUInt32_t fCurrentSpec; // Data specification (RCU)
151 bool fDebug; // Turn on to enable debug info
154 AliHLTCaloRawAnalyzerComponentv3();
155 AliHLTCaloRawAnalyzerComponentv3(const AliHLTCaloRawAnalyzerComponentv3 & );
156 AliHLTCaloRawAnalyzerComponentv3 & operator = (const AliHLTCaloRawAnalyzerComponentv3 &);
157 AliHLTCaloSanityInspector *fSanityInspectorPtr; //!transient /** Pointer to object which may check the integrity of the data */
159 /** Pointer to the raw data reader which reads from memory */
160 AliRawReaderMemory* fRawReaderMemoryPtr; //!transient
162 /** Pointer to the raw stream */
163 AliAltroRawStreamV3* fAltroRawStreamPtr; //!transient
165 /** Describing which algorithm we are using */
166 Short_t fAlgorithm; //COMMENT
168 /** The offset applied before ZS */
169 Int_t fOffset; //COMMENT
171 /** The minimum length a bunch can have to be considered */
172 Int_t fBunchSizeCut; //COMMENT
174 /** The lowest position a peak can have to be considered */
175 Int_t fMinPeakPosition; //COMMENT
177 /** The maximum position a peak can have to be considered */
178 Int_t fMaxPeakPosition; //COMMENT
180 /** Should we push the raw data when the channel is crazy? */
181 Bool_t fDoPushBadRawData; //COMMENT
183 /** Should we push all raw data (using the raw data writer) */
184 Bool_t fDoPushRawData; //COMMENT
189 RawDataWriter(AliHLTCaloConstants* cConst);
190 virtual ~RawDataWriter();
192 void WriteBunchData(const UShort_t *bunchdata, const int length, const UInt_t starttimebin );
194 void SetChannelId( const UShort_t channeldid );
195 int CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused );
200 RawDataWriter (const RawDataWriter & );
201 RawDataWriter & operator = (const RawDataWriter &);
203 UShort_t* fRawDataBuffer; // Buffer for storing of rawdata
204 int fCurrentChannelSize; //Comment
205 int fBufferIndex; //Position in buffer
206 int fBufferSize; //Comment
207 UShort_t *fCurrentChannelIdPtr; //Channel ID (module, row, column)
208 UShort_t *fCurrentChannelSizePtr; //Comment
209 UShort_t *fCurrentChannelDataPtr; //Comment
210 int fTotalSize; //Comment
213 RawDataWriter *fRawDataWriter;
214 ClassDef(AliHLTCaloRawAnalyzerComponentv3, 1)