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