2 // ************************************************************************
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 *
7 //*************************************************************************
9 #ifndef ALIHLTTPCCASTANDALONEFRAMEWORK_H
10 #define ALIHLTTPCCASTANDALONEFRAMEWORK_H
12 #include "AliHLTTPCCADef.h"
13 #if defined(HLTCA_STANDALONE) & defined(HLTCA_STANDALONE_OLD_MERGER)
14 #include "AliHLTTPCCAMerger.h"
15 #define AliHLTTPCGMMerger AliHLTTPCCAMerger
17 #include "AliHLTTPCGMMerger.h"
19 #include "AliHLTTPCCAClusterData.h"
20 #include "AliHLTTPCCATrackerFramework.h"
25 * @class AliHLTTPCCAStandaloneFramework
27 * The class to run the HLT TPC reconstruction (36 CA slice trackers + CA merger )
28 * in a stand-alone mode.
29 * Used by AliTPCtrackerCA, the CA event display, CA performance.
32 class AliHLTTPCCAStandaloneFramework
34 #ifdef HLTCA_STANDALONE
35 friend int DrawGLScene();
40 AliHLTTPCCAStandaloneFramework();
41 ~AliHLTTPCCAStandaloneFramework();
43 static AliHLTTPCCAStandaloneFramework &Instance();
45 const AliHLTTPCCAParam &Param ( int iSlice ) const { return(fTracker.Param(iSlice)); }
46 const AliHLTTPCCARow &Row ( int iSlice, int iRow ) const { return(fTracker.Row(iSlice, iRow)); }
47 const AliHLTTPCCASliceOutput &Output( int iSlice ) const { return *fSliceOutput[iSlice]; }
48 AliHLTTPCGMMerger &Merger() { return fMerger; }
49 AliHLTTPCCAClusterData &ClusterData( int iSlice ) { return fClusterData[iSlice]; }
52 * prepare for reading of the event
54 void StartDataReading( int guessForNumberOfClusters = 256 );
59 void ReadCluster( int id, int iSlice, int iRow, float X, float Y, float Z, float Amp ) {
60 fClusterData[iSlice].ReadCluster( id, iRow, X, Y, Z, Amp );
64 * finish reading of the event
66 void FinishDataReading();
69 * perform event reconstruction
71 int ProcessEvent(int forceSingleSlice = -1);
74 int NSlices() const { return fgkNSlices; }
76 double LastTime( int iTimer ) const { return fLastTime[iTimer]; }
77 double StatTime( int iTimer ) const { return fStatTime[iTimer]; }
78 int StatNEvents() const { return fStatNEvents; }
80 void WriteSettings( std::ostream &out ) const;
81 void WriteEvent( std::ostream &out ) const;
82 void WriteTracks( std::ostream &out ) const;
84 void ReadSettings( std::istream &in );
85 void ReadEvent( std::istream &in );
86 void ReadTracks( std::istream &in );
88 int InitGPU(int sliceCount = 1, int forceDeviceID = -1) { return(fTracker.InitGPU(sliceCount, forceDeviceID)); }
89 int ExitGPU() { return(fTracker.ExitGPU()); }
90 void SetGPUDebugLevel(int Level, std::ostream *OutFile = NULL, std::ostream *GPUOutFile = NULL) { fDebugLevel = Level; fTracker.SetGPUDebugLevel(Level, OutFile, GPUOutFile); fMerger.SetDebugLevel(Level);}
91 int SetGPUTrackerOption(char* OptionName, int OptionValue) {return(fTracker.SetGPUTrackerOption(OptionName, OptionValue));}
92 int SetGPUTracker(bool enable) { return(fTracker.SetGPUTracker(enable)); }
93 int GetGPUStatus() const { return(fTracker.GetGPUStatus()); }
94 int GetGPUMaxSliceCount() const { return(fTracker.MaxSliceCount()); }
95 void SetEventDisplay(int v) {fEventDisplay = v;}
96 void SetRunMerger(int v) {fRunMerger = v;}
98 int InitializeSliceParam(int iSlice, AliHLTTPCCAParam& param) { return(fTracker.InitializeSliceParam(iSlice, param)); }
99 void SetOutputControl(char* ptr, size_t size) {fOutputControl.fOutputPtr = ptr;fOutputControl.fOutputMaxSize = size;}
103 static const int fgkNSlices = 36; //* N slices
105 AliHLTTPCCAStandaloneFramework( const AliHLTTPCCAStandaloneFramework& );
106 const AliHLTTPCCAStandaloneFramework &operator=( const AliHLTTPCCAStandaloneFramework& ) const;
108 AliHLTTPCGMMerger fMerger; //* global merger
109 AliHLTTPCCAClusterData fClusterData[fgkNSlices];
110 AliHLTTPCCASliceOutput* fSliceOutput[fgkNSlices];
111 AliHLTTPCCASliceOutput::outputControlStruct fOutputControl;
113 AliHLTTPCCATrackerFramework fTracker;
115 double fLastTime[20]; //* timers
116 double fStatTime[20]; //* timers
117 int fStatNEvents; //* n events proceed
119 int fDebugLevel; //Tracker Framework Debug Level
120 int fEventDisplay; //Display event in Standalone Event Display
121 int fRunMerger; //Run Track Merger
124 #endif //ALIHLTTPCCASTANDALONEFRAMEWORK_H