]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliFlatTPCseed.h
flat friends update
[u/mrichter/AliRoot.git] / HLT / global / AliFlatTPCseed.h
1 #ifndef ALIFLATTPCSEED_H
2 #define ALIFLATTPCSEED_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               *
6  * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli     */
7
8 /*
9  * See implementation file for documentation
10  */
11
12
13 #include "Rtypes.h"
14
15 #include "AliFlatTPCCluster.h"
16 #include "AliVfriendTrack.h"
17 #include "AliVMisc.h"
18 #include "AliFlatExternalTrackParam.h"
19 #include "AliTPCseed.h"
20
21 class AliESDtrack;
22 class AliESDfriendTrack;
23 class AliExternalTrackParam;
24
25 class AliFlatTPCseed  
26 {
27  public:
28
29   // --------------------------------------------------------------------------------
30   // -- Constructor / Destructors
31   AliFlatTPCseed();
32   ~AliFlatTPCseed() {}
33  
34   // constructor and method for reinitialisation of virtual table  
35   AliFlatTPCseed( AliVConstructorReinitialisationFlag );
36   void Reinitialize() { new (this) AliFlatTPCseed( AliVReinitialize ); }
37
38   // -- Getters 
39
40   void GetTPCseed( AliTPCseed *p ) const;
41
42   Int_t GetLabel() const { return fLabel; }
43   Int_t GetNClusters() const { return fNTPCClusters; }
44
45   const AliFlatTPCCluster *GetClusters() const { return reinterpret_cast< const AliFlatTPCCluster* >( fContent ); }
46   AliFlatTPCCluster *GetClustersNonConst(){ return reinterpret_cast< AliFlatTPCCluster* >( fContent ); }
47
48   // -- Set methods
49  
50   void Reset();
51
52   void SetFromTPCseed( const AliTPCseed *p );
53
54   void SetExternalTrackParam( const AliExternalTrackParam* p ){ fParam.SetExternalTrackParam(  p ); }
55
56   void SetLabel( Int_t lab ){ fLabel=lab; }
57
58   void AddCluster( const AliTPCclusterMI *cl, const AliTPCTrackerPoint *p ){ if(cl) GetClustersNonConst()[fNTPCClusters++].SetTPCCluster( cl, p );  }
59
60
61   // --------------------------------------------------------------------------------
62   // -- Size methods
63
64   static size_t EstimateSize(){
65     return sizeof(AliFlatTPCseed) + 160*sizeof(AliFlatTPCCluster);
66   }
67
68   size_t GetSize() const { return fContent -  reinterpret_cast<const Byte_t*>(this) + fContentSize; }
69
70  private: 
71
72   AliFlatTPCseed(const AliFlatTPCseed &);
73   AliFlatTPCseed& operator=(const AliFlatTPCseed& ); 
74
75   // --------------------------------------------------------------------------------
76
77   ULong64_t fContentSize;                      // Size of this object
78   
79   // --------------------------------------------------------------------------------
80   
81   AliFlatExternalTrackParam fParam;
82   Int_t fLabel;
83   Int_t fNTPCClusters;
84   Byte_t fContent[1];                  // Variale size object, which contains all data
85
86 };
87
88 inline AliFlatTPCseed::AliFlatTPCseed()
89   :
90   fContentSize(0),
91   fParam(),
92   fLabel(-1),
93   fNTPCClusters(0)
94 {
95   // constructor
96   fContent[0]=0;
97 }
98
99 #pragma GCC diagnostic ignored "-Weffc++" 
100 inline AliFlatTPCseed::AliFlatTPCseed( AliVConstructorReinitialisationFlag  )
101 {
102   // reinitialise vtable
103   fParam.Reinitialize();
104   AliFlatTPCCluster *clusters = reinterpret_cast< AliFlatTPCCluster* >( fContent );  
105   for( Int_t ic=0; ic<fNTPCClusters; ic++ ){
106     clusters[ic].Reinitialize();
107   }
108 }
109 #pragma GCC diagnostic warning "-Weffc++" 
110
111
112 inline void AliFlatTPCseed::Reset()
113 {
114   // Reset
115   fContentSize = 0;
116   fNTPCClusters = 0;
117   fLabel=-1;
118 }
119
120 #endif