]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/OnlineAnalysis/AliHLTMUONClusterFinderComponent.h
ALIROOT-5433 Transition to CDHv3 in HLT
[u/mrichter/AliRoot.git] / HLT / MUON / OnlineAnalysis / AliHLTMUONClusterFinderComponent.h
1 #ifndef ALIHLTMUONCLUSTERFINDERCOMPONENT_H
2 #define ALIHLTMUONCLUSTERFINDERCOMPONENT_H
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                               */
6
7 // $Id: $
8
9 ///
10 ///  @file   AliHLTMUONClusterFinderComponent.h
11 ///  @author Artur Szostak <artursz@iafrica.com>
12 ///  @date   28 May 2007
13 ///  @brief  Cluster finder component for the dimuon HLT derived from offline code.
14 ///
15
16 #include "AliHLTMUONProcessor.h"
17
18 #if __GNUC__ && __GNUC__ < 3
19 #define std
20 #endif
21
22 class AliRawReaderMemory;
23 class AliMUONDigitMaker;
24 class AliMUONGeometryTransformer;
25 class AliMUONCalibrationData;
26 class AliMUONDigitCalibrator;
27 class AliMUONVClusterFinder;
28 class AliMUONSimpleClusterServer;
29 class AliMUONRecoParam;
30
31 /**
32  * @class AliHLTMUONClusterFinderComponent
33  * @brief Cluster finding component for the dHLT tracker DDL raw data.
34  *
35  * This cluster finder component runs offline algorithms online within HLT.
36  * It processes the raw DDL data from dimuon spectrometer tracker stations
37  * and returns the cluster information in the offline cluster store format or
38  * dHLT internal hit coordinate format.
39  *
40  * <h2>General properties:</h2>
41  *
42  * Component ID: \b MUONClusterFinder <br>
43  * Library: \b libAliHLTMUON.so <br>
44  * Input Data Types: ('DDL_RAW ', 'MUON') <br>
45  * Output Data Types: ('CLUSTORE', 'MUON'), ('RECHITS ', 'MUON') <br>
46  *
47  * <h2>Mandatory arguments:</h2>
48  * None <br>
49  *
50  * <h2>Optional arguments:</h2>
51  * \li -delaysetup <br>
52  *      Specifying this option causes the component to initialise from CDB only after
53  *      receiving the first (normally Start-of-Run) event to process in DoEvent. <br>
54  * \li -cdbpath <i>path</i> <br>
55  *      Specifies the CDB path to use, given by <i>path</i>. This option will override
56  *      the CDB path automatically set by the HLT framework. <br>
57  * \li -run <i>number</i> <br>
58  *      Specifies the run number to use, given by <i>number</i>. This option will
59  *      override the current run number automatically set by the HLT framework. <br>
60  * \li -dumponerror <br>
61  *      This flag will cause the component to dump the data blocks it received if
62  *      an error occurs during the processing of an event. <br>
63  * \li -dumppath <i>path</i> <br>
64  *      Allows one to specify the path in which to dump the received data blocks
65  *      if an error occurs. <br>
66  * \li -tryrecover <br>
67  *      This is a special option to the raw data decoder to turn on logic which will
68  *      try and recover from corrupt raw DDL data. This is off by default. <br>
69  * \li -nostore <br>
70  *      If specified then the AliMUONVClusterStore object generated by the offline
71  *      reconstruction code is not added to the output data. The default to send this object. <br>
72  * \li -makehits <br>
73  *      If specified then the clusters found by the offline reconstruction algorithm are
74  *      converted to internal dHLT reconstructed hit format and a reconstructed hits data
75  *      block is generated. The default is not to write in dHLT internal format since the
76  *      closter store object is already written by default. <br>
77  *
78  * <h2>Standard configuration:</h2>
79  * This component should normally be configured with no extra options in the XML
80  * configuration. <br>
81  *
82  * <h2>Default CDB entries:</h2>
83  * The component loads electronics mapping and calibration information from the MUON
84  * subdirectory in the CDB, MUON/Calib and MUON/Align.
85  *
86  * <h2>Performance:</h2>
87  * A few tens of Hertz during online running.
88  *
89  * <h2>Memory consumption:</h2>
90  * A few MBytes.
91  *
92  * <h2>Output size:</h2>
93  * Output size is about 25% of incoming raw input data for nominal p+p events.
94  *
95  * @ingroup alihlt_muon_components
96  */
97 class AliHLTMUONClusterFinderComponent : public AliHLTMUONProcessor
98 {
99 public:
100         AliHLTMUONClusterFinderComponent();
101         virtual ~AliHLTMUONClusterFinderComponent();
102
103         // Public functions to implement AliHLTComponent's interface.
104         // These functions are required for the registration process
105
106         virtual const char* GetComponentID();
107         virtual void GetInputDataTypes(AliHLTComponentDataTypeList& list);
108         virtual AliHLTComponentDataType GetOutputDataType();
109         virtual int GetOutputDataTypes(AliHLTComponentDataTypeList& list);
110         virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
111         virtual AliHLTComponent* Spawn();
112         
113 protected:
114         
115         // Protected functions to implement AliHLTComponent's interface.
116         // These functions provide initialization as well as the actual processing
117         // capabilities of the component.
118
119         virtual int DoInit(int argc, const char** argv);
120         virtual int Reconfigure(const char* cdbEntry, const char* componentId);
121         virtual int ReadPreprocessorValues(const char* modules);
122         virtual int DoDeinit();
123         virtual int DoEvent(
124                         const AliHLTComponentEventData& evtData,
125                         const AliHLTComponentBlockData* blocks,
126                         AliHLTComponentTriggerData& trigData,
127                         AliHLTUInt8_t* outputPtr,
128                         AliHLTUInt32_t& size,
129                         AliHLTComponentBlockDataList& outputBlocks
130                 );
131         
132         using AliHLTProcessor::DoEvent;
133         
134 private:
135
136         // Do not allow copying of this class.
137         /// Not implemented.
138         AliHLTMUONClusterFinderComponent(const AliHLTMUONClusterFinderComponent& /*obj*/);
139         /// Not implemented.
140         AliHLTMUONClusterFinderComponent& operator = (const AliHLTMUONClusterFinderComponent& /*obj*/);
141         
142         void FreeObjects();
143
144         int ReadConfigFromCDB(
145                         bool loadParams = true,
146                         bool loadMapping = true,
147                         bool loadGeom = true,
148                         bool loadCalib = true
149                 );
150         
151         AliRawReaderMemory* fRawReader;  ///< Raw reader for decoding input data for offline code.
152         AliMUONDigitMaker* fDigitMaker;  ///< Digit maker to convert raw DDL data to digits.
153         AliMUONGeometryTransformer* fTransformer;  ///< Transformer for geometry information.
154         AliMUONCalibrationData* fCalibrationData;  ///< Calibration data object for calibrating digits.
155         AliMUONDigitCalibrator* fDigitCalibrator;  ///< The object which performs calibration of digits.
156         AliMUONVClusterFinder* fClusterFinder;  ///< Cluster finder implementing offline algorithm.
157         AliMUONSimpleClusterServer* fClusterServer;  ///< Object for driving the cluster finder.
158         AliMUONRecoParam* fRecoParam;  ///< Reconstruction parameters for offline code.
159         
160         bool fMakeClusterStore;  ///< Indicates if the cluster store object will be generated.
161         bool fMakeRecHits;  ///< Indicates if the output will be in dHLT internal reconstructed hit format.
162         
163         ClassDef(AliHLTMUONClusterFinderComponent, 0) // Cluster finder component for dHLT running offline algorithms.
164 };
165
166 #endif // ALIHLTMUONCLUSTERFINDERCOMPONENT_H
167