1 #ifndef AliHLTMUONMANSOTRACKERFSMCOMPONENT_H
2 #define AliHLTMUONMANSOTRACKERFSMCOMPONENT_H
3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * All rights reserved. *
8 * Artur Szostak <artursz@iafrica.com> *
9 * Indranil Das <indra.das@saha.ac.in> *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
23 /// @file AliHLTMUONMansoTrackerFSMComponent.h
24 /// @author Artur Szostak <artursz@iafrica.com>,
25 /// Indranil Das <indra.das@saha.ac.in>
27 /// @brief Tracker component for the dimuon HLT using the Manso algorithm
28 /// implemented as a finite state machine.
31 #include "AliHLTMUONProcessor.h"
32 #include "AliHLTMUONDataTypes.h"
33 #include "AliHLTMUONMansoTrackerFSMCallback.h"
35 #if __GNUC__ && __GNUC__ < 3
39 class AliHLTMUONMansoTrackerFSM;
40 //class AliHLTMUONMansoTracksBlockWriter;
42 struct AliHLTMUONRecHitStruct;
47 * @class AliHLTMUONMansoTrackerFSMComponent
48 * @brief Dimuon HLT tracker component using the Manso tracking algorithm
49 * implemented as a finite state machine.
51 class AliHLTMUONMansoTrackerFSMComponent
52 : public AliHLTMUONProcessor, public AliHLTMUONMansoTrackerFSMCallback
55 AliHLTMUONMansoTrackerFSMComponent();
56 virtual ~AliHLTMUONMansoTrackerFSMComponent();
58 // Public functions to implement the AliHLTProcessor interface.
59 // These functions are required for the registration process.
60 virtual const char* GetComponentID();
61 virtual void GetInputDataTypes(AliHLTComponentDataTypeList& list);
62 virtual AliHLTComponentDataType GetOutputDataType();
63 virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
64 virtual AliHLTComponent* Spawn();
66 // Inherited from AliHLTMUONMansoTrackerFSMCallback:
67 virtual void RequestClusters(
68 AliHLTMUONMansoTrackerFSM* tracker,
69 AliHLTFloat32_t left, AliHLTFloat32_t right,
70 AliHLTFloat32_t bottom, AliHLTFloat32_t top,
71 AliHLTMUONChamberName chamber, const void* tag
73 virtual void EndOfClusterRequests(AliHLTMUONMansoTrackerFSM* tracker);
74 virtual void FoundTrack(AliHLTMUONMansoTrackerFSM* tracker);
75 virtual void NoTrackFound(AliHLTMUONMansoTrackerFSM* tracker);
79 // Protected functions to implement the AliHLTProcessor interface.
80 // These functions provide initialization as well as the actual processing
81 // capabilities of the component.
82 virtual int DoInit(int argc, const char** argv);
83 virtual int Reconfigure(const char* cdbEntry, const char* componentId);
84 virtual int ReadPreprocessorValues(const char* modules);
85 virtual int DoDeinit();
87 const AliHLTComponentEventData& evtData,
88 const AliHLTComponentBlockData* blocks,
89 AliHLTComponentTriggerData& trigData,
90 AliHLTUInt8_t* outputPtr,
92 AliHLTComponentBlockDataList& outputBlocks
95 using AliHLTProcessor::DoEvent;
99 // Do not allow copying of this class.
100 AliHLTMUONMansoTrackerFSMComponent(const AliHLTMUONMansoTrackerFSMComponent& /*obj*/);
101 AliHLTMUONMansoTrackerFSMComponent& operator = (const AliHLTMUONMansoTrackerFSMComponent& /*obj*/);
107 AliHLTUInt32_t specification,
108 const AliHLTMUONRecHitStruct* recHits,
112 void ResetCanLoadFlags();
113 bool AtLeastOneCanLoadFlagsIsSet() const;
116 * Reads this component's configuration parameters from the CDB.
117 * These include the middle of the dipole Z coordinate (zmiddle), the
118 * integrated magnetic field of the dipole, Z coordinates of the chambers
119 * and the region of interest parameters used during the tracking.
120 * \note Only those parameters are loaded from CDB for which the fCanLoadxyz
122 * \return 0 if no errors occured and negative error code compatible with
123 * the HLT framework on errors.
125 int ReadConfigFromCDB();
128 AliHLTMUONMansoTrackerFSM* fTracker; //! Tracker to do the actual work.
130 AliHLTUInt32_t fTrackCount; //! Number of tracks currently found.
131 /*AliHLTMUONMansoTracksBlockWriter*/void* fBlock; //! The current data block we are writing.
133 class AliRecHitBlockInfo
137 AliRecHitBlockInfo(AliHLTUInt32_t count = 0, const AliHLTMUONRecHitStruct* data = NULL) :
138 fCount(count), fData(data)
141 // Perform a shallow copy.
142 AliRecHitBlockInfo(const AliRecHitBlockInfo& obj) :
143 fCount(obj.fCount), fData(obj.fData)
146 AliRecHitBlockInfo& operator = (const AliRecHitBlockInfo& obj)
153 AliHLTUInt32_t Count() const { return fCount; }
154 const AliHLTMUONRecHitStruct* Data() const { return fData; }
157 AliHLTUInt32_t fCount; // Number of elements in fData.
158 const AliHLTMUONRecHitStruct* fData; // Pointer to the array of rec hits.
161 //std::vector<AliRecHitBlockInfo> fRecHitBlock[4]; //! Arrays of rec hit block data.
162 AliHLTUInt32_t fRecHitBlockArraySize; ///< The array size of each array in fRecHitBlock.
163 AliHLTUInt32_t fRecHitBlockCount[4]; ///< The number of records actually stored in fRecHitBlock[i].
164 // The following are 4 dynamic arrays of AliRecHitBlockInfo structures.
165 // These arrays will all have the same size = fRecHitBlockArraySize.
166 // The array itself is actually allocated only once and the pointer stored in fRecHitBlock[0],
167 // while the other pointers fRecHitBlock[i] {i>0} will just be set relative to fRecHitBlock[0].
168 // The allocated memory is: 4 * fRecHitBlockArraySize * sizeof(AliRecHitBlockInfo).
169 AliRecHitBlockInfo* fRecHitBlock[4]; //! Arrays of rec hit block data.
171 bool fWarnForUnexpecedBlock; ///< Flag indicating if we should log a warning if we got a block of an unexpected type.
172 bool fCanLoadZmiddle; ///< Indicates if the zmiddle parameter can be loaded from CDB.
173 bool fCanLoadBL; ///< Indicates if the bfieldintegral parameter can be loaded from CDB.
174 bool fCanLoadA[4]; ///< Indicates if the roi_paramA_chamber[7..10] parameter can be loaded from CDB.
175 bool fCanLoadB[4]; ///< Indicates if the roi_paramB_chamber[7..10] parameter can be loaded from CDB.
176 bool fCanLoadZ[6]; ///< Indicates if the chamber[7..11,13]postion parameter can be loaded from CDB.
178 ClassDef(AliHLTMUONMansoTrackerFSMComponent, 0); // Manso tracker component implemented as a finite state machine (FSM).
181 #endif // AliHLTMUONMANSOTRACKERFSMCOMPONENT_H