StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AliHLTTPCCAGBTracker.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 ALIHLTTPCCAGBTRACKER_H
10 #define ALIHLTTPCCAGBTRACKER_H
11 
12 #include "AliHLTTPCCADef.h"
13 #include "AliHLTTPCCATrackParam.h"
14 #include "AliHLTArray.h"
15 #include "AliHLTTPCCAGBHit.h"
16 #include "AliHLTTPCCAGBTrack.h"
17 #include "AliHLTTPCCATracker.h"
18 
19 #include <cstdio>
20 #include <iostream>
21 #include <vector>
22 #include <string>
23 using std::string;
24 
25 class AliHLTTPCCAMerger;
26 
42 {
43 
44  public:
47  void Init();
48 
49  void StartEvent();
50  void SetNSlices( int N );
51  void SetNHits( int nHits );
52 
53  void FindTracks();
54 
55  void Merge();
56 
57  AliHLTArray<AliHLTTPCCATracker> Slices() const { return fSlices; }
58  const AliHLTTPCCATracker &Slice( int index ) const { return fSlices[index]; }
59  const AliHLTTPCCAGBHit *Hits() const { return fHits.Data(); }
60  const AliHLTTPCCAGBHit &Hit( int index ) const { return fHits[index]; }
61  int Ext2IntHitID( int i ) const { return fExt2IntHitID[i]; }
62  int NHits() const { return fNHits; }
63  int NSlices() const { return fNSlices; }
64  double Time() const { return fTime; }
65  double StatTime( int iTimer ) const { return fStatTime[iTimer]; }
66  int NTimers() const { return fNTimers; }
67  int StatNEvents() const { return fStatNEvents; }
68  int NTracks() const { return fNTracks; }
69  AliHLTTPCCAGBTrack *Tracks() const { return fTracks; }
70  AliHLTTPCCAGBTrack *Tracks() { return fTracks; }
71  const AliHLTTPCCAGBTrack &Track( int i ) const { return fTracks[i]; }
72  int *TrackHits() const { return fTrackHits; }
73  int *TrackHits() { return fTrackHits; }
74  int TrackHit( int i ) const { return fTrackHits[i]; }
75 
77  float &Alpha, int hits[], int &NTrackHits,
78  bool dir );
79 
80  void WriteSettings( std::ostream &out ) const;
81  void ReadSettings( std::istream &in );
82  void WriteEvent( FILE *out ) const;
83  void ReadEvent( FILE *in );
84  void WriteTracks( const string& prefix ) const;
85  void ReadTracks( std::istream &in );
86 
87  void SaveHitsInFile( string prefix ) const; // Save Hits in txt file. @prefix - prefix for file name. Ex: "./data/ev1"
88  void SaveSettingsInFile( string prefix ) const; // Save geometry in txt file. @prefix - prefix for file name. Ex: "./data/"
89  bool ReadHitsFromFile( string prefix );
90  bool ReadSettingsFromFile( string prefix );
91 
92  double SliceTrackerTime() const { return fSliceTrackerTime; }
93  double SliceTrackerCpuTime() const { return fSliceTrackerCpuTime; }
94  const int *FirstSliceHit() const { return fFirstSliceHit; }
95  int FirstSliceHit(int i) const { return fFirstSliceHit[i]; }
96 
97  void StoreToFile( const char *filename ) const;
98  void RestoreFromFile( FILE *f );
99 
100  void SetHits( const std::vector<AliHLTTPCCAGBHit> &hits); // need for StRoot
101  void SetHits( const AliHLTTPCCAGBHit *hits, int nHits ); // for CA_parallel
102  void SetSettings( const std::vector<AliHLTTPCCAParam>& settings ); // need for StRoot
103  int GetHitsSize() const {return fHits.Size();}
104 
106 // void GroupHits(); // iklm
107  friend class AliHLTTPCCAPerformance; //dbg
108  protected:
109 
110  AliHLTResizableArray<AliHLTTPCCATracker> fSlices; //* array of slice trackers
111  int fNSlices; //* N slices
112  AliHLTResizableArray<AliHLTTPCCAGBHit> fHits; //* hit array
113  int *fExt2IntHitID; //* array of internal hit indices
114  int fNHits; //* N hits in event
115  int *fTrackHits; //* track->hits reference array
116  AliHLTTPCCAGBTrack *fTracks; //* array of tracks
117  int fNTracks; //* N tracks
118  AliHLTTPCCAMerger *fMerger; //* global merger
119 
121 
122  double fTime; //* total time
123  static const int fNTimers = 25;
124  double fStatTime[fNTimers]; //* timers
125  int fStatNEvents; //* n events proceed
126  int fFirstSliceHit[100]; // hit array
127 
128  double fSliceTrackerTime; // reco time of the slice tracker;
129  double fSliceTrackerCpuTime; // reco time of the slice tracker;
130 
131  private:
133  AliHLTTPCCAGBTracker &operator=( const AliHLTTPCCAGBTracker& );
134 };
135 
136 #endif
friend class AliHLTTPCCAPerformance
Try to group close hits in row formed by one track. After sort hits.
void SetHits(const std::vector< AliHLTTPCCAGBHit > &hits)
Try to group close hits in row formed by one track. After sort hits.
int Size() const
Definition: AliHLTArray.h:381
bool FitTrack(AliHLTTPCCATrackParam &T, AliHLTTPCCATrackParam t0, float &Alpha, int hits[], int &NTrackHits, bool dir)
C++ STL includes.
Definition: AgUStep.h:47