]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/tracking-ca/AliHLTTPCCAStandaloneFramework.h
Update master to aliroot
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCAStandaloneFramework.h
CommitLineData
6de2bc40 1//-*- Mode: C++ -*-
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 *
6// *
7//*************************************************************************
8
9#ifndef ALIHLTTPCCASTANDALONEFRAMEWORK_H
10#define ALIHLTTPCCASTANDALONEFRAMEWORK_H
11
12#include "AliHLTTPCCADef.h"
2fba026d 13#if defined(HLTCA_STANDALONE) & defined(HLTCA_STANDALONE_OLD_MERGER)
6f0cdd46 14#include "AliHLTTPCCAMerger.h"
15#define AliHLTTPCGMMerger AliHLTTPCCAMerger
16#else
6d869045 17#include "AliHLTTPCGMMerger.h"
6f0cdd46 18#endif
6de2bc40 19#include "AliHLTTPCCAClusterData.h"
b22af1bf 20#include "AliHLTTPCCATrackerFramework.h"
6de2bc40 21#include <iostream>
7be9b0d7 22#include <fstream>
6de2bc40 23
24/**
25 * @class AliHLTTPCCAStandaloneFramework
26 *
27 * The class to run the HLT TPC reconstruction (36 CA slice trackers + CA merger )
b8139972 28 * in a stand-alone mode.
6de2bc40 29 * Used by AliTPCtrackerCA, the CA event display, CA performance.
30 *
31 */
32class AliHLTTPCCAStandaloneFramework
33{
f0bada7f 34#ifdef HLTCA_STANDALONE
35 friend int DrawGLScene();
36#endif
6de2bc40 37
38 public:
39
40 AliHLTTPCCAStandaloneFramework();
41 ~AliHLTTPCCAStandaloneFramework();
42
43 static AliHLTTPCCAStandaloneFramework &Instance();
44
b22af1bf 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)); }
98512261 47 const AliHLTTPCCASliceOutput &Output( int iSlice ) const { return *fSliceOutput[iSlice]; }
6d869045 48 AliHLTTPCGMMerger &Merger() { return fMerger; }
b8139972 49 AliHLTTPCCAClusterData &ClusterData( int iSlice ) { return fClusterData[iSlice]; }
6de2bc40 50
51 /**
52 * prepare for reading of the event
53 */
54 void StartDataReading( int guessForNumberOfClusters = 256 );
55
56 /**
57 * read next cluster
58 */
b8139972 59 void ReadCluster( int id, int iSlice, int iRow, float X, float Y, float Z, float Amp ) {
6de2bc40 60 fClusterData[iSlice].ReadCluster( id, iRow, X, Y, Z, Amp );
61 }
62
63 /**
64 * finish reading of the event
65 */
66 void FinishDataReading();
67
68 /**
69 * perform event reconstruction
70 */
f0bada7f 71 int ProcessEvent(int forceSingleSlice = -1);
6de2bc40 72
73
74 int NSlices() const { return fgkNSlices; }
75
76 double LastTime( int iTimer ) const { return fLastTime[iTimer]; }
77 double StatTime( int iTimer ) const { return fStatTime[iTimer]; }
78 int StatNEvents() const { return fStatNEvents; }
b8139972 79
6de2bc40 80 void WriteSettings( std::ostream &out ) const;
81 void WriteEvent( std::ostream &out ) const;
82 void WriteTracks( std::ostream &out ) const;
b8139972 83
6de2bc40 84 void ReadSettings( std::istream &in );
7be9b0d7 85 void ReadEvent( std::istream &in );
6de2bc40 86 void ReadTracks( std::istream &in );
87
b22af1bf 88 int InitGPU(int sliceCount = 1, int forceDeviceID = -1) { return(fTracker.InitGPU(sliceCount, forceDeviceID)); }
89 int ExitGPU() { return(fTracker.ExitGPU()); }
2fba026d 90 void SetGPUDebugLevel(int Level, std::ostream *OutFile = NULL, std::ostream *GPUOutFile = NULL) { fDebugLevel = Level; fTracker.SetGPUDebugLevel(Level, OutFile, GPUOutFile); fMerger.SetDebugLevel(Level);}
b22af1bf 91 int SetGPUTrackerOption(char* OptionName, int OptionValue) {return(fTracker.SetGPUTrackerOption(OptionName, OptionValue));}
92 int SetGPUTracker(bool enable) { return(fTracker.SetGPUTracker(enable)); }
d4594e7d 93 int GetGPUStatus() const { return(fTracker.GetGPUStatus()); }
94 int GetGPUMaxSliceCount() const { return(fTracker.MaxSliceCount()); }
f0bada7f 95 void SetEventDisplay(int v) {fEventDisplay = v;}
96 void SetRunMerger(int v) {fRunMerger = v;}
b22af1bf 97
98 int InitializeSliceParam(int iSlice, AliHLTTPCCAParam& param) { return(fTracker.InitializeSliceParam(iSlice, param)); }
cf9f6481 99 void SetOutputControl(char* ptr, size_t size) {fOutputControl.fOutputPtr = ptr;fOutputControl.fOutputMaxSize = size;}
b22af1bf 100
6de2bc40 101 private:
102
103 static const int fgkNSlices = 36; //* N slices
104
105 AliHLTTPCCAStandaloneFramework( const AliHLTTPCCAStandaloneFramework& );
106 const AliHLTTPCCAStandaloneFramework &operator=( const AliHLTTPCCAStandaloneFramework& ) const;
107
6d869045 108 AliHLTTPCGMMerger fMerger; //* global merger
6de2bc40 109 AliHLTTPCCAClusterData fClusterData[fgkNSlices];
98512261 110 AliHLTTPCCASliceOutput* fSliceOutput[fgkNSlices];
d4594e7d 111 AliHLTTPCCASliceOutput::outputControlStruct fOutputControl;
6de2bc40 112
b22af1bf 113 AliHLTTPCCATrackerFramework fTracker;
7be9b0d7 114
6de2bc40 115 double fLastTime[20]; //* timers
116 double fStatTime[20]; //* timers
117 int fStatNEvents; //* n events proceed
7be9b0d7 118
f0bada7f 119 int fDebugLevel; //Tracker Framework Debug Level
120 int fEventDisplay; //Display event in Standalone Event Display
121 int fRunMerger; //Run Track Merger
6de2bc40 122};
123
31649d4b 124#endif //ALIHLTTPCCASTANDALONEFRAMEWORK_H