]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDcluster.h
4309c2e46f75680c8ea58f54dd008faa3ff8a594
[u/mrichter/AliRoot.git] / TRD / AliTRDcluster.h
1 #ifndef ALITRDCLUSTER_H
2 #define ALITRDCLUSTER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ///////////////////////////////////////////////////////////////////////////////
9 //                                                                           //
10 //  TRD cluster                                                              //
11 //                                                                           //
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include "AliCluster.h"  
15
16 class AliTRDcluster : public AliCluster {
17
18  public:
19
20   enum { kInChamber = BIT(14)
21        , kUsed      = BIT(15)
22        , kShared    = BIT(16)
23   };
24   enum { kMaskedLeft   = 0
25        , kMaskedCenter = 1
26        , kMaskedRight  = 2
27   };
28
29   AliTRDcluster();
30   AliTRDcluster(
31     Int_t det, Float_t q, Float_t *pos, Float_t *sig,
32     Int_t *tracks, Char_t npads, Short_t *signals,
33     UChar_t col, UChar_t row, UChar_t time,
34     Char_t timebin, Float_t center, UShort_t volid);
35   AliTRDcluster(const AliTRDcluster &c);
36   virtual ~AliTRDcluster() {};
37
38   virtual void     AddTrackIndex(Int_t *i); 
39   void     Clear(Option_t *o="");
40   
41   Bool_t   IsEqual(const TObject *otherCluster) const;
42   Bool_t   IsInChamber() const             { return TestBit(kInChamber);       }
43   Bool_t   IsMasked() const                { return fClusterMasking ? kTRUE : kFALSE; }
44   Bool_t   IsShared() const                { return TestBit(kShared);          }
45   Bool_t   IsUsed() const                  { return TestBit(kUsed); }
46
47   UChar_t  GetPadMaskedPosition() const    { return fClusterMasking & 7; }
48   UChar_t  GetPadMaskedStatus() const      { return fClusterMasking >> 3; }
49   Int_t    GetDetector() const             { return fDetector;      }
50   Int_t    GetLocalTimeBin() const         { return fLocalTimeBin;  }
51   Float_t  GetQ() const                    { return fQ;             }
52   Int_t    GetNPads() const                { return fNPads;         }
53   Float_t  GetCenter() const               { return fCenter;        }
54   Int_t    GetPadCol() const               { return fPadCol;        }
55   Int_t    GetPadRow() const               { return fPadRow;        }
56   Int_t    GetPadTime() const              { return fPadTime;       }
57   Short_t *GetSignals()                    { return fSignals;       }
58   Float_t  GetSumS() const;
59   
60   void     Print(Option_t* o="") const;
61
62   void     SetLocalTimeBin(Char_t t)       { fLocalTimeBin = t;     }
63   void     SetInChamber(Bool_t in = kTRUE) { SetBit(kInChamber,in); }
64   void     SetPadMaskedPosition(UChar_t position);
65   void     SetPadMaskedStatus(UChar_t status);
66   void     SetPadCol(UChar_t inPadCol){ fPadCol = inPadCol;}
67   void     SetPadRow(UChar_t inPadRow){ fPadRow = inPadRow;}
68   void     SetPadTime(UChar_t inPadTime){ fPadTime = inPadTime;}
69   void     SetDetector(Short_t inDetector){ fDetector = inDetector;}
70   void     SetQ(Float_t inQ){ fQ = inQ;}
71   void     SetClusterMasking(UChar_t inClusterMasking){ fClusterMasking = inClusterMasking;}
72   void     SetShared(Bool_t sh  = kTRUE)   { SetBit(kShared,sh);    }
73   void     Use(Int_t = 0)                  { SetBit(kUsed, kTRUE);              }
74
75   protected:
76     UChar_t fPadCol;         //  Central pad number in column direction
77     UChar_t fPadRow;         //  Central pad number in row direction
78     UChar_t fPadTime;        //  Uncalibrated time bin number
79     Char_t  fLocalTimeBin;   //  T0-calibrated time bin number
80     UChar_t fNPads;          //  Number of pads in cluster
81     UChar_t fClusterMasking; //  Bit field containing cluster status information;
82     Short_t fDetector;       //  TRD detector number
83     Short_t fSignals[7];     //  Signals in the cluster
84     Float_t fQ;              //  Amplitude 
85     Float_t fCenter;         //  Center of the cluster relative to the pad 
86
87     ClassDef(AliTRDcluster, 6)        //  Cluster for the TRD
88 };
89 #endif