]>
Commit | Line | Data |
---|---|---|
b0201cbe | 1 | #ifndef ALIHLTMUONHITRECONSTRUCTORCOMPONENT_H |
6253e09b | 2 | #define ALIHLTMUONHITRECONSTRUCTORCOMPONENT_H |
ee3678d3 | 3 | /* This file is property of and copyright by the ALICE HLT Project * |
4 | * ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
b0201cbe | 6 | |
1d8ae082 | 7 | // $Id$ |
b0201cbe | 8 | |
6253e09b | 9 | /// |
10 | /// @file AliHLTMUONHitReconstructorComponent.h | |
ffc1a6f6 | 11 | /// @author Indranil Das <indra.das@saha.ac.in> | <indra.ehep@gmail.com>, Artur Szostak <artursz@iafrica.com> |
7e05ec60 | 12 | /// @date 28 May 2007 |
a6b16447 | 13 | /// @brief Hit Reconstruction processing component for the dimuon HLT. |
6253e09b | 14 | /// |
b0201cbe | 15 | |
154cba94 | 16 | #include "AliHLTMUONProcessor.h" |
93a75941 | 17 | #include "AliHLTMUONHitReconstructor.h" |
b0201cbe | 18 | |
e29a165d | 19 | #if __GNUC__ && __GNUC__ < 3 |
960d54ad | 20 | #define std |
21 | #endif | |
22 | ||
23 | ||
ee3678d3 | 24 | extern "C" struct AliHLTMUONHitRecoLutRow; |
25 | ||
7e05ec60 | 26 | /** |
27 | * @class AliHLTMUONHitReconstructorComponent | |
28 | * @brief A processing component for the dHLT tracker DDL reconstruction. | |
ffc1a6f6 | 29 | * |
30 | * This is the hit reconstruction component which forms part of the online dHLT | |
31 | * reconstruction algorithm. It processes the raw DDL data from a dimuon spectrometer | |
32 | * tracker station, applies simple 3 pad cluster finding and then a centre of gravity | |
33 | * calculation to reconstruct the hit coordinate. | |
34 | * | |
35 | * <h2>General properties:</h2> | |
36 | * | |
37 | * Component ID: \b MUONHitReconstructor <br> | |
38 | * Library: \b libAliHLTMUON.so <br> | |
39 | * Input Data Types: ('DDL_RAW ', 'MUON') <br> | |
4d76a068 | 40 | * Output Data Types: ('RECHITS ', 'MUON'); ('CLUSTERS', 'MUON'); ('CHANNELS', 'MUON') <br> |
ffc1a6f6 | 41 | * |
42 | * <h2>Mandatory arguments:</h2> | |
43 | * \li -ddl <i>number</i> <br> | |
44 | * This indicates the DDL from which the component is expect to receive data | |
45 | * and for which it should load the appropriate electronics mapping lookup | |
46 | * table. | |
47 | * The <i>number</i> should be in the range [13..20], following local dimuon | |
48 | * spectrometer DDL numbering. If either the -ddlid, -lut or -delaysetup | |
49 | * arguments are used, then -ddl becomes optional. <br> | |
50 | * \li -ddlid <i>number</i> <br> | |
51 | * This indicates the DDL by equipment ID, from which the component is expect | |
52 | * to receive data and for which it should load the appropriate electronics | |
53 | * mapping lookup table. | |
54 | * The <i>number</i> should be in the range [2572..2579]. | |
55 | * If either the -ddl, -lut or -delaysetup arguments are used, then -ddlid | |
56 | * becomes optional. <br> | |
57 | * \li -delaysetup <br> | |
58 | * Specifying this option causes the component to initialise the lookup table | |
59 | * and DC cut parameters from CDB only after receiving the first event to | |
60 | * process in DoEvent. | |
61 | * If -ddl or -ddlid were not used, then the DDL number will be taken from | |
62 | * the first block's specification during runtime from the first | |
1d8ae082 | 63 | * event (i.e. Start-of-Run event). |
ffc1a6f6 | 64 | * Using the -lut or -dccut arguments will override loading from CDB for a |
65 | * delayed setup. <br> | |
66 | * | |
67 | * <h2>Optional arguments:</h2> | |
68 | * \li -lut <i>filename</i> <br> | |
69 | * A pree-built lookup table for the electronics mapping and calibration | |
70 | * information can be loaded with this argument. The file should have been | |
71 | * generated with the GenerateLookupTable method. The location of the file | |
72 | * is given by the parameter <i>filename</i> <br> | |
73 | * \li -cdb <br> | |
74 | * Indicates that the component should load from CDB. This option is implicit | |
75 | * if the -cdbpath is given. It will also override the -lut option.<br> | |
76 | * \li -cdbpath <i>path</i> <br> | |
77 | * Specifies the CDB path to use, given by <i>path</i>. This option will override | |
78 | * the CDB path automatically set by the HLT framework. <br> | |
79 | * \li -run <i>number</i> <br> | |
80 | * Specifies the run number to use, given by <i>number</i>. This option will | |
81 | * override the current run number automatically set by the HLT framework. <br> | |
82 | * \li -dccut <i>number</i> <br> | |
83 | * Used to override the DC cut parameter in the CDB with the value given by | |
84 | * <i>number</i>. <br> | |
85 | * \li -warn_on_unexpected_block <br> | |
86 | * This will cause the component to generate warnings when it receives data block | |
87 | * types it does not know how to handle. Without this option the component only | |
88 | * generates debug messages when they are compiled in. <br> | |
a9afae73 | 89 | * \li -tryrecover <i>mode</i> <br> |
ffc1a6f6 | 90 | * This is a special option to the raw data decoder to turn on logic which will |
91 | * try and recover from corrupt raw DDL data. This is off by default. <br> | |
a9afae73 | 92 | * The <i>mode</i> is and optional parameter which can be one of the |
93 | * following: <br> | |
94 | * - full This turns on all recovery logic and the decoder tries is best | |
95 | * to recover from all data corruption. <br> | |
96 | * - skip This will just skip any data structures that are found to be | |
97 | * corrupt in the raw data, without trying to recover the data inside. <br> | |
98 | * - parityerrors Will only continue decoding if parity errors are found | |
99 | * but the decoder will stop if any other corruption is found. <br> | |
aae30cc5 | 100 | * if no <i>mode</i> option is specified then full recovery logic is enabled. <br> |
a9afae73 | 101 | * \li -skipparityerrors <br> |
102 | * Skips any ADC digit data words that contain parity errors. <br> | |
103 | * \li -dontprintparityerrors <br> | |
104 | * If specified then no error or warning messages are printed if any parity | |
105 | * errors are found in the ADC digit data words. <br> | |
90af8855 | 106 | * \li -useidealgain <br> |
107 | * When this option is used then the gain correction parameters are not loaded | |
108 | * from the CDB but ideal linear gain is assumed. <br> | |
83d66053 | 109 | * \li -makeclusters <br> |
110 | * This option will cause the component to generate extra cluster information | |
111 | * in the form of CLUSTERS data blocks. <br> | |
112 | * \li -makechannels <br> | |
113 | * This option will cause the component to generate extra channel information | |
114 | * for each cluster found in the form of CHANNELS data blocks. <br> | |
56f0ccdf | 115 | * \li -warnifpadskipped <br> |
116 | * If this option is set the a warning message is generated for every pad that | |
117 | * is skipped because it contains invalid value markers in the calibration data. <br> | |
1d8ae082 | 118 | * \li -dumponerror <br> |
119 | * This flag will cause the component to dump the data blocks it received if | |
120 | * an error occurs during the processing of an event. <br> | |
121 | * \li -dumppath <i>path</i> <br> | |
122 | * Allows one to specify the path in which to dump the received data blocks | |
123 | * if an error occurs. <br> | |
ffc1a6f6 | 124 | * |
125 | * <h2>Standard configuration:</h2> | |
126 | * This component should normally be configured with either of the two sets of | |
127 | * options in the XML configuration. <br> | |
128 | * \li -delaysetup <br> | |
129 | * \li -ddlid ${DDL_ID} <br> | |
130 | * | |
131 | * <h2>Default CDB entries:</h2> | |
132 | * The component loads electronics mapping and calibration information from the MUON | |
133 | * subdirectory in the CDB, MUON/Calib and MUON/Align. | |
134 | * The DC cut parameter is stored in a TMap under HLT/ConfigMUON/HitReconstructor | |
135 | * with a default value of 50 ADC channels. | |
136 | * | |
137 | * <h2>Performance:</h2> | |
138 | * Can achieve about 2kHz processing rate for nominal event sizes containing | |
139 | * 150 tracks per event. | |
140 | * | |
141 | * <h2>Memory consumption:</h2> | |
142 | * The lookup table requires about 3.5 MBytes of memory. | |
143 | * | |
144 | * <h2>Output size:</h2> | |
145 | * Output size is about 10% of incoming raw input data for nominal p+p events. | |
146 | * | |
147 | * @ingroup alihlt_dimuon_component | |
7e05ec60 | 148 | */ |
154cba94 | 149 | class AliHLTMUONHitReconstructorComponent : public AliHLTMUONProcessor |
960d54ad | 150 | { |
ee3678d3 | 151 | public: |
960d54ad | 152 | AliHLTMUONHitReconstructorComponent(); |
153 | virtual ~AliHLTMUONHitReconstructorComponent(); | |
154 | ||
155 | // Public functions to implement AliHLTComponent's interface. | |
156 | // These functions are required for the registration process | |
157 | ||
6253e09b | 158 | virtual const char* GetComponentID(); |
ffb64d3e | 159 | virtual void GetInputDataTypes(AliHLTComponentDataTypeList& list); |
6253e09b | 160 | virtual AliHLTComponentDataType GetOutputDataType(); |
4d76a068 | 161 | virtual int GetOutputDataTypes(AliHLTComponentDataTypeList& list); |
ffb64d3e | 162 | virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier); |
6253e09b | 163 | virtual AliHLTComponent* Spawn(); |
960d54ad | 164 | |
93a75941 | 165 | /** |
dba14d7d | 166 | * Generates an ASCII text file containing the lookup table (LUT) from |
93a75941 | 167 | * the CDB, which can be used for the hit reconstructor component later. |
168 | * @param ddl Must be the DDL for which to generate the DDL, | |
169 | * in the range [12..19]. | |
170 | * @param filename The name of the LUT file to generate. | |
171 | * @param cdbPath The CDB path to use. | |
172 | * @param run The run number to use for the CDB. | |
173 | * @return True if the generation of the LUT file succeeded. | |
174 | */ | |
175 | static bool GenerateLookupTable( | |
176 | AliHLTInt32_t ddl, const char* filename, | |
177 | const char* cdbPath, Int_t run | |
178 | ); | |
179 | ||
ee3678d3 | 180 | protected: |
960d54ad | 181 | |
182 | // Protected functions to implement AliHLTComponent's interface. | |
183 | // These functions provide initialization as well as the actual processing | |
dba14d7d | 184 | // capabilities of the component. |
960d54ad | 185 | |
6253e09b | 186 | virtual int DoInit(int argc, const char** argv); |
ffc1a6f6 | 187 | virtual int Reconfigure(const char* cdbEntry, const char* componentId); |
188 | virtual int ReadPreprocessorValues(const char* modules); | |
6253e09b | 189 | virtual int DoDeinit(); |
190 | virtual int DoEvent( | |
960d54ad | 191 | const AliHLTComponentEventData& evtData, |
192 | const AliHLTComponentBlockData* blocks, | |
193 | AliHLTComponentTriggerData& trigData, | |
ee3678d3 | 194 | AliHLTUInt8_t* outputPtr, |
960d54ad | 195 | AliHLTUInt32_t& size, |
ffb64d3e | 196 | AliHLTComponentBlockDataList& outputBlocks |
960d54ad | 197 | ); |
198 | ||
6253e09b | 199 | using AliHLTProcessor::DoEvent; |
200 | ||
ee3678d3 | 201 | private: |
6253e09b | 202 | |
203 | // Do not allow copying of this class. | |
dba14d7d | 204 | /// Not implemented. |
6253e09b | 205 | AliHLTMUONHitReconstructorComponent(const AliHLTMUONHitReconstructorComponent& /*obj*/); |
dba14d7d | 206 | /// Not implemented. |
6253e09b | 207 | AliHLTMUONHitReconstructorComponent& operator = (const AliHLTMUONHitReconstructorComponent& /*obj*/); |
960d54ad | 208 | |
a6b16447 | 209 | void FreeMemory(); |
93a75941 | 210 | int ReadLookUpTable(const char* lutpath); |
ffc1a6f6 | 211 | int ReadLutFromCDB(); |
2b7af22a | 212 | int ReadDCCutFromCDB(); |
93a75941 | 213 | |
7e05ec60 | 214 | AliHLTMUONHitReconstructor* fHitRec; ///< Internal class instance implementing the hit reconstruction algorithm. |
215 | AliHLTInt32_t fDDL; ///< DDL number in the range [12..19]. Set to -1 for invalid/unspecified value. | |
216 | AliHLTUInt32_t fLutSize; ///< The number of rows / entries in the LUT. | |
217 | AliHLTMUONHitRecoLutRow* fLut; ///< The lookup table used by the hit reconstruction algorithm (Owned by this component however). | |
218 | IdManuChannelToEntry fIdToEntry; ///< id to line mapping. | |
83d66053 | 219 | MaxEntryPerBusPatch fMaxEntryPerBusPatch ;///< map to load maximum allowed buspatch entries for each buspatch |
7e05ec60 | 220 | bool fWarnForUnexpecedBlock; ///< Flag indicating if we should log a warning if we got a block of an unexpected type. |
90af8855 | 221 | bool fUseIdealGain; ///< Flag to indicate that ideal gain should be used and not loaded from the CDB. |
56f0ccdf | 222 | bool fWarnIfPadSkipped; ///< Flag for controlling if extensive warnings should be generated when skipping pads. |
ee3678d3 | 223 | |
7e05ec60 | 224 | ClassDef(AliHLTMUONHitReconstructorComponent, 0) // Hit reconstructor component for dHLT tracker DDL raw data. |
b0201cbe | 225 | }; |
226 | ||
227 | #endif // ALIHLTMUONHITRECONSTRUCTORCOMPONENT_H |