]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCAStandaloneFramework.h
style changes
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCAStandaloneFramework.h
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"
13 #include "AliHLTTPCCATracker.h"
14 #include "AliHLTTPCCAMerger.h"
15 #include "AliHLTTPCCAClusterData.h"
16 #include <iostream>
17
18 /**
19  * @class AliHLTTPCCAStandaloneFramework
20  *
21  * The class to run the HLT TPC reconstruction (36 CA slice trackers + CA merger )
22  * in a stand-alone mode.
23  * Used by AliTPCtrackerCA, the CA event display, CA performance.
24  *
25  */
26 class AliHLTTPCCAStandaloneFramework
27 {
28
29   public:
30
31     AliHLTTPCCAStandaloneFramework();
32     ~AliHLTTPCCAStandaloneFramework();
33
34     static AliHLTTPCCAStandaloneFramework &Instance();
35
36     AliHLTTPCCATracker &SliceTracker( int iSlice )  { return fSliceTrackers[iSlice]; }
37     AliHLTTPCCAMerger  &Merger()  { return fMerger; }
38     AliHLTTPCCAClusterData &ClusterData( int iSlice ) { return fClusterData[iSlice]; }
39
40     /**
41      * prepare for reading of the event
42      */
43     void StartDataReading( int guessForNumberOfClusters = 256 );
44
45     /**
46      *  read next cluster
47      */
48     void ReadCluster( int id, int iSlice, int iRow, float X, float Y, float Z, float Amp ) {
49       fClusterData[iSlice].ReadCluster( id, iRow, X, Y, Z, Amp );
50     }
51
52     /**
53      * finish reading of the event
54      */
55     void FinishDataReading();
56
57     /**
58      *  perform event reconstruction
59      */
60     void ProcessEvent();
61
62
63     int NSlices() const { return fgkNSlices; }
64
65     double LastTime( int iTimer ) const { return fLastTime[iTimer]; }
66     double StatTime( int iTimer ) const { return fStatTime[iTimer]; }
67     int StatNEvents() const { return fStatNEvents; }
68
69     void WriteSettings( std::ostream &out ) const;
70     void WriteEvent( std::ostream &out ) const;
71     void WriteTracks( std::ostream &out ) const;
72
73     void ReadSettings( std::istream &in );
74     void ReadEvent( std::istream &in ) const;
75     void ReadTracks( std::istream &in );
76
77   private:
78
79     static const int fgkNSlices = 36;       //* N slices
80
81     AliHLTTPCCAStandaloneFramework( const AliHLTTPCCAStandaloneFramework& );
82     const AliHLTTPCCAStandaloneFramework &operator=( const AliHLTTPCCAStandaloneFramework& ) const;
83
84     AliHLTTPCCATracker fSliceTrackers[fgkNSlices]; //* array of slice trackers
85     AliHLTTPCCAMerger fMerger;  //* global merger
86     AliHLTTPCCAClusterData fClusterData[fgkNSlices];
87
88     double fLastTime[20]; //* timers
89     double fStatTime[20]; //* timers
90     int fStatNEvents;    //* n events proceed
91 };
92
93 #endif