]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDtrackletWord.h
Clean up
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackletWord.h
index 2ace14c7b7c3ff4afdba964c79acade30ab136f2..352c36f835d1fe9ae9c015df438982f02682081b 100644 (file)
@@ -13,6 +13,8 @@
 //----------------------------------
 
 #include "AliTRDtrackletBase.h"
+#include "AliTRDgeometry.h"
+#include "AliTRDpadPlane.h"
 
 class AliTRDtrackletWord : public AliTRDtrackletBase {
  public:
@@ -27,15 +29,20 @@ class AliTRDtrackletWord : public AliTRDtrackletBase {
   Int_t GetZbin() const { return ((fTrackletWord >> 20) & 0xf); }
   Int_t GetPID() const { return ((fTrackletWord >> 24) & 0xff); }
 
+  Int_t GetROB() const;
+  Int_t GetMCM() const; 
+
   // ----- Getters for offline corresponding values -----
   Bool_t CookPID() { return kFALSE; }
   Double_t GetPID(Int_t /* is */) const { return 0; }
   Int_t GetDetector() const { return fHCId / 2; }
   Int_t GetHCId() const { return fHCId; }
   Float_t GetdYdX() const { return (GetdY() * 140e-4 / 3.); }
-  Float_t GetX() const { return 0; }
+  Float_t GetX() const { return fgGeo->GetTime0((fHCId%12)/2); }
   Float_t GetY() const { return (GetYbin() * 160e-4); }
-  Float_t GetZ() const { return 0; }
+  Float_t GetZ() const { return fgGeo->GetPadPlane((fHCId % 12) / 2, (fHCId/12) % 5)->GetRowPos(GetZbin()) -
+      fgGeo->GetPadPlane((fHCId % 12) / 2, (fHCId/12) % 5)->GetRowSize(GetZbin()); }
+  Float_t GetLocalZ() const { return GetZ() - fgGeo->GetPadPlane((fHCId % 12) / 2, (fHCId/12) % 5)->GetRowPos(8); }
 
   UInt_t GetTrackletWord() const { return fTrackletWord; }
   void SetTrackletWord(UInt_t trackletWord) { fTrackletWord = trackletWord; }
@@ -44,14 +51,15 @@ class AliTRDtrackletWord : public AliTRDtrackletBase {
   void SetHCId(Int_t id) { fHCId = id; }
 
  protected:
-  Int_t fHCId;                  //! half-chamber ID (only transient)
+  Int_t fHCId;                  // half-chamber ID
   UInt_t fTrackletWord;                // tracklet word: PID | Z | deflection length | Y 
                                //          bits:  12   4            7          13
+  static AliTRDgeometry *fgGeo;  // pointer to TRD geometry for coordinate calculations
 
  private:
   AliTRDtrackletWord& operator=(const AliTRDtrackletWord &rhs);   // not implemented
 
-  ClassDef(AliTRDtrackletWord, 1);
+  ClassDef(AliTRDtrackletWord, 2);
 };
 
 #endif