]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/OnlineAnalysis/AliHLTMUONHitReconstructorComponent.h
82cbbdc4a52aa55c7342256f0780a9047e14b6fd
[u/mrichter/AliRoot.git] / HLT / MUON / OnlineAnalysis / AliHLTMUONHitReconstructorComponent.h
1 #ifndef ALIHLTMUONHITRECONSTRUCTORCOMPONENT_H
2 #define ALIHLTMUONHITRECONSTRUCTORCOMPONENT_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   AliHLTMUONHitReconstructorComponent.h
11 ///  @author Indranil Das <indra.das@saha.ac.in> | <indra.ehep@gmail.com>
12 ///  @date   28 May 2007
13 ///  @brief  Hit Reconstruction processing component for the dimuon HLT.
14 ///
15
16 #include "AliHLTMUONProcessor.h"
17 #include "AliHLTMUONHitReconstructor.h"
18
19 #if __GNUC__ && __GNUC__ < 3
20 #define std
21 #endif
22
23
24 extern "C" struct AliHLTMUONHitRecoLutRow;
25
26 /**
27  * @class AliHLTMUONHitReconstructorComponent
28  * @brief A processing component for the dHLT tracker DDL reconstruction.
29  */
30 class AliHLTMUONHitReconstructorComponent : public AliHLTMUONProcessor
31 {
32 public:
33         AliHLTMUONHitReconstructorComponent();
34         virtual ~AliHLTMUONHitReconstructorComponent();
35
36         // Public functions to implement AliHLTComponent's interface.
37         // These functions are required for the registration process
38
39         virtual const char* GetComponentID();
40         virtual void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
41         virtual AliHLTComponentDataType GetOutputDataType();
42         virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
43         virtual AliHLTComponent* Spawn();
44         
45         /**
46          * Generates an ASCII text file containing the lookup table (LUT) from
47          * the CDB, which can be used for the hit reconstructor component later.
48          * @param ddl  Must be the DDL for which to generate the DDL,
49          *             in the range [12..19].
50          * @param filename  The name of the LUT file to generate.
51          * @param cdbPath  The CDB path to use.
52          * @param run  The run number to use for the CDB.
53          * @return  True if the generation of the LUT file succeeded.
54          */
55         static bool GenerateLookupTable(
56                         AliHLTInt32_t ddl, const char* filename,
57                         const char* cdbPath, Int_t run
58                 );
59         
60 protected:
61         
62         // Protected functions to implement AliHLTComponent's interface.
63         // These functions provide initialization as well as the actual processing
64         // capabilities of the component.
65
66         virtual int DoInit(int argc, const char** argv);
67         virtual int DoDeinit();
68         virtual int DoEvent(
69                         const AliHLTComponentEventData& evtData,
70                         const AliHLTComponentBlockData* blocks,
71                         AliHLTComponentTriggerData& trigData,
72                         AliHLTUInt8_t* outputPtr,
73                         AliHLTUInt32_t& size,
74                         std::vector<AliHLTComponentBlockData>& outputBlocks
75                 );
76         
77         using AliHLTProcessor::DoEvent;
78         
79 private:
80
81         // Do not allow copying of this class.
82         /// Not implemented.
83         AliHLTMUONHitReconstructorComponent(const AliHLTMUONHitReconstructorComponent& /*obj*/);
84         /// Not implemented.
85         AliHLTMUONHitReconstructorComponent& operator = (const AliHLTMUONHitReconstructorComponent& /*obj*/);
86         
87         void FreeMemory();
88         int ReadLookUpTable(const char* lutpath);
89         int ReadCDB(const char* cdbpath, Int_t run);
90         
91         AliHLTMUONHitReconstructor* fHitRec;  ///< Internal class instance implementing the hit reconstruction algorithm.
92         AliHLTInt32_t fDDL;  ///< DDL number in the range [12..19]. Set to -1 for invalid/unspecified value.
93         AliHLTUInt32_t fLutSize;  ///< The number of rows / entries in the LUT.
94         AliHLTMUONHitRecoLutRow* fLut;  ///< The lookup table used by the hit reconstruction algorithm (Owned by this component however).
95         IdManuChannelToEntry fIdToEntry; ///< id to line mapping.
96         bool fWarnForUnexpecedBlock;  ///< Flag indicating if we should log a warning if we got a block of an unexpected type.
97         
98         ClassDef(AliHLTMUONHitReconstructorComponent, 0) // Hit reconstructor component for dHLT tracker DDL raw data.
99 };
100
101 #endif // ALIHLTMUONHITRECONSTRUCTORCOMPONENT_H