]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDcluster.h
Separating run-dependent mapping data from data, which are not
[u/mrichter/AliRoot.git] / TRD / AliTRDcluster.h
index ea563f20c461896aece31ce955e8333b8ce2dadd..68012db86ff8cb6ffdc6169df820892c403cb123 100644 (file)
@@ -5,80 +5,73 @@
 
 /* $Id$ */
 
-#include <TObject.h>
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  TRD cluster                                                              //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
 
-class AliTRDrecPoint;
+#include "AliCluster.h"  
 
-class AliTRDcluster : public TObject {
+class AliTRDcluster : public AliCluster {
 
  public:
 
-  AliTRDcluster();
-  AliTRDcluster(const AliTRDcluster &c);
-  AliTRDcluster(const AliTRDrecPoint &p);
-  virtual ~AliTRDcluster();
-  AliTRDcluster &operator=(const AliTRDcluster &c);
-
-  virtual void    Copy(TObject &c);
-  virtual void    AddTrackIndex(Int_t *i);
-   
-          Int_t   GetDetector() const             { return fDetector; }
-          Int_t   GetLocalTimeBin() const         { return fTimeBin;  }
-
-          Float_t GetSigmaY2() const              { return fSigmaY2; }
-          Float_t GetSigmaZ2() const              { return fSigmaZ2; }
-          Float_t GetY() const                    { return fY; }
-          Float_t GetZ() const                    { return fZ; }
-          Float_t GetQ() const                    { return fQ; }
-
-          Int_t   IsUsed() const                  { return (fQ < 0) ? 1 : 0; }
-          void    Use()                           { fQ = -fQ; }
-          Int_t   GetTrackIndex(Int_t i) const    { return fTracks[i]; }
-
-          Bool_t  From2pad() const                { return TestBit(k2pad);  }
-          Bool_t  From3pad() const                { return TestBit(k3pad);  }
-          Bool_t  From4pad() const                { return TestBit(k4pad);  }
-          Bool_t  From5pad() const                { return TestBit(k5pad);  }
-          Bool_t  FromLarge() const               { return TestBit(kLarge); }
-          Bool_t  Isolated() const                { return (TestBit(k2pad) || TestBit(k3pad)); }
-          void    SetDetector(Int_t d)            { fDetector  = d; }
-          void    SetLocalTimeBin(Int_t t)        { fTimeBin   = t; }
-          void    SetQ(Float_t q)                 { fQ         = q; }
-          void    SetY(Float_t y)                 { fY         = y; }
-          void    SetZ(Float_t z)                 { fZ         = z; }
-          void    SetTrackIndex(Int_t i, Int_t t) { fTracks[i] = t; } 
-          void    SetSigmaY2(Float_t s)           { fSigmaY2   = s; }
-          void    SetSigmaZ2(Float_t s)           { fSigmaZ2   = s; }
-
-          void    Set2pad()                       { SetBit(k2pad);  }
-          void    Set3pad()                       { SetBit(k3pad);  }
-          void    Set4pad()                       { SetBit(k4pad);  }
-          void    Set5pad()                       { SetBit(k5pad);  }
-          void    SetLarge()                      { SetBit(kLarge); }
-
- protected:
-
-  enum {
-    k2pad  = 0x00000001,   // 2 pad cluster
-    k3pad  = 0x00000002,   // 3 pad cluster
-    k4pad  = 0x00000004,   // 4 pad cluster
-    k5pad  = 0x00000008,   // 5 pad cluster
-    kLarge = 0x00000016    // Large cluster
+  enum { kInChamber = BIT(1)
+       , kShared    = BIT(2)
+  };
+  enum { kMaskedLeft = BIT(0)
+      , kMaskedCenter= BIT(1)
+      , kMaskedRight = BIT(2)
   };
 
-  Int_t    fDetector;       // TRD detector number
-  Int_t    fTimeBin;        // Time bin number within the detector
-
-  Int_t    fTracks[3];      // labels of overlapped tracks
-  Float_t  fQ;              // amplitude 
-  Float_t  fY;              // local Rphi coordinate (cm) within tracking sector
-  Float_t  fZ;              // local Z coordinate (cm) within tracking sector
-  Float_t  fSigmaY2;        // Y variance (cm)
-  Float_t  fSigmaZ2;        // Z variance (cm)  
-
-  ClassDef(AliTRDcluster,1) // Cluster for the TRD
+  AliTRDcluster();
+  AliTRDcluster(Int_t det, Float_t q, Float_t *pos, Float_t *sig
+              , Int_t *tracks, Char_t npads, Short_t *signals
+              , UChar_t col, UChar_t row, UChar_t time
+              , Char_t timebin, Float_t center, UShort_t volid);
+  AliTRDcluster(const AliTRDcluster &c);
+  virtual ~AliTRDcluster() {};
+
+  virtual void     AddTrackIndex(Int_t *i); 
+
+          Bool_t   IsInChamber() const             { return TestBit(kInChamber);       }
+          Bool_t   IsMasked() const                { return fClusterMasking ? kTRUE : kFALSE; }
+          Bool_t   IsShared() const                { return TestBit(kShared);          }
+          Bool_t   IsUsed() const                  { return (fQ < 0) ? kTRUE : kFALSE; }
+
+          UChar_t  GetPadMaskedPosition() const    { return fClusterMasking & 7; }
+          UChar_t  GetPadMaskedStatus() const      { return fClusterMasking >> 3; }
+          Int_t    GetDetector() const             { return fDetector;      }
+          Int_t    GetLocalTimeBin() const         { return fLocalTimeBin;  }
+          Float_t  GetQ() const                    { return fQ;             }
+          Int_t    GetNPads() const                { return fNPads;         }
+          Float_t  GetCenter() const               { return fCenter;        }
+          Int_t    GetPadCol() const               { return fPadCol;        }
+          Int_t    GetPadRow() const               { return fPadRow;        }
+          Int_t    GetPadTime() const              { return fPadTime;       }
+          Short_t *GetSignals()                    { return fSignals;       }
+          Float_t  GetSumS() const;
+
+          void     SetLocalTimeBin(Char_t t)       { fLocalTimeBin = t;     }
+          void     SetInChamber(Bool_t in = kTRUE) { SetBit(kInChamber,in); }
+          void     SetPadMaskedPosition(UChar_t position);
+          void     SetPadMaskedStatus(UChar_t status);
+          void     SetShared(Bool_t sh  = kTRUE)   { SetBit(kShared,sh);    }
+          void     Use(Int_t = 0)                  { fQ = -fQ;              }
+
+  protected:
+    UChar_t fPadCol;         //  Central pad number in column direction
+    UChar_t fPadRow;         //  Central pad number in row direction
+    UChar_t fPadTime;        //  Uncalibrated time bin number
+    Char_t  fLocalTimeBin;   //  T0-calibrated time bin number
+    UChar_t fNPads;          //  Number of pads in cluster
+    UChar_t fClusterMasking; //  Bit field containing cluster status information;
+    Short_t fDetector;       //  TRD detector number
+    Short_t fSignals[7];     //  Signals in the cluster
+    Float_t fQ;              //  Amplitude 
+    Float_t fCenter;         //  Center of the cluster relative to the pad 
+
+    ClassDef(AliTRDcluster, 6)        //  Cluster for the TRD
 };
-
 #endif