]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliFlatTPCCluster.h
684cdc2ed048a096d1ecc132ae029cb39216240b
[u/mrichter/AliRoot.git] / HLT / global / AliFlatTPCCluster.h
1 #ifndef ALIFLATTPCCLUSTER_H
2 #define ALIFLATTPCCLUSTER_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  * >> Flat structure representing a TPC cluster <<
10  */
11
12 #include "Rtypes.h"
13 #include "AliVMisc.h"
14 #include "AliTPCclusterMI.h"
15 #include "AliComplexCluster.h"
16
17 class AliFlatTPCCluster
18 {
19   public:
20
21  AliFlatTPCCluster() : fX(0.), fY(0.), fZ(0.), fSector(0), fPadRow(0), fSigmaY2(0.), fSigmaZ2(0.), fCharge(0), fQMax(0), fTrackAngleY(0), fTrackAngleZ(0) {}
22
23   AliFlatTPCCluster(AliVConstructorReinitialisationFlag ); // do nothing
24  
25   void Reinitialize(){} // do nothing
26
27   ~AliFlatTPCCluster() {}
28
29   void SetX(Float_t x)             {fX = x;}
30   void SetY(Float_t y)             {fY = y;}
31   void SetZ(Float_t z)             {fZ = z;}
32   void SetSector(UShort_t sector)  {fSector = sector;}
33   void SetPadRow(UShort_t padrow)  {fPadRow = padrow;}
34   void SetSigmaY2(Float_t sigmaY2) {fSigmaY2 = sigmaY2;}
35   void SetSigmaZ2(Float_t sigmaZ2) {fSigmaZ2 = sigmaZ2;}
36   void SetCharge(UShort_t charge)  {fCharge = charge;}
37   void SetQMax(UShort_t qmax)      {fQMax = qmax;}
38   void SetTrackAngleY( Float_t angY ) {fTrackAngleY = angY;}  
39   void SetTrackAngleZ( Float_t angZ ) {fTrackAngleZ = angZ;}
40  
41   Float_t  GetX()       const      {return fX;}
42   Float_t  GetY()       const      {return fY;}
43   Float_t  GetZ()       const      {return fZ;}
44   UShort_t GetSector()  const      {return fSector;}
45   UShort_t GetPadRow()  const      {return fPadRow;}
46   Float_t  GetSigmaY2() const      {return fSigmaY2;}
47   Float_t  GetSigmaZ2() const      {return fSigmaZ2;}
48   UShort_t GetCharge()  const      {return fCharge;}
49   UShort_t GetQMax()    const      {return fQMax;}
50   
51   Float_t GetTrackAngleY() const {return fTrackAngleY;}
52   Float_t GetTrackAngleZ() const {return fTrackAngleZ;}
53
54   void SetTPCCluster( const AliTPCclusterMI *c, const AliTPCTrackerPoint *p );
55   void GetTPCCluster( AliTPCclusterMI *c, AliTPCTrackerPoint *p  ) const;
56
57   private:
58
59   Float_t fX;       // X coordinate in local coordinates
60   Float_t fY;       // Y coordinate in local coordinates
61   Float_t fZ;       // Z coordinate in local coordinates
62   UChar_t fSector;  // TPC sector
63   UChar_t fPadRow;  // Pad row number withing the sector
64   Float_t fSigmaY2; // error (former width) of the clusters
65   Float_t fSigmaZ2; // error (former width) of the clusters
66   UInt_t  fCharge;  // total charge of cluster
67   UInt_t  fQMax;    // QMax of cluster
68   Float_t fTrackAngleY; // tracker point angle Y
69   Float_t fTrackAngleZ; // tracker point angle Z
70 };
71
72 #pragma GCC diagnostic ignored "-Weffc++" 
73 inline AliFlatTPCCluster::AliFlatTPCCluster(AliVConstructorReinitialisationFlag ){}
74 #pragma GCC diagnostic warning "-Weffc++" 
75
76 inline void AliFlatTPCCluster::SetTPCCluster( const AliTPCclusterMI *c, const AliTPCTrackerPoint *p  )
77 {
78   if( !c ) return;
79   SetX( c->GetX() );
80   SetY( c->GetY() );
81   SetZ( c->GetZ() );
82   SetSector( c->GetDetector() );
83   SetPadRow( c->GetRow() );
84   SetSigmaY2( c->GetSigmaY2() );
85   SetSigmaZ2( c->GetSigmaZ2() );
86   SetCharge( c->GetQ() );
87   SetQMax( c->GetMax() );
88   if( p ){
89     SetTrackAngleY( p->GetAngleY() );  
90     SetTrackAngleZ( p->GetAngleZ() );  
91   } else {
92     SetTrackAngleY( 0. );  
93     SetTrackAngleZ( 0. );  
94   }
95 }
96
97 inline void AliFlatTPCCluster::GetTPCCluster( AliTPCclusterMI *c, AliTPCTrackerPoint *p ) const
98 {
99   if( c ){
100     c->SetX( GetX() );
101     c->SetY( GetY() );
102     c->SetZ( GetZ() );
103     c->SetDetector( GetSector() );
104     c->SetRow( GetPadRow() );
105     c->SetSigmaY2( GetSigmaY2() );
106     c->SetSigmaZ2( GetSigmaZ2() );
107     c->SetQ( GetCharge() );
108     c->SetMax( GetQMax() );
109   }
110   if( p ){
111     p->SetAngleY( GetTrackAngleY() );
112     p->SetAngleZ( GetTrackAngleZ() );
113   }
114 }
115
116 #endif